]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: remove wrong use of volume_mutex from btrfs_dev_replace_start
authorDavid Sterba <dsterba@suse.com>
Tue, 20 Mar 2018 22:44:50 +0000 (23:44 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 May 2018 16:07:25 +0000 (18:07 +0200)
commitc6739eb15963bb3133165dfa8fe3b812de075bbd
treee26a3fafb050829e607690236c094dc7d4559c1d
parent51096557a7f44487a5887fcc558cea04b97e4533
btrfs: remove wrong use of volume_mutex from btrfs_dev_replace_start

The volume mutex does not protect against anything in this case, the
comment about scrub is right but not related to locking and looks
confusing. The comment in btrfs_find_device_missing_or_by_path is wrong
and confusing too.

The device_list_mutex is not held here to protect device lookup, but in
this case device replace cannot run in parallel with device removal (due
to exclusive op protection), so we don't need further locking here.

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