Skip to content

Commit

Permalink
iomap: pass writeback errors to the mapping
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Darrick J. Wong committed Aug 16, 2021
1 parent ae44f9c commit b69eea8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/iomap/buffered-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b69eea8

Please sign in to comment.