btrfs: Fix lock release order
authorNikolay Borisov <nborisov@suse.com>
Wed, 11 Apr 2018 08:21:18 +0000 (11:21 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 May 2018 16:07:16 +0000 (18:07 +0200)
commit1e7a14211bced7ac26f332b16338db88290e0ffd
tree3570d5fac36a496a83b9ad27bd73ea748ecaa344
parentb25f0d0012d11f2fb3df855fb62b86e5f63fdd68
btrfs: Fix lock release order

Locks should generally be released in the oppposite order they are
acquired. Generally lock acquisiton ordering is used to ensure
deadlocks don't happen. However, as becomes more complicated it's
best to also maintain proper unlock order so as to avoid possible dead
locks. This was found by code inspection and doesn't necessarily lead
to a deadlock scenario.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c