Thread (14 messages) 14 messages, 3 authors, 2021-11-08

Re: [PATCH v6 2/3] btrfs: remove unused device_list_mutex for seed fs_devices

From: Nikolay Borisov <hidden>
Date: 2021-09-21 06:44:30


On 21.09.21 г. 7:33, Anand Jain wrote:
The btrfs_fs_devices::seed_list is of type btrfs_fs_devices as well and,
seed_list is in fact a list_head which points to btrfs_fs_devices, so
that sentence is somewhat misleading.
it is a pointer to the seed btrfs_fs_device in a btrfs created from a
seed devices.
In this struct, when it points to seed, the device_list_mutex is not
used. So drop its initialize.
Even if the device_list_mutex is not used in the seed_devices it will
have whatever is the state from the original fs_devices so
re-initializing it to a sane state is the right thing to do.

We don't need this.
quoted hunk ↗ jump to hunk
Signed-off-by: Anand Jain <redacted>
---
v6: new
 fs/btrfs/volumes.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index c4bc49e58b69..e4079e25db70 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2418,7 +2418,6 @@ static int btrfs_prepare_sprout(struct btrfs_fs_info *fs_info)
 	seed_devices->opened = 1;
 	INIT_LIST_HEAD(&seed_devices->devices);
 	INIT_LIST_HEAD(&seed_devices->alloc_list);
-	mutex_init(&seed_devices->device_list_mutex);
 
 	mutex_lock(&fs_devices->device_list_mutex);
 	list_splice_init_rcu(&fs_devices->devices, &seed_devices->devices,
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help