summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2017-05-09 18:14:01 +0100
committerBen Hutchings <ben@decadent.org.uk>2017-09-15 18:29:39 +0100
commit102a7f69c8bac63ce5e951e9ca27fd8c39ab645a (patch)
treebb99ecec9209db98b9d0a35d22fd1183b2b0b7c9 /fs
parent1c57b8f051647979e862c22c567b4aca27d071b2 (diff)
downloadlinux-stable-102a7f69c8bac63ce5e951e9ca27fd8c39ab645a.tar.gz
linux-stable-102a7f69c8bac63ce5e951e9ca27fd8c39ab645a.tar.bz2
linux-stable-102a7f69c8bac63ce5e951e9ca27fd8c39ab645a.zip
btrfs: fix incorrect error return ret being passed to mapping_set_error
commit bff5baf8aa37a97293725a16c03f49872249c07e upstream. 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: 5dca6eea91653e ("Btrfs: mark mapping with error flag to report errors to userspace") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/extent_io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 13ee2bb1ed9c..e987c0d56fd1 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2368,7 +2368,7 @@ int end_extent_writepage(struct page *page, int err, u64 start, u64 end)
if (!uptodate) {
ClearPageUptodate(page);
SetPageError(page);
- ret = ret < 0 ? ret : -EIO;
+ ret = err < 0 ? err : -EIO;
mapping_set_error(page->mapping, ret);
}
return 0;