linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iomap: Handle I/O errors gracefully in page_mkwrite
@ 2020-06-04 20:23 Matthew Wilcox
  2020-06-04 22:57 ` Dave Chinner
  0 siblings, 1 reply; 12+ messages in thread
From: Matthew Wilcox @ 2020-06-04 20:23 UTC (permalink / raw)
  To: Christoph Hellwig, Darrick J. Wong, linux-xfs, linux-fsdevel,
	linux-kernel
  Cc: Matthew Wilcox (Oracle)

From: "Matthew Wilcox (Oracle)" <willy@infradead.org>

Test generic/019 often results in:

WARNING: at fs/iomap/buffered-io.c:1069 iomap_page_mkwrite_actor+0x57/0x70

Since this can happen due to a storage error, we should not WARN for it.
Just return -EIO, which will be converted to a SIGBUS for the hapless
task attempting to write to the page that we can't read.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/iomap/buffered-io.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 89e21961d1ad..ae6c5e38f0e8 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -1066,7 +1066,8 @@ iomap_page_mkwrite_actor(struct inode *inode, loff_t pos, loff_t length,
 			return ret;
 		block_commit_write(page, 0, length);
 	} else {
-		WARN_ON_ONCE(!PageUptodate(page));
+		if (!PageUptodate(page))
+			return -EIO;
 		iomap_page_create(inode, page);
 		set_page_dirty(page);
 	}
-- 
2.26.2


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

end of thread, other threads:[~2020-06-05 22:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-04 20:23 [PATCH] iomap: Handle I/O errors gracefully in page_mkwrite Matthew Wilcox
2020-06-04 22:57 ` Dave Chinner
2020-06-04 23:05   ` Matthew Wilcox
2020-06-04 23:30     ` Dave Chinner
2020-06-04 23:50       ` Matthew Wilcox
2020-06-05  0:31         ` Dave Chinner
2020-06-05  2:24           ` Matthew Wilcox
2020-06-05  3:07             ` Dave Chinner
2020-06-05 12:48               ` Matthew Wilcox
2020-06-05 16:18                 ` Darrick J. Wong
2020-06-05 21:48                 ` Dave Chinner
2020-06-05 22:49                   ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).