diff mbox series

[10/12] iomap: warn on inline maps in iomap_writepage_map

Message ID 20190722095024.19075-11-hch@lst.de (mailing list archive)
State Superseded
Headers show
Series [01/12] list.h: add list_pop and list_pop_entry helpers | expand

Commit Message

Christoph Hellwig July 22, 2019, 9:50 a.m. UTC
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 <hch@lst.de>
---
 fs/iomap/buffered-io.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 16f2ea46a238..91a9796f8a7c 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -1422,6 +1422,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,