Skip to content

Commit bff5baf

Browse files
Colin Ian Kingkdave
authored andcommitted
btrfs: fix incorrect error return ret being passed to mapping_set_error
The setting of return code ret should be based on the error code passed into function end_extent_writepage and not on ret. Thanks to Liu Bo for spotting this mistake in the original fix I submitted. Detected by CoverityScan, CID#1414312 ("Logically dead code") Fixes: 5dca6ee ("Btrfs: mark mapping with error flag to report errors to userspace") Signed-off-by: Colin Ian King <[email protected]> Reviewed-by: Liu Bo <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 8d91012 commit bff5baf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/extent_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2458,7 +2458,7 @@ void end_extent_writepage(struct page *page, int err, u64 start, u64 end)
24582458
if (!uptodate) {
24592459
ClearPageUptodate(page);
24602460
SetPageError(page);
2461-
ret = ret < 0 ? ret : -EIO;
2461+
ret = err < 0 ? err : -EIO;
24622462
mapping_set_error(page->mapping, ret);
24632463
}
24642464
}

0 commit comments

Comments
 (0)