summaryrefslogtreecommitdiff
path: root/fs/iomap
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-08-11 04:32:55 +0300
committerDarrick J. Wong <djwong@kernel.org>2021-08-16 22:12:52 +0300
commitb69eea82d37d9ee7cfb3bf05103549dd4ed5ffc3 (patch)
treee3b66e6d938ed956593baa51616677ca6469dc46 /fs/iomap
parentae44f9c286da3fbb3f827076403ea64fa9adfef2 (diff)
downloadlinux-b69eea82d37d9ee7cfb3bf05103549dd4ed5ffc3.tar.xz
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')
-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);