summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2017-12-11 05:03:55 +0300
committerDarrick J. Wong <darrick.wong@oracle.com>2017-12-14 20:20:11 +0300
commit9d40fba8b2056773b9744a95df9ddd6cc33a4f83 (patch)
tree211491d1ec8fca4e39b4cf58266b2a6e005e8a61 /fs
parent73353f486c9b5b2407ec32be1004174dbbaf6c18 (diff)
downloadlinux-9d40fba8b2056773b9744a95df9ddd6cc33a4f83.tar.xz
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: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/xfs_reflink.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
index 99c5852f9fe7..6931b0c79cac 100644
--- a/fs/xfs/xfs_reflink.c
+++ b/fs/xfs/xfs_reflink.c
@@ -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))