]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iomap: handle a post-direct I/O invalidate race in iomap_write_delalloc_release
authorChristoph Hellwig <hch@lst.de>
Tue, 10 Sep 2024 04:39:03 +0000 (07:39 +0300)
committerChristian Brauner <brauner@kernel.org>
Tue, 10 Sep 2024 09:13:43 +0000 (11:13 +0200)
commit7a9d43eace888a0ee6095035997bb138425844d3
tree80c7d87ec277ebac8f00a13f3f80f088e79e7973
parentb1daf3f8475fa2a4ffc1668043de738241f95d1d
iomap: handle a post-direct I/O invalidate race in iomap_write_delalloc_release

When direct I/O completions invalidates the page cache it holds neither the
i_rwsem nor the invalidate_lock so it can be racing with
iomap_write_delalloc_release.  If the search for the end of the region that
contains data returns the start offset we hit such a race and just need to
look for the end of the newly created hole instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240910043949.3481298-2-hch@lst.de
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/iomap/buffered-io.c