Linux-BTRFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH RESEND] btrfs-progs: btrfstune -M|m drop test_uuid_unique
@ 2019-10-10  7:53 Anand Jain
  2019-10-17  1:03 ` Anand Jain
  0 siblings, 1 reply; 3+ messages in thread
From: Anand Jain @ 2019-10-10  7:53 UTC (permalink / raw)
  To: linux-btrfs

It's common to copy/snapshot an OS image to run another instance of the OS.
A duplicate fsid can't be mounted on the same system unless the fsid is
changed by using btrfstune -m.

However in some circumstances the image needs to go back to the original
fsid /metadata_uuid.

As of now btrfstune -M fails if the specified uuid isn't unique, as show
below.

btrfstune -M $(btrfs in dump-super ./2-2g.img | grep metadata_uuid | \
					awk '{print $2}') ./2-2g.img
ERROR: fsid 87f8d9c5-a8b7-438e-a890-17bbe11c95e5 is not unique

But as we are changing the fsid of an unmounted image, so its ok to
leave it to the users choice if the fsid is not unique, so that the
image can be sent back the system where it was used with that fsid.

So this patch drops the check test_uuid_unique() in btrfstune -M|m.
Thanks.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
Previous sent patch and its discussions:
https://patchwork.kernel.org/patch/11134157/

 btrfstune.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/btrfstune.c b/btrfstune.c
index afa3aae35412..4befcadef8b1 100644
--- a/btrfstune.c
+++ b/btrfstune.c
@@ -570,10 +570,6 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[])
 			error("could not parse UUID: %s", new_fsid_str);
 			return 1;
 		}
-		if (!test_uuid_unique(new_fsid_str)) {
-			error("fsid %s is not unique", new_fsid_str);
-			return 1;
-		}
 	}
 
 	fd = open(device, O_RDWR);
-- 
2.21.0 (Apple Git-120)


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

* Re: [PATCH RESEND] btrfs-progs: btrfstune -M|m drop test_uuid_unique
  2019-10-10  7:53 [PATCH RESEND] btrfs-progs: btrfstune -M|m drop test_uuid_unique Anand Jain
@ 2019-10-17  1:03 ` Anand Jain
  2019-10-17 15:53   ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: Anand Jain @ 2019-10-17  1:03 UTC (permalink / raw)
  To: linux-btrfs, David Sterba


David,

Ping (4th time).

Per general rule of thumb tools like btrfs-progs must be flexible and
kernel should be harden for the duplicate fsid.

This patch relaxes the unnecessary check in btrfstune -M.

Without this patch there is no way to undo a changed fsid on the system.

Per original author there is no reasonable explanation why this check is
there in the first place until now.

IMO this patch is good integrate.

Please let me know if otherwise.

Thanks, Anand


On 10/10/19 3:53 PM, Anand Jain wrote:
> It's common to copy/snapshot an OS image to run another instance of the OS.
> A duplicate fsid can't be mounted on the same system unless the fsid is
> changed by using btrfstune -m.
> 
> However in some circumstances the image needs to go back to the original
> fsid /metadata_uuid.
> 
> As of now btrfstune -M fails if the specified uuid isn't unique, as show
> below.
> 
> btrfstune -M $(btrfs in dump-super ./2-2g.img | grep metadata_uuid | \
> 					awk '{print $2}') ./2-2g.img
> ERROR: fsid 87f8d9c5-a8b7-438e-a890-17bbe11c95e5 is not unique
> 
> But as we are changing the fsid of an unmounted image, so its ok to
> leave it to the users choice if the fsid is not unique, so that the
> image can be sent back the system where it was used with that fsid.
> 
> So this patch drops the check test_uuid_unique() in btrfstune -M|m.
> Thanks.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
> Previous sent patch and its discussions:
> https://patchwork.kernel.org/patch/11134157/
> 
>   btrfstune.c | 4 ----
>   1 file changed, 4 deletions(-)
> 
> diff --git a/btrfstune.c b/btrfstune.c
> index afa3aae35412..4befcadef8b1 100644
> --- a/btrfstune.c
> +++ b/btrfstune.c
> @@ -570,10 +570,6 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[])
>   			error("could not parse UUID: %s", new_fsid_str);
>   			return 1;
>   		}
> -		if (!test_uuid_unique(new_fsid_str)) {
> -			error("fsid %s is not unique", new_fsid_str);
> -			return 1;
> -		}
>   	}
>   
>   	fd = open(device, O_RDWR);
> 


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

* Re: [PATCH RESEND] btrfs-progs: btrfstune -M|m drop test_uuid_unique
  2019-10-17  1:03 ` Anand Jain
@ 2019-10-17 15:53   ` David Sterba
  0 siblings, 0 replies; 3+ messages in thread
From: David Sterba @ 2019-10-17 15:53 UTC (permalink / raw)
  To: Anand Jain; +Cc: linux-btrfs, David Sterba

On Thu, Oct 17, 2019 at 09:03:00AM +0800, Anand Jain wrote:
> Ping (4th time).

Anand, the patch queue is big and ever growing, pinging can help to
bring back the attention but for patches that have disgreements or
unclear reasoning the turnaround time can be longer.

Specifically, patches that have impact on usability extra care must be
taken not to cause chaos by seemingly "simple" change.

> IMO this patch is good integrate.

I'll reply under the previous submission as there is the discussion in
progress.

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-10  7:53 [PATCH RESEND] btrfs-progs: btrfstune -M|m drop test_uuid_unique Anand Jain
2019-10-17  1:03 ` Anand Jain
2019-10-17 15:53   ` David Sterba

Linux-BTRFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-btrfs/0 linux-btrfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-btrfs linux-btrfs/ https://lore.kernel.org/linux-btrfs \
		linux-btrfs@vger.kernel.org linux-btrfs@archiver.kernel.org
	public-inbox-index linux-btrfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-btrfs


AGPL code for this site: git clone https://public-inbox.org/ public-inbox