linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: Nikolay Borisov <nborisov@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: Remove alloc_list splice in btrfs_prepare_sprout
Date: Wed, 12 Aug 2020 09:56:51 -0400	[thread overview]
Message-ID: <14a60f48-c8f1-6ed8-027f-da6ca6d57e79@toxicpanda.com> (raw)
In-Reply-To: <20200812132646.9638-1-nborisov@suse.com>

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

  reply	other threads:[~2020-08-12 13:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-12 13:26 [PATCH] btrfs: Remove alloc_list splice in btrfs_prepare_sprout Nikolay Borisov
2020-08-12 13:56 ` Josef Bacik [this message]
2020-08-14  6:29 ` Anand Jain
2020-08-26 16:11 ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14a60f48-c8f1-6ed8-027f-da6ca6d57e79@toxicpanda.com \
    --to=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).