From: David Sterba <dsterba@suse.cz>
To: Nikolay Borisov <nborisov@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 0/8] Implement progs support for removing received uuid on RW vols
Date: Tue, 21 Sep 2021 20:51:24 +0200 [thread overview]
Message-ID: <20210921185124.GQ9286@twin.jikos.cz> (raw)
In-Reply-To: <20210914090558.79411-1-nborisov@suse.com>
On Tue, Sep 14, 2021 at 12:05:50PM +0300, Nikolay Borisov wrote:
> Here's V2 which takes into account Qu's suggestions, namely:
>
> - Add a helper which contains the common code to clear receive-related data
> - Now there is a single patch which impements the check/clear for both orig and
> lowmem modes
> - Added Reviewed-by from Qu.
>
>
> Nikolay Borisov (8):
> btrfs-progs: Add btrfs_is_empty_uuid
> btrfs-progs: Remove root argument from btrfs_fixup_low_keys
> btrfs-progs: Remove fs_info argument from leaf_data_end
> btrfs-progs: Remove root argument from btrfs_truncate_item
> btrfs-progs: Add btrfs_uuid_tree_remove
> btrfs-progs: Implement helper to remove received information of RW
> subvol
> btrfs-progs: check: Implement removing received data for RW subvols
> btrfs-progs: tests: Add test for received information removal
Patches 2-5 added to devel as they're preparatory and otherwise OK as
independent cleanups.
Regarding the rw and received_uuid, it's choosing between these options:
1) ro->rw resets received_uuid unconditionally
Pros:
- safe as it does not lead to unexpected results after incremental send
Cons:
- unconditional, so it's too easy to break the incremental send usecase,
which is the main usecase, if that' for backups breaking the
continuity is IMNSHO serious usability problem -- and main reason why
I'm personally looking for other options
Issuing a warning when the ro status is changed by btrfs-progs is only
partially fixing that as the raw ioctl or it's wrapper in libbtrfsutil
will happily destroy the received_uuid. There's no log or other
information that would make it possible to restore it.
Note that received_uuid can be set to any value using the
BTRFS_IOC_SET_RECEIVED_SUBVOL ioctl, as long as the subvolume is
writable.
2) don't allow ro->rw if received_uuid is set, it must be cleared first
As mentioned above, the received_uuid can be changed or reset (setting
all zeros), but there's still the condition that the subvolume must be
writable.
After 'receive' the subvolume is snapshotted, updated from stream, set
received_uuid and set rw->ro.
Reusing the SET_RECEIVED_SUBVOL can't be used as-is, the subvol would
have to be rw first. Which is a chicken-egg problem.
The safe steps would be:
- (after receive, subvolume is RO)
- set it to RW
- clear received_uuid
- either keep it RW or set RO again
This would be the single "clear received_uuid manually" and it would be
up to the user to knowingly destroy the continuity of the incremental
send.
The fix here is that the above steps would have to be atomic from user
perspective, inside SET_RECEIVED_SUBVOL, eg. based on flag. And we'd
have to add a btrfs-progs command somewhere.
next prev parent reply other threads:[~2021-09-21 18:51 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-14 9:05 [PATCH v2 0/8] Implement progs support for removing received uuid on RW vols Nikolay Borisov
2021-09-14 9:05 ` [PATCH v2 1/8] btrfs-progs: Add btrfs_is_empty_uuid Nikolay Borisov
2021-09-16 7:26 ` Anand Jain
2021-09-20 11:41 ` David Sterba
2021-09-14 9:05 ` [PATCH v2 2/8] btrfs-progs: Remove root argument from btrfs_fixup_low_keys Nikolay Borisov
2021-09-14 9:05 ` [PATCH v2 3/8] btrfs-progs: Remove fs_info argument from leaf_data_end Nikolay Borisov
2021-09-14 9:05 ` [PATCH v2 4/8] btrfs-progs: Remove root argument from btrfs_truncate_item Nikolay Borisov
2021-09-14 9:05 ` [PATCH v2 5/8] btrfs-progs: Add btrfs_uuid_tree_remove Nikolay Borisov
2021-09-14 9:22 ` Qu Wenruo
2021-09-14 9:05 ` [PATCH v2 6/8] btrfs-progs: Implement helper to remove received information of RW subvol Nikolay Borisov
2021-09-14 9:23 ` Qu Wenruo
2021-09-14 9:05 ` [PATCH v2 7/8] btrfs-progs: check: Implement removing received data for RW subvols Nikolay Borisov
2021-09-14 9:25 ` Qu Wenruo
2021-09-14 9:55 ` Nikolay Borisov
2021-09-14 9:05 ` [PATCH v2 8/8] btrfs-progs: tests: Add test for received information removal Nikolay Borisov
2021-09-14 9:30 ` [PATCH v2 0/8] Implement progs support for removing received uuid on RW vols Qu Wenruo
2021-09-14 9:30 ` Qu Wenruo
2021-09-14 9:31 ` Nikolay Borisov
2021-09-21 18:51 ` David Sterba [this message]
2021-09-21 22:08 ` Graham Cobb
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=20210921185124.GQ9286@twin.jikos.cz \
--to=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