diff options
author | Christoph Hellwig <hch@lst.de> | 2019-10-17 13:12:17 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2019-10-21 08:51:59 -0700 |
commit | 3e19e6f3eeea26490a84cdd18c7220e640f4837e (patch) | |
tree | 35d0a98e33851bc5fb975a840c1bed11533e136c /fs/iomap | |
parent | 598ecfbaa742aca0dcdbbea25681406f95cc0b63 (diff) |
iomap: warn on inline maps in iomap_writepage_map
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>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/iomap')
-rw-r--r-- | fs/iomap/buffered-io.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 41e1828a0bb3..901c1a799238 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -1415,6 +1415,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, |