Matthew Ahrens
2013-02-25 21:02:52 UTC
Steven, thanks for following up on this.
It would be really great if you could integrate this into illumos. I think
all you would need to do is convert the manpage changes (illumos uses a
different markup language for manpages), apply your diffs, build and test
on illumos, and post a webrev for review on ***@lists.illumos.org.
It would also be great if you could work with John Kennedy to integrate
test for the new features into the zfs test suite.
I took another look at your diffs and noticed just a few small things that
could be improved:
zfs.8 line ~2383 misspells "receive"
line ~2420:
+If a received property needs to be overridden, the effective value can be
+set or inherited, depending on the property.
I think you mean "will be set or inherited" (the user doesn't choose). You
could also mention what it depends on ("depending on if the property is
inheritable or not").
We shoud clarify that the filesystem/volume names must be specified as they
existed on the sending system (as opposed to the names that they will be
received into).
zfs_main.c:
since parsepropname() is used not just for properties (e.g. for -l), you
might call it something like "addonce" and not have its error message use
the term "property".
props_override():
Can your calls to nvlist_add_*() ever fail? (e.g. due to the name already
existing)? I don't think so, in which case you should
VERIFY0(nvlist_add_*()), or better yet use the fnvlist_* routines.
+ char *sepp = strchr(propname, sepp);
I don't think this will compile; you probably want "strchr(propname, sep)".
Be sure to test this out.
zfs_receive_one(): "skip" should be a boolean_t.
Again, thanks for doing this Steven. Looking forward to having it in
illumos and FreeBSD!
--matt
illumos-zfs
Archives: https://www.listbox.com/member/archive/182191/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182191/23047029-187a0c8d
Modify Your Subscription: https://www.listbox.com/member/?member_id=23047029&id_secret=23047029-2e85923f
Powered by Listbox: http://www.listbox.com
It would be really great if you could integrate this into illumos. I think
all you would need to do is convert the manpage changes (illumos uses a
different markup language for manpages), apply your diffs, build and test
on illumos, and post a webrev for review on ***@lists.illumos.org.
It would also be great if you could work with John Kennedy to integrate
test for the new features into the zfs test suite.
I took another look at your diffs and noticed just a few small things that
could be improved:
zfs.8 line ~2383 misspells "receive"
line ~2420:
+If a received property needs to be overridden, the effective value can be
+set or inherited, depending on the property.
I think you mean "will be set or inherited" (the user doesn't choose). You
could also mention what it depends on ("depending on if the property is
inheritable or not").
We shoud clarify that the filesystem/volume names must be specified as they
existed on the sending system (as opposed to the names that they will be
received into).
zfs_main.c:
since parsepropname() is used not just for properties (e.g. for -l), you
might call it something like "addonce" and not have its error message use
the term "property".
props_override():
Can your calls to nvlist_add_*() ever fail? (e.g. due to the name already
existing)? I don't think so, in which case you should
VERIFY0(nvlist_add_*()), or better yet use the fnvlist_* routines.
+ char *sepp = strchr(propname, sepp);
I don't think this will compile; you probably want "strchr(propname, sep)".
Be sure to test this out.
zfs_receive_one(): "skip" should be a boolean_t.
Again, thanks for doing this Steven. Looking forward to having it in
illumos and FreeBSD!
--matt
Sorry its taken so long to get round to this, just had a really busy
number of months. Anyway all the changes have been made, see below
for individual details, patches are attached.
----- Original Message ----- From: "Steven Hartland"
Fixed this, and created a seperate patch for fixing the original code too
see attached
zfs_receive() can't deal with an empty list of properties or datasets?
Comment expanded to give more insite into what its doing
however I think that the following idiom for iterating over a nvlist
Changed
the variable you call "tods" would usually be named "atp" (the pointer
in the version of FreeBSD I based this work on, but definitely
something to get fixed.
Any suggestions on an alternative syntax?
Separator changed to # and code changes to sepp (the pointer to the
separator character)
It seems like the only way you could get a non-string, non-boolean
These are now asserts
It seems like you could omit the "if (!nvlist_exists([gd]xprops)"
only to remove it later for performance was my thinking. Do you believe
this wouldn't result in any performance loss if removed?
Likewise the "!nvlist_exists(doprops" check, because the dx props will
Given there will be little performance difference either way I've decided
to keep it as it was so that the output in verbose case is what the user
would expect.
Regards
Steve
==============================**==================
This e.mail is private and confidential between Multiplay (UK) Ltd. and
the person or entity to whom it is addressed. In the event of misdirection,
the recipient is prohibited from using, copying, printing or otherwise
disseminating it or any information contained in it.
In the event of misdirection, illegible or incomplete transmission please
telephone +44 845 868 1337
------------------------------**-------------
illumos-developer
Archives: https://www.listbox.com/**member/archive/182179/=now<https://www.listbox.com/member/archive/182179/=now>
RSS Feed: https://www.listbox.com/**member/archive/rss/182179/**
21175174-cd73734d<https://www.listbox.com/member/archive/rss/182179/21175174-cd73734d>
Modify Your Subscription: https://www.listbox.com/**
member/?&id_**secret=21175174-792643f6<https://www.listbox.com/member/?&>
Powered by Listbox: http://www.listbox.com
-------------------------------------------number of months. Anyway all the changes have been made, see below
for individual details, patches are attached.
----- Original Message ----- From: "Steven Hartland"
parsepropname(): I see that you're following the bad example set by
parseprop() and parse_depth() of operating on optarg. It would be
better to explicitly pass the name of the property to parse, rather
than operating on the global optarg. To isolate the uglyness of this
global variable, optarg should only be used within the function that
calls getopt(). It would be great if you wanted to fix all of these,
but if not that's OK.
I'll look into this thanks, as you said following the example ;-)parseprop() and parse_depth() of operating on optarg. It would be
better to explicitly pass the name of the property to parse, rather
than operating on the global optarg. To isolate the uglyness of this
global variable, optarg should only be used within the function that
calls getopt(). It would be great if you wanted to fix all of these,
but if not that's OK.
see attached
zfs_receive() can't deal with an empty list of properties or datasets?
Was just forward loading that logic at the time, will review and update
if its doesn't make sense any more.
Minor changes needed to faciliated this which have been done.if its doesn't make sense any more.
this function could use some comments explaining what is doing.
Will do.however I think that the following idiom for iterating over a nvlist
is more easily understood, because it keeps all the iteration logic in
for (nvpair_t *pair = nvlist_next_nvpair(nvl, NULL);
pair != NULL;
pair = nvlist_next_nvpair(nvl, pair)) {
...
}
Not a problem will change.for (nvpair_t *pair = nvlist_next_nvpair(nvl, NULL);
pair != NULL;
pair = nvlist_next_nvpair(nvl, pair)) {
...
}
the variable you call "tods" would usually be named "atp" (the pointer
to the "at" character). This is where you will have a bug when
I wasn't aware that style of permissions existed, not sure they doin the version of FreeBSD I based this work on, but definitely
something to get fixed.
Any suggestions on an alternative syntax?
separator character)
It seems like the only way you could get a non-string, non-boolean
nvpair would be a programming error (i.e. bad user input could not
cause it). Therefore you should assert this is the case, rather than
print an error message.
Yes I agree, will do.cause it). Therefore you should assert this is the case, rather than
print an error message.
It seems like you could omit the "if (!nvlist_exists([gd]xprops)"
check, because the -x props will be removed after this anyway.
It would but didn't want it going through all the effort of adding itonly to remove it later for performance was my thinking. Do you believe
this wouldn't result in any performance loss if removed?
Likewise the "!nvlist_exists(doprops" check, because the dx props will
to keep it as it was so that the output in verbose case is what the user
would expect.
Regards
Steve
==============================**==================
This e.mail is private and confidential between Multiplay (UK) Ltd. and
the person or entity to whom it is addressed. In the event of misdirection,
the recipient is prohibited from using, copying, printing or otherwise
disseminating it or any information contained in it.
In the event of misdirection, illegible or incomplete transmission please
telephone +44 845 868 1337
------------------------------**-------------
illumos-developer
Archives: https://www.listbox.com/**member/archive/182179/=now<https://www.listbox.com/member/archive/182179/=now>
RSS Feed: https://www.listbox.com/**member/archive/rss/182179/**
21175174-cd73734d<https://www.listbox.com/member/archive/rss/182179/21175174-cd73734d>
Modify Your Subscription: https://www.listbox.com/**
member/?&id_**secret=21175174-792643f6<https://www.listbox.com/member/?&>
Powered by Listbox: http://www.listbox.com
illumos-zfs
Archives: https://www.listbox.com/member/archive/182191/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182191/23047029-187a0c8d
Modify Your Subscription: https://www.listbox.com/member/?member_id=23047029&id_secret=23047029-2e85923f
Powered by Listbox: http://www.listbox.com