[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200604202340.29170-1-willy@infradead.org>
Date: Thu, 4 Jun 2020 13:23:40 -0700
From: Matthew Wilcox <willy@...radead.org>
To: Christoph Hellwig <hch@...radead.org>,
"Darrick J. Wong" <darrick.wong@...cle.com>,
linux-xfs@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: "Matthew Wilcox (Oracle)" <willy@...radead.org>
Subject: [PATCH] iomap: Handle I/O errors gracefully in page_mkwrite
From: "Matthew Wilcox (Oracle)" <willy@...radead.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@...radead.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
Powered by blists - more mailing lists