linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: dsterba@suse.cz, Nikolay Borisov <nborisov@suse.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs-progs: drop unique uuid test for btrfstune -M
Date: Tue, 24 Sep 2019 19:20:53 +0800	[thread overview]
Message-ID: <faa13b5c-38f9-980b-eb6e-5311a7437b0d@oracle.com> (raw)
In-Reply-To: <1cd24402-40dd-86f0-ac47-91cad78ef5fe@oracle.com>


David, ping on this patch.



On 9/12/19 8:45 AM, Anand Jain wrote:
> 
> thanks for the comments, more inline below.
> 
>>> - btrfstume -M <uuid> isn't the place to check if the fsid is a
>>>     duplicate. Because, libblkid will be unaware of the complete list of
>>>     fs images with its fsid.
>>
>> I don't understand this part. Blkid tracks the device iformation, like
>> the uuid, and the cache gets updated. So what does 'will be unaware of
>> the complete list' mean?
>>
>> If it's on the same host it's a matter of keeping the cache in sync with
>> the actual devices.
> 
> In case of vm guest images copied from the golden image there is no
> physical device or loop device or nbd device until its configured on
> the host when required, so check for duplicate fsid at the time of
> btrfstune -M is not convincing or a very limited approach.
> 
>>> - As I said before, its a genuine use-case here where the user wants to
>>>     revert the fsid change, so that btrfs fs root image can be booted.
>>>     Its up-to the user if fsid is duplicate in the user space, as btrfs
>>>     kernel rightly fails the mount if its duplicate fsid anyways.
>>
>> Reverting the uuid is fine 
> 
> ok thanks.
> 
>> and requiring the uuids to be unique is
>> preventing the users doing stupid things unknowingly.
> 
> Right it should be done. But..
> btrfstune -M is a wrong place. Because it can't avoid all the
> cases of fsid getting duplicated.
> Even after btrfstune -M, the fsid can be duplicated by the user.
> So what's the point in restricting the btrfstune -M and fail to
> undo the changed fsid.
> 
>> You seem to have a
>> usecase where even duplicate uuids are required but I'm afraid it's not
>> all clear how is it supposed to work. A few more examples or commands
>> would be helpful.
>>
> 
> In the use case here, even the host is also running a copy of the golden
> image (same fsid as vm guest) and because of duplicate fsid you can
> only mount a vm guest image on the host after the btrfstune -m command
> on the vm guest image. But after you have done that, as the vm guest
> fsid is changed, it fails to boot, unfortunately changed fsid can not
> be undone without this patch.
> 
> The fsid can be duplicate by many different other ways anyways. So in
> this case how does it matter if btrfstune -M tries to ensure that fsid
> is unique among the blkid known set of devices, which may change any
> time after btrfstune -M as well (just copy a vm guest and map it to
> a loop device). So btrfstune -M should be free from this check and
> help the use case as above.
> 
> And if we are concerned about the duplicate fsid as I asked Nikolay
> before, we need to know what are problems in specifies, so that it can
> be fixed in separate patches, but definitely not in btrfstune -M as
> it can't fix the duplicate fsid problem completely as vm images can
> be copied and mapped to a loop/nbd device anytime even after
> btrfstune -M.
> 
> Thanks, Anand


  reply	other threads:[~2019-09-24 11:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06  0:50 [PATCH] btrfs-progs: drop unique uuid test for btrfstune -M Anand Jain
2019-09-06  7:21 ` Nikolay Borisov
2019-09-06  9:27   ` Anand Jain
2019-09-09 11:40     ` Nikolay Borisov
2019-09-10  5:12       ` Anand Jain
2019-09-11 17:01         ` David Sterba
2019-09-12  0:45           ` Anand Jain
2019-09-24 11:20             ` Anand Jain [this message]
2019-10-01  8:08               ` Anand Jain
2019-10-17 16:32             ` David Sterba
2019-10-18  8:52               ` Anand Jain
2020-05-20 10:44                 ` 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=faa13b5c-38f9-980b-eb6e-5311a7437b0d@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=dsterba@suse.cz \
    --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).