Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d40fba8 authored by Darrick J. Wong's avatar Darrick J. Wong
Browse files

xfs: avoid infinite loop when cancelling CoW blocks after writeback failure



When we're cancelling a cow range, we don't always delete each extent
that we iterate, so we have to move icur backwards in the list to avoid
an infinite loop.

Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent 73353f48
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -611,6 +611,9 @@ xfs_reflink_cancel_cow_blocks(

			/* Remove the mapping from the CoW fork. */
			xfs_bmap_del_extent_cow(ip, &icur, &got, &del);
		} else {
			/* Didn't do anything, push cursor back. */
			xfs_iext_prev(ifp, &icur);
		}
next_extent:
		if (!xfs_iext_get_extent(ifp, &icur, &got))