]> www.infradead.org Git - users/hch/xfs.git/commit
xfs: take XFS_MMAPLOCK_EXCL xfs_file_write_zero_eof
authorChristoph Hellwig <hch@lst.de>
Tue, 3 Sep 2024 08:24:34 +0000 (11:24 +0300)
committerChristoph Hellwig <hch@lst.de>
Fri, 18 Oct 2024 14:14:32 +0000 (16:14 +0200)
commit10b7fed42c5093b032ae8eaa9db36e828c0098a5
tree480210027178eeb0e7e259c7c1843b9420f4ae1d
parent191c5da0962c0f06f76a23f53abfc7017e4d9f1e
xfs: take XFS_MMAPLOCK_EXCL xfs_file_write_zero_eof

xfs_file_write_zero_eof is the only caller of xfs_zero_range that does
not take XFS_MMAPLOCK_EXCL (aka the invalidate lock).  Currently that
is actually the right thing, as an error in the iomap zeroing code will
also take the invalidate_lock to clean up, but to fix that deadlock we
need a consistent locking pattern first.

The only extra thing that XFS_MMAPLOCK_EXCL will lock out are read
pagefaults, which isn't really needed here, but also not actively
harmful.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/xfs_file.c
fs/xfs/xfs_iomap.c