And inline mapping should never mark the page dirty and thus never end up
in writepages.  Add a check for that condition and warn if it happens.

Signed-off-by: Christoph Hellwig <h...@lst.de>
Reviewed-by: Darrick J. Wong <darrick.w...@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.w...@oracle.com>
---
 fs/iomap/buffered-io.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 3444f968e739..61f067b3261b 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -1409,6 +1409,8 @@ iomap_writepage_map(struct iomap_writepage_ctx *wpc,
                error = wpc->ops->map_blocks(wpc, inode, file_offset);
                if (error)
                        break;
+               if (WARN_ON_ONCE(wpc->iomap.type == IOMAP_INLINE))
+                       continue;
                if (wpc->iomap.type == IOMAP_HOLE)
                        continue;
                iomap_add_to_ioend(inode, file_offset, page, iop, wpc, wbc,
-- 
2.20.1

Reply via email to