]> 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)
commit56c6fa9982d34065de96e493620955641b55553b
treee26a3fafb050829e607690236c094dc7d4559c1d
parent258b9a126e1fab155be6ffac07f236847e8587e1
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