zfs_main: create, clone, rename: accept -pp for non-mountable parents

Teach `zfs {create,clone,rename}` to accept a doubled `-p` flag (`-pp`)
to create non-existing ancestor datasets with `canmount=off`.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rob Norris <robn@despairlabs.com>
Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
Closes #17000
This commit is contained in:
Ivan Shapovalov
2025-01-28 12:11:18 +04:00
committed by Brian Behlendorf
parent 2f3f1ab1ba
commit 8531621aba
11 changed files with 373 additions and 23 deletions
+4
View File
@@ -62,6 +62,10 @@ Creates all the non-existing parent datasets.
Datasets created in this manner are automatically mounted according to the
.Sy mountpoint
property inherited from their parent.
If the
.Fl p
option is specified multiple times, parent datasets are created with
.Sy canmount Ns = Ns Ar off .
If the target filesystem or volume already exists, the operation completes
successfully.
.It Fl u
+8
View File
@@ -85,6 +85,10 @@ property inherited from their parent.
Any property specified on the command line using the
.Fl o
option is ignored.
If the
.Fl p
option is specified multiple times, parent datasets are created with
.Sy canmount Ns = Ns Ar off .
If the target filesystem already exists, the operation completes successfully.
.It Fl n
Do a dry-run
@@ -177,6 +181,10 @@ property inherited from their parent.
Any property specified on the command line using the
.Fl o
option is ignored.
If the
.Fl p
option is specified multiple times, parent datasets are created with
.Sy canmount Ns = Ns Ar off .
If the target filesystem already exists, the operation completes successfully.
.It Fl s
Creates a sparse volume with no reservation.
+4
View File
@@ -103,6 +103,10 @@ Creates all the non-existing parent datasets.
Datasets created in this manner are automatically mounted according to the
.Sy mountpoint
property inherited from their parent.
Alernatively, if the
.Fl p
option is specified multiple times, parent datasets are created with
.Sy canmount Ns = Ns Ar off .
.It Fl u
Do not remount file systems during rename.
If a file system's