Skip to content

Commit 5dca6ee

Browse files
Liu Bomasoncl
authored andcommitted
Btrfs: mark mapping with error flag to report errors to userspace
According to commit 865ffef (fs: fix fsync() error reporting), it's not stable to just check error pages because pages can be truncated or invalidated, we should also mark mapping with error flag so that a later fsync can catch the error. Signed-off-by: Liu Bo <[email protected]> Signed-off-by: Chris Mason <[email protected]>
1 parent 29cc83f commit 5dca6ee

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/btrfs/extent_io.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2367,6 +2367,8 @@ int end_extent_writepage(struct page *page, int err, u64 start, u64 end)
23672367
if (!uptodate) {
23682368
ClearPageUptodate(page);
23692369
SetPageError(page);
2370+
ret = ret < 0 ? ret : -EIO;
2371+
mapping_set_error(page->mapping, ret);
23702372
}
23712373
return 0;
23722374
}

0 commit comments

Comments
 (0)