-
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
Add -u option to 'zfs create' #11254
Conversation
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.
Reviewed By: Allan Jude [email protected]
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.
Can you include a simple cli_root/zfs_create/
test for this.
cmd/zfs/zfs_main.c
Outdated
@@ -1105,6 +1111,11 @@ zfs_do_create(int argc, char **argv) | |||
"used when creating a volume\n")); | |||
goto badusage; | |||
} | |||
if (nomount && type != ZFS_TYPE_FILESYSTEM) { | |||
(void) fprintf(stderr, gettext("'-u' can only be " | |||
"used when creating a file system\n")); |
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.
nit: It looks like all but a few of the error message use "filesystem" instead of "file system".
cmd/zfs/zfs_main.c
Outdated
@@ -1265,7 +1276,8 @@ zfs_do_create(int argc, char **argv) | |||
log_history = B_FALSE; | |||
} | |||
|
|||
ret = zfs_mount_and_share(g_zfs, argv[0], ZFS_TYPE_DATASET); | |||
if (!nomount) | |||
ret = zfs_mount_and_share(g_zfs, argv[0], ZFS_TYPE_DATASET); |
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.
Skipping the zfs_mount_and_share
here looks like it will incorrectly leave the return value ret
as 1
.
df56ff5
to
ea92198
Compare
|
It seems there's some trouble with the new test:
|
Add -u option to 'zfs create' that prevents file system from being automatically mounted. This is similar to the 'zfs receive -u'. Authored by: pjd <[email protected]> FreeBSD-commit: freebsd/freebsd-src@35c5823 Ported-by: Ryan Moeller <[email protected]> Signed-off-by: Ryan Moeller <[email protected]>
Add -u option to 'zfs create' that prevents file system from being automatically mounted. This is similar to the 'zfs receive -u'. Authored by: pjd <[email protected]> FreeBSD-commit: freebsd/freebsd-src@35c5823 Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Allan Jude <[email protected]> Ported-by: Ryan Moeller <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes openzfs#11254
Add -u option to 'zfs create' that prevents file system from being automatically mounted. This is similar to the 'zfs receive -u'. Authored by: pjd <[email protected]> FreeBSD-commit: freebsd/freebsd-src@35c5823 Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Allan Jude <[email protected]> Ported-by: Ryan Moeller <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes openzfs#11254
Add -u option to 'zfs create' that prevents file system from being automatically mounted. This is similar to the 'zfs receive -u'. Authored by: pjd <[email protected]> FreeBSD-commit: freebsd/freebsd-src@35c5823 Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Allan Jude <[email protected]> Ported-by: Ryan Moeller <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes openzfs#11254
Motivation and Context
This was reported as a feature lost in FreeBSD with the switch to OpenZFS.
Description
Add -u option to 'zfs create' that prevents file system from being
automatically mounted. This is similar to the 'zfs receive -u'.
How Has This Been Tested?
This has been in FreeBSD since 2012. ZTS results pending.
Types of changes
Checklist:
Signed-off-by
.