Skip to content

Commit 86de848

Browse files
Christoph HellwigChandan Babu R
authored andcommitted
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>
1 parent 99fb6b7 commit 86de848

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

fs/xfs/xfs_reflink.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -712,12 +712,6 @@ xfs_reflink_end_cow_extent(
712712
int nmaps;
713713
int error;
714714

715-
/* No COW extents? That's easy! */
716-
if (ifp->if_bytes == 0) {
717-
*offset_fsb = end_fsb;
718-
return 0;
719-
}
720-
721715
resblks = XFS_EXTENTADD_SPACE_RES(mp, XFS_DATA_FORK);
722716
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, resblks, 0,
723717
XFS_TRANS_RESERVE, &tp);

0 commit comments

Comments
 (0)