]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfs: remove a racy if_bytes check in xfs_reflink_end_cow_extent
authorChristoph Hellwig <hch@lst.de>
Wed, 30 Apr 2025 21:26:50 +0000 (14:26 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 May 2025 07:41:37 +0000 (09:41 +0200)
commit2edfd2c87c56a231f1c617703511c47065a3f39b
treece240335a7f29cdd811e14568733d670bf792620
parent1e2a60807f6957df60fa43b062cc17338d7ed571
xfs: remove a racy if_bytes check in xfs_reflink_end_cow_extent

[ Upstream commit 86de848403abda05bf9c16dcdb6bef65a8d88c41 ]

Accessing if_bytes without the ilock is racy.  Remove the initial
if_bytes == 0 check in xfs_reflink_end_cow_extent and let
ext_iext_lookup_extent fail for this case after we've taken the ilock.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
Acked-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_reflink.c