]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: fix clone / extent-same deadlocks
authorMark Fasheh <mfasheh@suse.de>
Tue, 30 Jun 2015 21:42:06 +0000 (14:42 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Tue, 22 Aug 2017 15:42:59 +0000 (08:42 -0700)
commit35b045e99e723012075206c1be36c7e50dfb9f42
tree2f7e72d0155db9f05de984b4022188f19c2d6010
parent19b6fe736df3d988fb8557191a9fcfa6e5b6e0b3
btrfs: fix clone / extent-same deadlocks

Clone and extent same lock their source and target inodes in opposite order.
In addition to this, the range locking in clone doesn't take ordering into
account. Fix this by having clone use the same locking helpers as
btrfs-extent-same.

In addition, I do a small cleanup of the locking helpers, removing a case
(both inodes being the same) which was poorly accounted for and never
actually used by the callers.

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
(Cherry picked from commit 293a8489f300536dc6d996c35a6ebb89aa03bab2)

Orabug: 26251039

Signed-off-by: Shan Hai <shan.hai@oracle.com>
Acked-by: Shannon Nelson <shannon.nelson@oracle.com>
Acked-by: John Haxby <john.haxby@oracle.com>
fs/btrfs/ioctl.c