linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Cc: dsterba@suse.com, gpiccoli@igalia.com
Subject: [PATCH 1/2] btrfs-progs: allow duplicate fsid for single device
Date: Thu, 28 Sep 2023 09:09:18 +0800	[thread overview]
Message-ID: <9a18c9a1dcf857c3e505994d488facda4bcf37f2.1695861950.git.anand.jain@oracle.com> (raw)
In-Reply-To: <cover.1695861950.git.anand.jain@oracle.com>

For single device btrfs filesystem, allow duplicate fsid to be created.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 mkfs/main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/mkfs/main.c b/mkfs/main.c
index 6b38f8079bb4..68ff5d7785d3 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -1321,7 +1321,10 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
 			error("could not parse UUID: %s", fs_uuid);
 			goto error;
 		}
-		if (!test_uuid_unique(fs_uuid)) {
+		/*
+		 * We allow non unique fsid for single device btrfs filesystem.
+		 */
+		if (device_count != 1 && !test_uuid_unique(fs_uuid)) {
 			error("non-unique UUID: %s", fs_uuid);
 			goto error;
 		}
-- 
2.39.3


  reply	other threads:[~2023-09-28  1:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28  1:09 [PATCH 0/2] btrfs-progs: mkfs: testing cloned-device Anand Jain
2023-09-28  1:09 ` Anand Jain [this message]
2023-10-02 15:22   ` [PATCH 1/2] btrfs-progs: allow duplicate fsid for single device David Sterba
2023-09-28  1:09 ` [PATCH 2/2] btrfs-progs: add mkfs -P option for dev_uuid Anand Jain
2023-10-02 15:21   ` David Sterba
2023-10-03  3:45     ` Anand Jain

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=9a18c9a1dcf857c3e505994d488facda4bcf37f2.1695861950.git.anand.jain@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=dsterba@suse.com \
    --cc=gpiccoli@igalia.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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).