]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: fix clone / extent-same deadlocks
authorMark Fasheh <mfasheh@suse.de>
Tue, 30 Jun 2015 21:42:06 +0000 (14:42 -0700)
committerChris Mason <clm@fb.com>
Sun, 9 Aug 2015 14:34:25 +0000 (07:34 -0700)
commit0dae5286b8bb6039ebfeaece24a15c69c61cbb52
treec428134cc3f86ec4e3dd48c413eee15995d5bfc0
parentaa2656e0b869f117a500f323d4bd4eee4073bafc
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>
fs/btrfs/ioctl.c