iomap: pass writeback errors to the mapping
Subsystems (2)
PATCH 1/1 iomap: pass writeback errors to the mapping
From: Darrick J. Wong <[email protected]>
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.
--- fs/iomap/buffered-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/iomap/buffered-io.c +1 -1
@@ -1016,7 +1016,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);
Quoted 8 lines · Darrick J. Wong
From: Darrick J. Wong <[email protected]>
Modern-day
mapping_set_errorhas the ability to squash the usual negative error code into something appropriate for long-term storage in a structaddress_space-- ENOSPC becomesAS_ENOSPC, and everything else becomes EIO. iomap squashes /everything/ to EIO, just as XFS did before that, but this doesn't make sense.
Quoted 4 lines
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 <[email protected]>
I could have sworn I sent this patch in earlier. Anyway,
Quoted 9 lines · Matthew Wilcox
Quoted 8 lines · Darrick J. Wong
From: Darrick J. Wong <[email protected]>
Modern-day
mapping_set_errorhas the ability to squash the usual negative error code into something appropriate for long-term storage in a structaddress_space-- ENOSPC becomesAS_ENOSPC, and everything else becomes EIO. iomap squashes /everything/ to EIO, just as XFS did before that, but this doesn't make sense.
Quoted 8 lines
Quoted 4 lines
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 <[email protected]>I could have sworn I sent this patch in earlier. Anyway,
Reviewed-by Matthew Wilcox (Oracle) <[email protected]>
It was an RFC that I then forgot about for a while. I'll stuff this in the iomap for-next branch the next time I do an update, which ... let's see where the iomap iter series goes, review-wise.
--D