iomap: move locking out of iomap_write_delalloc_release
authorChristoph Hellwig <hch@lst.de>
Tue, 8 Oct 2024 08:59:14 +0000 (10:59 +0200)
committerCarlos Maiolino <cem@kernel.org>
Tue, 15 Oct 2024 09:37:42 +0000 (11:37 +0200)
commitb78495166264fee1ed7ac44627e1dd080bbdf283
treeb93c5036f0baa4b6b7879cd1d28da3dc7ad852ba
parentcaf0ea451d97c33c5bbaa0074dad33b0b2a4e649
iomap: move locking out of iomap_write_delalloc_release

XFS (which currently is the only user of iomap_write_delalloc_release)
already holds invalidate_lock for most zeroing operations.  To be able
to avoid a deadlock it needs to stop taking the lock, but doing so
in iomap would leak XFS locking details into iomap.

To avoid this require the caller to hold invalidate_lock when calling
iomap_write_delalloc_release instead of taking it there.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/iomap/buffered-io.c
fs/xfs/xfs_iomap.c