summaryrefslogtreecommitdiffstats
path: root/fs/iomap/buffered-io.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-08-11 03:32:55 +0200
committerDarrick J. Wong <djwong@kernel.org>2021-08-16 21:12:52 +0200
commitb69eea82d37d9ee7cfb3bf05103549dd4ed5ffc3 (patch)
treee3b66e6d938ed956593baa51616677ca6469dc46 /fs/iomap/buffered-io.c
parentiomap: Add another assertion to inline data handling (diff)
downloadlinux-b69eea82d37d9ee7cfb3bf05103549dd4ed5ffc3.tar.xz
linux-b69eea82d37d9ee7cfb3bf05103549dd4ed5ffc3.zip
iomap: pass writeback errors to the mapping
Modern-day mapping_set_error has the ability to squash the usual negative error code into something appropriate for long-term storage in a struct address_space -- ENOSPC becomes AS_ENOSPC, and everything else becomes EIO. iomap squashes /everything/ to EIO, just as XFS did before that, but this doesn't make sense. Fix this by making it so that we can pass ENOSPC to userspace when writeback fails due to space problems. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Diffstat (limited to 'fs/iomap/buffered-io.c')
-rw-r--r--fs/iomap/buffered-io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 586d9d078ce1..43b9354bac3a 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -1026,7 +1026,7 @@ iomap_finish_page_writeback(struct inode *inode, struct page *page,
if (error) {
SetPageError(page);
- mapping_set_error(inode->i_mapping, -EIO);
+ mapping_set_error(inode->i_mapping, error);
}
WARN_ON_ONCE(i_blocks_per_page(inode, page) > 1 && !iop);