iomap: treat inline data in iomap_writepage_map as an I/O error
authorChristoph Hellwig <hch@lst.de>
Thu, 7 Dec 2023 07:26:58 +0000 (08:26 +0100)
committerChristian Brauner <brauner@kernel.org>
Thu, 1 Feb 2024 13:20:10 +0000 (14:20 +0100)
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>
Link: https://lore.kernel.org/r/20231207072710.176093-3-hch@lst.de
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/iomap/buffered-io.c

index 228fd2e05e12f8a6081d50bf5c8a789336d2a207..1492706cdc3d21a15ff5e80bcd659e4de4cc5902 100644 (file)
@@ -1808,8 +1808,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,