]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: extend locked section when adding a new device in device_list_add
authorAnand Jain <anand.jain@oracle.com>
Tue, 29 May 2018 06:10:20 +0000 (14:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Sep 2018 07:46:56 +0000 (09:46 +0200)
commit0b40d58d469f3e78ec644b3a0ada4295e596e190
tree73f7ec8e6a9fdd47cea6007963056bd47f5a66fa
parent2d4bbb81bac654db2d5e66887d0a3be704aab060
btrfs: extend locked section when adding a new device in device_list_add

[ Upstream commit 9c6d173ea6e4c8c939ae6c257c7fc18f7b320316 ]

Make sure the device_list_lock is held the whole time:

* when the device is being looked up
* new device is initialized and put to the list
* the list counters are updated (fs_devices::opened, fs_devices::total_devices)

Signed-off-by: Anand Jain <anand.jain@oracle.com>
[ update changelog ]
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