From: David Sterba <dsterba@suse.cz>
To: Omar Sandoval <osandov@osandov.com>
Cc: David Sterba <dsterba@suse.com>,
linux-btrfs@vger.kernel.org, nborisov@suse.com
Subject: Re: [PATCH RFC] btrfs-progs: send protocol v2 stub, UTIMES2, OTIME
Date: Tue, 19 Oct 2021 14:53:59 +0200 [thread overview]
Message-ID: <20211019125359.GR30611@suse.cz> (raw)
In-Reply-To: <YW3qStSa9LiaankG@relinquished.localdomain>
On Mon, Oct 18, 2021 at 02:42:34PM -0700, Omar Sandoval wrote:
> On Mon, Oct 18, 2021 at 04:47:17PM +0200, David Sterba wrote:
> > + int ret;
> > + struct btrfs_receive *rctx = user;
> > + char full_path[PATH_MAX];
> > +
> > + ret = path_cat_out(full_path, rctx->full_subvol_path, path);
> > + if (ret < 0) {
> > + error("otime: path invalid: %s", path);
> > + goto out;
> > + }
> > +
> > + if (bconf.verbose >= 3) {
> > + char ot_str[128];
> > +
> > + if (sprintf_timespec(ot, ot_str, sizeof(ot_str) - 1) < 0)
> > + goto out;
> > + fprintf(stderr, "otime %s\n", ot_str);
> > + }
> > +
> > +out:
> > + return 0;
> > +}
>
> Are you planning to do anything with otime (e.g., storing it in an
> xattr) in the future?
At this point I don't have further plan to use the value on the receive
side, there's no standard way to track otime outside of the inode. This
is up to the application, it can be stored in a xattr or just
cross-referenced with some other data.
I don't remember if there was a specific request for the otime in the
protocol, but for completeness of the information it makes sense to
transfer it to the receiving side.
> > static const char * const cmd_send_usage[] = {
> > "btrfs send [-ve] [-p <parent>] [-c <clone-src>] [-f <outfile>] <subvol> [<subvol>...]",
> > "Send the subvolume(s) to stdout.",
> > @@ -447,6 +483,7 @@ static const char * const cmd_send_usage[] = {
> > " does not contain any file data and thus cannot be used",
> > " to transfer changes. This mode is faster and useful to",
> > " show the differences in metadata.",
> > + "--proto N request maximum protocol version N (default: highest supported by running kernel)",
>
> Can we default to version 1 and provide a way to opt in to the latest
> version? I'm concerned with a kernel upgrade suddenly creating a send
> stream that the receiving side can't handle. Making this opt-in rather
> than opt-out seems safer.
Default to v1 is safe, but what's your idea when to change it?
The send/receive usecase has 4 moving parts, kernel/send, progs/send,
progs/receive, kernel/receive. On different hosts and both parts
happening at potentially different times. Getting out of that with sane
defaults will be fun.
I agree that bumping the default any time kernel with new protocol
version support can break things quite easily, so that's against the
usability principles.
As the default is in progs it's a bit more flexible as it does not
require kernel update/reboot. The maximum supported value is known and
the 'default' value 0 for proto version allows that in a way that does
not require updating scripts.
So for first public release, I'll keep the default 1. Changes in the
default version can follow a similar way like mkfs, ie. when there's a
sufficient support in stable kernels. We'll probably also gather some
feedback over time so can decide accordingly.
next prev parent reply other threads:[~2021-10-19 12:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-18 14:41 [PATCH RFC] btrfs: send: v2 protocol and example OTIME changes David Sterba
2021-10-18 14:47 ` [PATCH RFC] btrfs-progs: send protocol v2 stub, UTIMES2, OTIME David Sterba
2021-10-18 21:42 ` Omar Sandoval
2021-10-19 12:53 ` David Sterba [this message]
2021-10-19 14:11 ` Josef Bacik
2021-10-19 17:27 ` Omar Sandoval
2021-10-18 15:36 ` [PATCH RFC] btrfs: send: v2 protocol and example OTIME changes Filipe Manana
2021-10-18 21:26 ` Omar Sandoval
2021-10-19 10:51 ` David Sterba
2021-10-19 7:30 ` Nikolay Borisov
2021-10-19 17:38 ` Omar Sandoval
2021-10-19 20:25 ` 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=20211019125359.GR30611@suse.cz \
--to=dsterba@suse.cz \
--cc=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=nborisov@suse.com \
--cc=osandov@osandov.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