]> asedeno.scripts.mit.edu Git - linux.git/commit
btrfs: dev_alloc_list is not protected by RCU, use normal list_del
authorDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2017 12:14:22 +0000 (14:14 +0200)
committerDavid Sterba <dsterba@suse.com>
Wed, 15 Nov 2017 13:46:12 +0000 (14:46 +0100)
commit619c47f3d4cd7a60576fd15e133a2eee4fcc0c4e
treec73056789eb418375d1a590b713b5015779f7764
parent3065ae5b85654e9141b134bc7b07eb0f2ca7cfcf
btrfs: dev_alloc_list is not protected by RCU, use normal list_del

The dev_alloc_list list could be protected by various mutexes,
depending on the context. The list tracks devices that can take part of
allocating new chunks, so the closest mutex is chunk_mutex. Adding a new
device from inside the ADD_DEV ioctl will need device_list_mutex and
registering a new device from the ioctl needs uuid_mutex.

All mutexes naturally guarantee exclusivity against the same context.
The device ownership can move between the contexts and the exclusivity
is guaranteed by other means, eg. during the mount with the uuid_mutex.

There's no RCU involved for dev_alloc_list.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c