From: Anand Jain <anand.jain@oracle.com>
To: "Guilherme G. Piccoli" <gpiccoli@igalia.com>,
linux-btrfs@vger.kernel.org
Cc: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com,
dsterba@suse.cz, linux-fsdevel@vger.kernel.org,
kernel@gpiccoli.net, kernel-dev@igalia.com, david@fromorbit.com,
kreijack@libero.it, johns@valvesoftware.com,
ludovico.denittis@collabora.com, quwenruo.btrfs@gmx.com,
wqu@suse.com, vivek@collabora.com
Subject: Re: [PATCH v4 2/2] btrfs: Introduce the temp-fsid feature
Date: Tue, 19 Sep 2023 19:06:38 +0800 [thread overview]
Message-ID: <f976c005-29fe-4f7e-e1d2-5262d638761a@oracle.com> (raw)
In-Reply-To: <20230913224402.3940543-3-gpiccoli@igalia.com>
> +
> +static void prepare_random_fsid(struct btrfs_super_block *disk_super,
> + const char *path)
> +{
> + struct btrfs_fs_devices *fs_devices;
> + u8 vfsid[BTRFS_FSID_SIZE];
> + bool dup_fsid = true;
> +
> + while (dup_fsid) {
> + dup_fsid = false;
> + generate_random_uuid(vfsid);
> +
> + list_for_each_entry(fs_devices, &fs_uuids, fs_list) {
> + if (!memcmp(vfsid, fs_devices->fsid, BTRFS_FSID_SIZE) ||
> + !memcmp(vfsid, fs_devices->metadata_uuid,
> + BTRFS_FSID_SIZE))
> + dup_fsid = true;
> + }
I've noticed this section of the code a few times, but I don't believe
I've mentioned it before. We've been using generate_random_guid() and
generate_random_uuid() without checking for UUID clashes. Why extra
uuid clash check here?
Thanks, Anand
next prev parent reply other threads:[~2023-09-19 11:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-13 22:36 [PATCH v4 0/2] Supporting same fsid mounting through the temp-fsid feature Guilherme G. Piccoli
2023-09-13 22:36 ` [PATCH v4 1/2] btrfs-progs: Add the temp-fsid feature (to both mkfs/tune) Guilherme G. Piccoli
2023-09-13 22:36 ` [PATCH v4 2/2] btrfs: Introduce the temp-fsid feature Guilherme G. Piccoli
2023-09-18 21:52 ` David Sterba
2023-09-18 22:21 ` Guilherme G. Piccoli
2023-09-19 5:01 ` Anand Jain
2023-09-20 12:16 ` Guilherme G. Piccoli
2023-09-20 18:37 ` David Sterba
2023-09-21 0:21 ` Anand Jain
2023-09-21 22:36 ` Guilherme G. Piccoli
2023-09-19 11:06 ` Anand Jain [this message]
2023-09-20 12:03 ` Guilherme G. Piccoli
2023-09-20 18:23 ` 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=f976c005-29fe-4f7e-e1d2-5262d638761a@oracle.com \
--to=anand.jain@oracle.com \
--cc=clm@fb.com \
--cc=david@fromorbit.com \
--cc=dsterba@suse.com \
--cc=dsterba@suse.cz \
--cc=gpiccoli@igalia.com \
--cc=johns@valvesoftware.com \
--cc=josef@toxicpanda.com \
--cc=kernel-dev@igalia.com \
--cc=kernel@gpiccoli.net \
--cc=kreijack@libero.it \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=ludovico.denittis@collabora.com \
--cc=quwenruo.btrfs@gmx.com \
--cc=vivek@collabora.com \
--cc=wqu@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).