OSDN Git Service

btrfs: dev-replace: avoid useless lock on error handling path
authorDavid Sterba <dsterba@suse.com>
Fri, 24 Aug 2018 15:44:05 +0000 (17:44 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 15 Oct 2018 15:23:38 +0000 (17:23 +0200)
commitaa144bfeaa7f87c536ab323edfe2692285343e68
tree071a00c5aeb589f05f8aea309cb9d536a8a252aa
parent9f6cbcbb09d0f2a73ccb9998f6ac34606da9c938
btrfs: dev-replace: avoid useless lock on error handling path

The exit sequence in btrfs_dev_replace_start does not allow to simply
add a label to the right place so the error handling after starting
transaction failure jumps there. Currently there's a lock that pairs
with the unlock in the section, which is unnecessary and only raises
questions.  Add a variable to track the locking status and avoid the
extra locking.

Reviewed-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/dev-replace.c