linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs: Remove alloc_list splice in btrfs_prepare_sprout
@ 2020-08-12 13:26 Nikolay Borisov
  2020-08-12 13:56 ` Josef Bacik
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nikolay Borisov @ 2020-08-12 13:26 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Nikolay Borisov

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.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/volumes.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 71480175e8cb..4bae30b9c944 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -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;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] btrfs: Remove alloc_list splice in btrfs_prepare_sprout
  2020-08-12 13:26 [PATCH] btrfs: Remove alloc_list splice in btrfs_prepare_sprout Nikolay Borisov
@ 2020-08-12 13:56 ` Josef Bacik
  2020-08-14  6:29 ` Anand Jain
  2020-08-26 16:11 ` David Sterba
  2 siblings, 0 replies; 4+ messages in thread
From: Josef Bacik @ 2020-08-12 13:56 UTC (permalink / raw)
  To: Nikolay Borisov, linux-btrfs

On 8/12/20 9:26 AM, Nikolay Borisov wrote:
> 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.
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
>   fs/btrfs/volumes.c | 4 ----
>   1 file changed, 4 deletions(-)
> 
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index 71480175e8cb..4bae30b9c944 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -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.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] btrfs: Remove alloc_list splice in btrfs_prepare_sprout
  2020-08-12 13:26 [PATCH] btrfs: Remove alloc_list splice in btrfs_prepare_sprout Nikolay Borisov
  2020-08-12 13:56 ` Josef Bacik
@ 2020-08-14  6:29 ` Anand Jain
  2020-08-26 16:11 ` David Sterba
  2 siblings, 0 replies; 4+ messages in thread
From: Anand Jain @ 2020-08-14  6:29 UTC (permalink / raw)
  To: Nikolay Borisov, linux-btrfs

On 12/8/20 9:26 pm, Nikolay Borisov wrote:
> 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.
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

Reviewed-by: Anand Jain <anand.jain@oracle.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] btrfs: Remove alloc_list splice in btrfs_prepare_sprout
  2020-08-12 13:26 [PATCH] btrfs: Remove alloc_list splice in btrfs_prepare_sprout Nikolay Borisov
  2020-08-12 13:56 ` Josef Bacik
  2020-08-14  6:29 ` Anand Jain
@ 2020-08-26 16:11 ` David Sterba
  2 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2020-08-26 16:11 UTC (permalink / raw)
  To: Nikolay Borisov; +Cc: linux-btrfs

On Wed, Aug 12, 2020 at 04:26:46PM +0300, Nikolay Borisov wrote:
> 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.
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

Added to the rest of seed patches, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-26 16:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-12 13:26 [PATCH] btrfs: Remove alloc_list splice in btrfs_prepare_sprout Nikolay Borisov
2020-08-12 13:56 ` Josef Bacik
2020-08-14  6:29 ` Anand Jain
2020-08-26 16:11 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).