-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow zfs send to exclude datasets #13158
Conversation
87c22b4
to
1f4eccd
Compare
cc: @pcd1193182 @problame @PaulZ-98 for review feedback. |
192bd0e
to
85c908e
Compare
cmd/zfs/zfs_main.c
Outdated
struct zfs_send_exclude_arg { | ||
size_t count; | ||
char **list; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's define and use a typedef as is done elsewhere.
typedef struct zfs_send_exclude_arg {
} zfs_send_exclude_arg_t;
cmd/zfs/zfs_main.c
Outdated
@@ -4533,6 +4594,8 @@ zfs_do_send(int argc, char **argv) | |||
if (flags.parsable && flags.verbosity == 0) | |||
flags.verbosity = 1; | |||
|
|||
/* Should we warn about no -R but an exclusion list? */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does seem like this should be a fatal error. Offhand I can't think of a case where it would make sense to specify -x
but not -R
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really? Ok. Do I need to do i18n myself, or is the call to gettext() enough? (The commit is coming in a couple of minutes.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could really go either way on this, but unless somebody has a use case where this would actually make sense I'd lean towards generating an error so the user at least knows they're using it wrong. Using gettext()
is plenty.
To make sure we don't accidentally break this functionality in the future I think we're going to need a basic functional test added to |
Ok. I'll go poke at right now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took a quick look.
|
||
log_must_busy zfs destroy -rf $POOL2@presend | ||
|
||
log_must eval "zfs send -R -X ds1/second > $BACKDIR/presend" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need more (separate!) tests that assert multiple -X works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I wrote the one because it was requested, but because I couldn't get it to work locally I didn't write more. Since it does seem to have worked (right?), that gives me a template for adding a couple more...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. The tests all fail for me. However, it looks like they fail for everyone (based on a couple of open pull requests I just checked), so I don't think it's me. That said: I don't know if the test I created actually works! So I'm not sure what to do here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, there is a continuous wrestling match between tests being flaky and whack a mole, but every test bot failing is generally still a sign of a problem.
If you look at e.g. the Centos 7 bot, the only test that failed is the one you added, and if you look at the detailed output:
Test: /usr/share/zfs/zfs-tests/tests/functional/rsend/rsend_025_pos (run as root) [00:03] [FAIL]
22:06:58.12 ASSERTION: zfs send -R -X will skip excluded dataset(s)
22:06:58.12 SUCCESS: rm -rf /mnt/backdir-rsend/*
22:06:58.14 SUCCESS: zfs destroy -Rf testpool2
22:06:58.15 SUCCESS: rm -rf /mnt/backdir-rsend/*
22:06:58.48 SUCCESS: zfs destroy -Rf testpool
22:06:58.56 SUCCESS: zfs create -p testpool/testfs/fs1/fs2
22:06:58.58 SUCCESS: zfs snapshot testpool@psnap
22:06:58.60 SUCCESS: zfs clone testpool@psnap testpool/pclone
22:06:58.64 SUCCESS: zfs create -V 16M testpool/vol
22:06:58.66 SUCCESS: zfs create -V 16M testpool/testfs/vol
22:06:58.85 SUCCESS: zfs snapshot testpool/testfs/vol@vsnap
22:06:58.88 SUCCESS: zfs clone testpool/testfs/vol@vsnap testpool/testfs/vclone
22:06:59.08 SUCCESS: snapshot_tree testpool/testfs/fs1/fs2@fsnap
22:06:59.10 SUCCESS: zfs clone testpool/testfs/fs1/fs2@fsnap testpool/testfs/fs1/fclone
22:06:59.13 SUCCESS: zfs snapshot -r testpool@init
22:06:59.17 SUCCESS: snapshot_tree testpool@snapA
22:06:59.20 SUCCESS: snapshot_tree testpool@snapC
22:06:59.31 SUCCESS: snapshot_tree testpool/pclone@snapB
22:06:59.33 SUCCESS: snapshot_tree testpool/testfs@snapB
22:06:59.41 SUCCESS: snapshot_tree testpool/testfs@snapC
22:06:59.44 SUCCESS: snapshot_tree testpool/testfs/fs1@snapA
22:06:59.51 SUCCESS: snapshot_tree testpool/testfs/fs1@snapB
22:06:59.55 SUCCESS: snapshot_tree testpool/testfs/fs1@snapC
22:06:59.58 SUCCESS: snapshot_tree testpool/testfs/fs1/fclone@snapA
22:06:59.60 SUCCESS: zfs snapshot testpool/vol@snapA
22:06:59.61 SUCCESS: zfs snapshot testpool/testfs/vol@snapB
22:06:59.63 SUCCESS: zfs snapshot testpool/testfs/vol@snapC
22:06:59.64 SUCCESS: zfs snapshot testpool/testfs/vclone@snapC
22:06:59.67 SUCCESS: zfs snapshot -r testpool@final
22:06:59.68 SUCCESS: setup_test_model testpool
22:06:59.70 SUCCESS: zfs create testpool/ds1
22:06:59.73 SUCCESS: zfs create testpool/ds1/second
22:06:59.76 SUCCESS: zfs create testpool/ds1/second/third
22:06:59.78 SUCCESS: zfs create testpool/ds2
22:06:59.81 SUCCESS: zfs create testpool/ds2/second
22:06:59.81 invalid option 'r' usage: create [-Pnpuv] [-o property=value] ... <filesystem> create [-Pnpsv] [-b blocksize] [-o property=value] ... -V <size> <volume> For the property list, run: zfs set|get For the delegated permission list, run: zfs allow|unallow
22:06:59.81 ERROR: zfs create snapshot -r testpool@presend exited 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I shall monitor the centos 7 one! As soon as my server comes back to life.
cmd/zfs/zfs_main.c
Outdated
for (tempString = strsep(&exclude, ","); | ||
tempString != NULL; | ||
tempString = strsep(&exclude, ",")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this, uh, while((ts = strsep(&e, ",") != NULL)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It started out as something else. I've got it changed but I don't want to do anything since I'm trying to run the tests.
@@ -40,6 +40,7 @@ | |||
.Nm zfs | |||
.Cm send | |||
.Op Fl DLPRbcehnpsvw | |||
.Op Fl X Ar dataset Ns Oo , Ns Ar dataset Oc Ns ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again,
.Op Fl X Ar dataset Ns Oo , Ns Ar dataset Oc Ns …
likewise below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are talking about the ellipses, I can't type those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So paste them in? I hardly see what the issue is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that that is a non-ASCII character.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And you're purporting this to be an issue because? Your computer hasn't exploded from the other ellipses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, we have to have the initial commit at less than 80 characters, and there's a bunch of other restrictions requiring ASCII conformance.
Also: I don't use a GUI for programming, and my character set is ASCII. There are multiple instances of '...': zfs-allow.8, zed.8, zpool-scrub.8, zfs-program.8, cstyle.1, and zfsprops.7. And now zfs-send.8.
cmd/zfs/zfs_main.c
Outdated
const char *name; | ||
|
||
name = fullname + strlen(poolname); | ||
if (name && *name == '/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant: name
always holds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grr that was supposed to have been changed. Thanks. grumble. (That's why I converted this to a draft.)
Sorry it took so many tries to get the tests working. But back to ready for review please! |
@kithrup if you rebase this branch on the latest master source and force update the PR that will resolve the unrelated FreeBSD CI failures. |
6771370
to
918f7ee
Compare
Done! |
err = zfs_send(zhp, fromname, toname, &flags, STDOUT_FILENO, NULL, 0, | ||
flags.verbosity >= 3 ? &dbgnv : NULL); | ||
err = zfs_send(zhp, fromname, toname, &flags, STDOUT_FILENO, | ||
exclude_context.count > 0 ? zfs_do_send_exclude : NULL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is interesting that this parameter exists even though we don't use it anywhere in the codebase as far as I can tell. I wonder why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know! I thought that too! I assume there was some use for it at some point in history?
But here is a question: should I clarify the man page to note that the exclusion works on "/datasetname" but not "pool/datasetname" and not "datasetname"? Or should I change the code to assume the / is always there, and allow it to be "datasetname"? I hadn't done that because I thought anchoring it was the better way to go, but then I realized that I also ignore the pool name, so perhaps that is all confusing? |
cmd/zfs/zfs_main.c
Outdated
size_t indx; | ||
const char *name = strchrnul(fullname, '/'); | ||
|
||
if (exclude == NULL || *name == '\0') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still swallows root dataset exclusions – you probably want to forbid those explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error out if it doesn't have a "/" in it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error out in add_dataset_excludes()
if !zfs_name_valid(tok, ZFS_TYPE_DATASET) || strchr(tok, '/') == NULL
, yeah (this would require taking full dataset paths, of course, but that's more consistent and farms out the validation to libzfs, which is a net plus).
I was def. confused by the lack of preceding pool name when testing – no other user-facing facility does this; I'd expect |
{0, 0, 0, 0} | ||
}; | ||
|
||
/* check options */ | ||
while ((c = getopt_long(argc, argv, ":i:I:RsDpvnPLeht:cwbd:S", | ||
while ((c = getopt_long(argc, argv, ":i:I:RsDpvnPLeht:cwbd:SX:", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub doesn't let you comment on untouched lines, but: you also need to add [-X dataset[,dataset]...]
to (a) the comment on top of do_zfs_send()
and (b) the usage strings.
Ok. So use the pool name, complain about only the pool name, update the man page to clarify all of this, and also change the usage description in zfs_main.c. Right? (Going to do so now.) |
dataset hierarchies to be excluded. Fix some style issues. One of them is ugly: (sizeof (char **)) * (tempSize + 1)); has extra parentheses because the style checker decided it was both a cast and a sizeof operator and they have conflicting requirements. Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Per feedback from nabijaczleweli, change the man pages slightly. (For which I am very grateful, I'm at least 5 years out of date on all the macros now.) Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Change to the suggested mdoc usage, for consistency. Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Apply Brian's feedback. Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Change -x back to -X. Attempt to write a test script. Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Oops, remove debugging set -x Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Incorporate feedback Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Add my new test script to the tests Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Change a for to a while, per feedback Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Fix my broken test script. Hopefully, anyway. Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Fix another typo Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Next attempt to get my new test working Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Left-over zfs create Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Fix bugs found by the test script! Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Add 2 more rsend tests Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Per feedback, checking for NULL is redundant Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Forgot to add my new tests to the roster Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Incorporate review feedback Signed-off-by: Sean Eric Fagan <kithrup@mac.com> grr missed a style check Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Replace the parsing code with the version nabijaczleweli wants. Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Per feedback: 1. Update usage messages. 2. Change the exclusion to require the pool name. 3. Error if the exclusion name isn't a proper pool/dataset name. 4. Update the man page accordingly. Signed-off-by: Sean Eric Fagan <kithrup@mac.com> More feedback. This mostly involved usage and man page changes. Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Fix my man page brokening, and add a couple more tests. Also fix the test to match the actual usage of the zfs send command. Signed-off-by: Sean Eric Fagan <kithrup@mac.com>
Signed-off-by: Sean Eric Fagan <kithrup@mac.com>
34a04f3
to
f62c0ed
Compare
I did a rebase on master, thus the force push. |
@kithrup thanks for refreshing this, it looks like this PR is in good shape. It'd be great if folks could take one last look, and if there are no concerns let's get it merged. |
Add support for a -exclude/-X option to `zfs send` to allow dataset hierarchies to be excluded. Snapshots can be excluded using a channel program; however, this can result in failures with 'zfs send -R'; this option allows them to be excluded. Fortunately, this required a change only to cmd/zfs/zfs_main.c, using the already-existing callback argument to zfs_send() that is currently unused. Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Christian Schwarz <christian.schwarz@nutanix.com> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sean Eric Fagan <kithrup@mac.com> Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Closes openzfs#13158
Add support for a -exclude/-X option to `zfs send` to allow dataset hierarchies to be excluded. Snapshots can be excluded using a channel program; however, this can result in failures with 'zfs send -R'; this option allows them to be excluded. Fortunately, this required a change only to cmd/zfs/zfs_main.c, using the already-existing callback argument to zfs_send() that is currently unused. Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Christian Schwarz <christian.schwarz@nutanix.com> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sean Eric Fagan <kithrup@mac.com> Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Closes openzfs#13158
Add support for a -exclude/-X option to `zfs send` to allow dataset hierarchies to be excluded. Snapshots can be excluded using a channel program; however, this can result in failures with 'zfs send -R'; this option allows them to be excluded. Fortunately, this required a change only to cmd/zfs/zfs_main.c, using the already-existing callback argument to zfs_send() that is currently unused. Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Christian Schwarz <christian.schwarz@nutanix.com> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sean Eric Fagan <kithrup@mac.com> Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Closes openzfs#13158
Add support for a -exclude/-X option to `zfs send` to allow dataset hierarchies to be excluded. Snapshots can be excluded using a channel program; however, this can result in failures with 'zfs send -R'; this option allows them to be excluded. Fortunately, this required a change only to cmd/zfs/zfs_main.c, using the already-existing callback argument to zfs_send() that is currently unused. Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Christian Schwarz <christian.schwarz@nutanix.com> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sean Eric Fagan <kithrup@mac.com> Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Closes openzfs#13158
Add support for a -exclude/-X option to `zfs send` to allow dataset hierarchies to be excluded. Snapshots can be excluded using a channel program; however, this can result in failures with 'zfs send -R'; this option allows them to be excluded. Fortunately, this required a change only to cmd/zfs/zfs_main.c, using the already-existing callback argument to zfs_send() that is currently unused. Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Christian Schwarz <christian.schwarz@nutanix.com> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sean Eric Fagan <kithrup@mac.com> Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Closes openzfs#13158
Add support for a -exclude/-X option to `zfs send` to allow dataset hierarchies to be excluded. Snapshots can be excluded using a channel program; however, this can result in failures with 'zfs send -R'; this option allows them to be excluded. Fortunately, this required a change only to cmd/zfs/zfs_main.c, using the already-existing callback argument to zfs_send() that is currently unused. Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Christian Schwarz <christian.schwarz@nutanix.com> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sean Eric Fagan <kithrup@mac.com> Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Closes openzfs#13158
Add support for a -exclude/-X option to `zfs send` to allow dataset hierarchies to be excluded. Snapshots can be excluded using a channel program; however, this can result in failures with 'zfs send -R'; this option allows them to be excluded. Fortunately, this required a change only to cmd/zfs/zfs_main.c, using the already-existing callback argument to zfs_send() that is currently unused. Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Christian Schwarz <christian.schwarz@nutanix.com> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sean Eric Fagan <kithrup@mac.com> Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Closes openzfs#13158
Add support for a -exclude/-X option to `zfs send` to allow dataset hierarchies to be excluded. Snapshots can be excluded using a channel program; however, this can result in failures with 'zfs send -R'; this option allows them to be excluded. Fortunately, this required a change only to cmd/zfs/zfs_main.c, using the already-existing callback argument to zfs_send() that is currently unused. Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Christian Schwarz <christian.schwarz@nutanix.com> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sean Eric Fagan <kithrup@mac.com> Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Closes openzfs#13158
Add support for a -exclude/-X option to `zfs send` to allow dataset hierarchies to be excluded. Snapshots can be excluded using a channel program; however, this can result in failures with 'zfs send -R'; this option allows them to be excluded. Fortunately, this required a change only to cmd/zfs/zfs_main.c, using the already-existing callback argument to zfs_send() that is currently unused. Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Christian Schwarz <christian.schwarz@nutanix.com> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sean Eric Fagan <kithrup@mac.com> Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Closes openzfs#13158
Add support for a -exclude/-X option to `zfs send` to allow dataset hierarchies to be excluded. Snapshots can be excluded using a channel program; however, this can result in failures with 'zfs send -R'; this option allows them to be excluded. Fortunately, this required a change only to cmd/zfs/zfs_main.c, using the already-existing callback argument to zfs_send() that is currently unused. Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Christian Schwarz <christian.schwarz@nutanix.com> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sean Eric Fagan <kithrup@mac.com> Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Closes openzfs#13158
Add support for a -exclude/-X option to `zfs send` to allow dataset hierarchies to be excluded. Snapshots can be excluded using a channel program; however, this can result in failures with 'zfs send -R'; this option allows them to be excluded. Fortunately, this required a change only to cmd/zfs/zfs_main.c, using the already-existing callback argument to zfs_send() that is currently unused. Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Christian Schwarz <christian.schwarz@nutanix.com> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sean Eric Fagan <kithrup@mac.com> Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Closes openzfs#13158
Add support for a -exclude/-X option to `zfs send` to allow dataset hierarchies to be excluded. Snapshots can be excluded using a channel program; however, this can result in failures with 'zfs send -R'; this option allows them to be excluded. Fortunately, this required a change only to cmd/zfs/zfs_main.c, using the already-existing callback argument to zfs_send() that is currently unused. Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Christian Schwarz <christian.schwarz@nutanix.com> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sean Eric Fagan <kithrup@mac.com> Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Closes openzfs#13158
Add support for a -exclude/-X option to `zfs send` to allow dataset hierarchies to be excluded. Snapshots can be excluded using a channel program; however, this can result in failures with 'zfs send -R'; this option allows them to be excluded. Fortunately, this required a change only to cmd/zfs/zfs_main.c, using the already-existing callback argument to zfs_send() that is currently unused. Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Christian Schwarz <christian.schwarz@nutanix.com> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sean Eric Fagan <kithrup@mac.com> Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Closes openzfs#13158
Add support for a -exclude/-X option to `zfs send` to allow dataset hierarchies to be excluded. Snapshots can be excluded using a channel program; however, this can result in failures with 'zfs send -R'; this option allows them to be excluded. Fortunately, this required a change only to cmd/zfs/zfs_main.c, using the already-existing callback argument to zfs_send() that is currently unused. Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Christian Schwarz <christian.schwarz@nutanix.com> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sean Eric Fagan <kithrup@mac.com> Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Closes openzfs#13158
Add support for a -exclude/-X option to `zfs send` to allow dataset hierarchies to be excluded. Snapshots can be excluded using a channel program; however, this can result in failures with 'zfs send -R'; this option allows them to be excluded. Fortunately, this required a change only to cmd/zfs/zfs_main.c, using the already-existing callback argument to zfs_send() that is currently unused. Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Christian Schwarz <christian.schwarz@nutanix.com> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sean Eric Fagan <kithrup@mac.com> Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Closes openzfs#13158
Add support for a -exclude/-X option to `zfs send` to allow dataset hierarchies to be excluded. Snapshots can be excluded using a channel program; however, this can result in failures with 'zfs send -R'; this option allows them to be excluded. Fortunately, this required a change only to cmd/zfs/zfs_main.c, using the already-existing callback argument to zfs_send() that is currently unused. Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Christian Schwarz <christian.schwarz@nutanix.com> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sean Eric Fagan <kithrup@mac.com> Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Closes openzfs#13158
Add support for a -exclude/-X option to `zfs send` to allow dataset hierarchies to be excluded. Snapshots can be excluded using a channel program; however, this can result in failures with 'zfs send -R'; this option allows them to be excluded. Fortunately, this required a change only to cmd/zfs/zfs_main.c, using the already-existing callback argument to zfs_send() that is currently unused. Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Christian Schwarz <christian.schwarz@nutanix.com> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: Sean Eric Fagan <kithrup@mac.com> Signed-off-by: Sean Eric Fagan <kithrup@mac.com> Closes openzfs#13158
Add support for a -exclude/-X option to zfs send to allow dataset hierarchies to be excluded.
Motivation and Context
Snapshots can be excluded using a channel program; however,
this can result in failures with 'zfs send -R'; this option allows them
to be excluded. In my case, I specifically want to exclude Time
Machine backup datasets, as they have more churn than they are
worth in most cases.
Description
Fortunately, this required a change only to cmd/zfs/zfs_main.c,
using the already-existing callback argument to zfs_send that
is currently unused.
How Has This Been Tested?
Did zfs send -R with and without exclusions, and used zfs recv -nv to see the list of datasets being transmitted. Verified that excluded datasets were not included.
Types of changes
Checklist:
My code follows the OpenZFS code style requirements.
I have updated the documentation accordingly.
I have read the contributing document.
I have added tests to cover my changes.
I have run the ZFS Test Suite with this change applied.
All commit messages are properly formatted and contain [
Signed-off-by
](https://github.com/openzfs/zfs/blob/master/.github/CONTRIBUTING.md#signed-off-by
).