xfs: remove a racy if_bytes check in xfs_reflink_end_cow_extent
authorChristoph Hellwig <hch@lst.de>
Thu, 2 May 2024 07:33:54 +0000 (09:33 +0200)
committerChandan Babu R <chandanbabu@kernel.org>
Fri, 3 May 2024 05:50:06 +0000 (11:20 +0530)
commit86de848403abda05bf9c16dcdb6bef65a8d88c41
tree5920cb215a92c4c18e026ce60302a9d02b36a2da
parent99fb6b7ad1f2fb83d8df2c1382be63a1f50b1ae0
xfs: remove a racy if_bytes check in xfs_reflink_end_cow_extent

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>
fs/xfs/xfs_reflink.c