]> www.infradead.org Git - users/willy/pagecache.git/commit
iomap: constrain the file range passed to iomap_file_unshare
authorDarrick J. Wong <djwong@kernel.org>
Wed, 2 Oct 2024 15:02:13 +0000 (08:02 -0700)
committerChristian Brauner <brauner@kernel.org>
Thu, 3 Oct 2024 08:22:28 +0000 (10:22 +0200)
commita311a08a4237241fb5b9d219d3e33346de6e83e0
treecb71af6db20462307d828bf15116734b08618768
parentf7a4874d977bf4202ad575031222e78809a36292
iomap: constrain the file range passed to iomap_file_unshare

File contents can only be shared (i.e. reflinked) below EOF, so it makes
no sense to try to unshare ranges beyond EOF.  Constrain the file range
parameters here so that we don't have to do that in the callers.

Fixes: 5f4e5752a8a3 ("fs: add iomap_file_dirty")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/20241002150213.GC21853@frogsfrogsfrogs
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/dax.c
fs/iomap/buffered-io.c