]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: Reduce critical section in btrfs_init_dev_replace_tgtdev
authorNikolay Borisov <nborisov@suse.com>
Tue, 14 May 2019 10:54:39 +0000 (13:54 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 1 Jul 2019 11:34:54 +0000 (13:34 +0200)
commitf8fd07a2af556e6c9498116309d45f6b985ab191
tree0eea4c256f5920d4f112c2a3d391662cfffa956e
parent2a56eb44f9c480f05c63d069bfbb7c7c0d859097
btrfs: Reduce critical section in btrfs_init_dev_replace_tgtdev

There is no point in holding btrfs_fs_devices::device_list_mutex
while initialising fields of the not-yet-published device. Instead,
hold the mutex only when the newly initialised device is being
published. I think holding device_list_mutex here is redundant
altogether, because at this point BTRFS_FS_EXCL_OP is set which
prevents device removal/addition/balance/resize to occur.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
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/dev-replace.c