From: Hans van Kranenburg <hans.van.kranenburg@mendix.com>
To: dsterba@suse.cz, Anand Jain <anand.jain@oracle.com>,
Nikolay Borisov <nborisov@suse.com>,
linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v4] btrfs: Remove received_uuid during received snapshot ro->rw switch
Date: Fri, 6 Oct 2017 19:49:32 +0200 [thread overview]
Message-ID: <52a7046b-1ef8-e452-4ca4-d9eda2d8d1a2@mendix.com> (raw)
In-Reply-To: <20171006172415.GW3521@twin.jikos.cz>
On 10/06/2017 07:24 PM, David Sterba wrote:
> On Thu, Oct 05, 2017 at 05:03:47PM +0800, Anand Jain wrote:
>> On 10/05/2017 04:22 PM, Nikolay Borisov wrote:
>>> Currently when a read-only snapshot is received and subsequently its ro property
>>> is set to false i.e. switched to rw-mode the received_uuid of that subvol remains
>>> intact. However, once the received volume is switched to RW mode we cannot
>>> guaranteee that it contains the same data, so it makes sense to remove the
>>> received uuid. The presence of the received_uuid can also cause problems when
>>> the volume is being send.
Are the 'can cause problems when being send' explained somewhere?
>>
>> Wonder if this [1] approach was considered
>> [1]
>> - set a flag on the subvolume to indicate its dirtied so that
>> received_uuid can be kept forever just in case if user needs it for some
>> reference at a later point of time.
>
> Yeah, we need to be careful here. There are more items related to the
> recived subvolume, besides received_uuid there's rtransid and rtime so
> they might need to be cleared as well.
>
> I don't remember all the details how the send/receive and uuids
> interact. Switching from ro->rw needs to affect the 'received' status,
> but I don't know how. The problem is that some information is being lost
> although it may be quite important to the user/administrator. In such
> cases it would be convenient to request a confirmation via a --force
> flag or something like that.
On IRC I think we generally recommends users to never do this, and as a
best practice always clone the snapshot to a rw subvolume in a different
location if someone wants to proceed working with the contents and
changing them as opposed to messing with the ro/rw attributes.
So, what about option [2]:
[2] if a subvolume has a received_uuid, then just do not allow changing
it to rw.
Even if it wouldn't make sense for some reason, it's a nice thought
experiment. :)
--
Hans van Kranenburg
next prev parent reply other threads:[~2017-10-06 17:49 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-26 14:27 [PATCH 1/2] btrfs: Abort transaction if btrfs_update_root fails in btrfs_ioctl_subvol_setflags Nikolay Borisov
2017-09-26 14:27 ` [RFC PATCH 2/2] btrfs: Remove received_uuid during received snapshot ro->rw switch Nikolay Borisov
2017-09-27 8:53 ` [PATCH v2] " Nikolay Borisov
2017-09-26 17:39 ` [PATCH 1/2] btrfs: Abort transaction if btrfs_update_root fails in btrfs_ioctl_subvol_setflags David Sterba
2017-09-27 8:48 ` Nikolay Borisov
2017-09-27 14:00 ` David Sterba
2017-09-27 14:28 ` Nikolay Borisov
2017-09-28 7:53 ` [PATCH 1/2] btrfs: Explicitly handle btrfs_update_root failure Nikolay Borisov
2017-09-28 7:53 ` [PATCH v3 2/2] btrfs: Remove received_uuid during received snapshot ro->rw switch Nikolay Borisov
2017-09-29 17:56 ` David Sterba
2017-09-29 19:15 ` Nikolay Borisov
2017-10-04 15:00 ` David Sterba
2017-10-05 8:22 ` [PATCH v4] " Nikolay Borisov
2017-10-05 9:03 ` Anand Jain
2017-10-06 17:24 ` David Sterba
2017-10-06 17:49 ` Hans van Kranenburg [this message]
2017-10-06 20:07 ` Andrei Borzenkov
2017-10-06 21:27 ` Hans van Kranenburg
2017-10-07 7:56 ` Andrei Borzenkov
2017-11-12 17:11 ` Hans van Kranenburg
2017-09-29 17:42 ` [PATCH 1/2] btrfs: Explicitly handle btrfs_update_root failure 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=52a7046b-1ef8-e452-4ca4-d9eda2d8d1a2@mendix.com \
--to=hans.van.kranenburg@mendix.com \
--cc=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).