Merge branch 'topic/ca0106-spdif-stream' into topic/ca0106
[firefly-linux-kernel-4.4.55.git] / fs / xfs / xfs_dfrag.c
index 760f4c5b5160c4e648e17d491d8912c691726214..75b0cd4da0ea30140bbdd3068c02ba94c751bd13 100644 (file)
@@ -149,7 +149,14 @@ xfs_swap_extents(
 
        sbp = &sxp->sx_stat;
 
-       xfs_lock_two_inodes(ip, tip, lock_flags);
+       /*
+        * we have to do two separate lock calls here to keep lockdep
+        * happy. If we try to get all the locks in one call, lock will
+        * report false positives when we drop the ILOCK and regain them
+        * below.
+        */
+       xfs_lock_two_inodes(ip, tip, XFS_IOLOCK_EXCL);
+       xfs_lock_two_inodes(ip, tip, XFS_ILOCK_EXCL);
        locked = 1;
 
        /* Verify that both files have the same format */