All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iomap: pass writeback errors to the mapping
@ 2021-08-05 21:31 Darrick J. Wong
  2021-08-05 22:12 ` Matthew Wilcox
  0 siblings, 1 reply; 3+ messages in thread
From: Darrick J. Wong @ 2021-08-05 21:31 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Matthew Wilcox, Christoph Hellwig

From: Darrick J. Wong <djwong@kernel.org>

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>
---
 fs/iomap/buffered-io.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 87ccb3438bec..b06138c6190b 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -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);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-09 23:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-05 21:31 [PATCH] iomap: pass writeback errors to the mapping Darrick J. Wong
2021-08-05 22:12 ` Matthew Wilcox
2021-08-09 23:35   ` Darrick J. Wong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.