aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_reflink.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-09 03:02:35 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-09 03:02:35 -0400
commit1236d6bb6e19fc72ffc6bbcdeb1bfefe450e54ee (patch)
tree47da3feee8e263e8c9352c85cf518e624be3c211 /fs/xfs/xfs_reflink.c
parent750b1a6894ecc9b178c6e3d0a1170122971b2036 (diff)
parent8a5776a5f49812d29fe4b2d0a2d71675c3facf3f (diff)
Merge 4.14-rc4 into staging-next
We want the staging/iio fixes in here as well to handle merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/xfs/xfs_reflink.c')
-rw-r--r--fs/xfs/xfs_reflink.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
index 3246815c24d6..37e603bf1591 100644
--- a/fs/xfs/xfs_reflink.c
+++ b/fs/xfs/xfs_reflink.c
@@ -736,7 +736,13 @@ xfs_reflink_end_cow(
736 /* If there is a hole at end_fsb - 1 go to the previous extent */ 736 /* If there is a hole at end_fsb - 1 go to the previous extent */
737 if (!xfs_iext_lookup_extent(ip, ifp, end_fsb - 1, &idx, &got) || 737 if (!xfs_iext_lookup_extent(ip, ifp, end_fsb - 1, &idx, &got) ||
738 got.br_startoff > end_fsb) { 738 got.br_startoff > end_fsb) {
739 ASSERT(idx > 0); 739 /*
740 * In case of racing, overlapping AIO writes no COW extents
741 * might be left by the time I/O completes for the loser of
742 * the race. In that case we are done.
743 */
744 if (idx <= 0)
745 goto out_cancel;
740 xfs_iext_get_extent(ifp, --idx, &got); 746 xfs_iext_get_extent(ifp, --idx, &got);
741 } 747 }
742 748
@@ -809,6 +815,7 @@ next_extent:
809 815
810out_defer: 816out_defer:
811 xfs_defer_cancel(&dfops); 817 xfs_defer_cancel(&dfops);
818out_cancel:
812 xfs_trans_cancel(tp); 819 xfs_trans_cancel(tp);
813 xfs_iunlock(ip, XFS_ILOCK_EXCL); 820 xfs_iunlock(ip, XFS_ILOCK_EXCL);
814out: 821out: