Thread (15 messages) 15 messages, 3 authors, 2021-08-23

Re: [PATCH RFC 2/3] btrfs: consolidate device_list_mutex in prepare_sprout to its parent

From: Anand Jain <hidden>
Date: 2021-08-20 08:53:28

quoted
@@ -2366,6 +2366,8 @@ static int btrfs_prepare_sprout(struct 
btrfs_fs_info *fs_info)
     u64 super_flags;

     lockdep_assert_held(&uuid_mutex);
+    lockdep_assert_held(&fs_devices->device_list_mutex);
+
Just a reminder: clone_fs_devices() still takes the mutex in misc-next.
   As I am checking clone_fs_devices() does not take any lock.
  Could you pls recheck?

quoted
@@ -2588,6 +2588,7 @@ int btrfs_init_new_device(struct btrfs_fs_info 
*fs_info, const char *device_path
     device->dev_stats_valid = 1;
     set_blocksize(device->bdev, BTRFS_BDEV_BLOCKSIZE);

+    mutex_lock(&fs_devices->device_list_mutex);
     if (seeding_dev) {
         btrfs_clear_sb_rdonly(sb);
         ret = btrfs_prepare_sprout(fs_info);
the erorr case:
if (ret) {
    mutex_unlock(&fs_devices->device_list_mutex);
    ...
}
  Right. I missed it will fix.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help