[PATCH 02/14] iomap: treat inline data in iomap_writepage_map as an I/O error

Christoph Hellwig
2023-12-07T07:27:32Z

iomap_writepage_map aready warns about inline data, but then just ignores
it. Treat it as an error and return -EIO.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/iomap/buffered-io.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index fc5c64712318aa..2426cab70b7102 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -1818,8 +1818,10 @@ iomap_writepage_map(struct iomap_writepage_ctx *wpc,
if (error)
break;
trace_iomap_writepage_map(inode, &wpc->iomap);
- if (WARN_ON_ONCE(wpc->iomap.type == IOMAP_INLINE))
- continue;
+ if (WARN_ON_ONCE(wpc->iomap.type == IOMAP_INLINE)) {
+ error = -EIO;
+ break;
+ }
if (wpc->iomap.type == IOMAP_HOLE)
continue;
iomap_add_to_ioend(inode, pos, folio, ifs, wpc, wbc,
--
2.39.2