btrfs: Remove alloc_list splice in btrfs_prepare_sprout
PATCH 1/1 btrfs: Remove alloc_list splice in btrfs_prepare_sprout
btrfs_prepare_sprout is called when the first rw device is added to a seed filesystem. This means the filesystem can't have its alloc_list be non-empty, since seed filesystems are read only. Simply remove the code altogether.
--- fs/btrfs/volumes.c | 4 ---- 1 file changed, 4 deletions(-)
fs/btrfs/volumes.c +0 -4
@@ -2385,10 +2385,6 @@ static int btrfs_prepare_sprout(struct btrfs_fs_info *fs_info)list_for_each_entry (device, &seed_devices->devices, dev_list) device->fs_devices = seed_devices; -mutex_lock (&fs_info->chunk_mutex); -list_splice_init (&fs_devices->alloc_list, &seed_devices->alloc_list); -mutex_unlock (&fs_info->chunk_mutex); - fs_devices->seeding = false; fs_devices->num_devices =0 ; fs_devices->open_devices =0 ;
Signature · 1 line
2.17.1
Quoted 16 lines · Nikolay Borisov
btrfs_prepare_sproutis called when the first rw device is added to a seed filesystem. This means the filesystem can't have itsalloc_listbe non-empty, since seed filesystems are read only. Simply remove the code altogether.Signed-off-by Nikolay Borisov <[email protected]>--- fs/btrfs/volumes.c | 4 ---- 1 file changed, 4 deletions(-)fs/btrfs/volumes.c +0
-0
fs/btrfs/volumes.c static int btrfs_prepare_sprout(struct btrfs_fs_info *fs_info) · line 2390
Quoted 10 lines
fs/btrfs/volumes.c +0
-4@@ -2385,10 +2385,6 @@ static int btrfs_prepare_sprout(struct btrfs_fs_info *fs_info)list_for_each_entry (device, &seed_devices->devices, dev_list) device->fs_devices = seed_devices; -mutex_lock (&fs_info->chunk_mutex); -list_splice_init (&fs_devices->alloc_list, &seed_devices->alloc_list); -mutex_unlock (&fs_info->chunk_mutex); - fs_devices->seeding = false; fs_devices->num_devices =0 ; fs_devices->open_devices =0 ;
Ok this took me a second, we swap out the seed_devices and the new fs_devices is what becomes the main thing for the fs.
Thanks,
Josef
Quoted 6 lines · Nikolay Borisov
btrfs_prepare_sproutis called when the first rw device is added to a seed filesystem. This means the filesystem can't have itsalloc_listbe non-empty, since seed filesystems are read only. Simply remove the code altogether.Signed-off-by Nikolay Borisov <[email protected]>
Quoted 6 lines · Nikolay Borisov
btrfs_prepare_sproutis called when the first rw device is added to a seed filesystem. This means the filesystem can't have itsalloc_listbe non-empty, since seed filesystems are read only. Simply remove the code altogether.Signed-off-by Nikolay Borisov <[email protected]>
Added to the rest of seed patches, thanks.