OSDN Git Service

btrfs: use device_list_mutex when removing stale devices
authorAnand Jain <anand.jain@oracle.com>
Tue, 29 May 2018 09:23:20 +0000 (17:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Sep 2018 07:46:56 +0000 (09:46 +0200)
commit40ce21951aab62b8cdd6d2b852154d6fe9f11163
treefbb678ed7099fec22fe1ad5141d0ccdc711220f1
parentb57a7b0d4122033fba58c60f0560cdf9004fbf88
btrfs: use device_list_mutex when removing stale devices

[ Upstream commit 7bcb8164ad9435068d9bc3b83b8a002c64d63ff6 ]

btrfs_free_stale_devices() finds a stale (not opened) device matching
path in the fs_uuid list. We are already under uuid_mutex so when we
check for each fs_devices, hold the device_list_mutex too.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/volumes.c