summaryrefslogtreecommitdiffstats
path: root/cmd/zfs
diff options
context:
space:
mode:
authorTom Caputi <[email protected]>2019-06-28 15:38:37 -0400
committerBrian Behlendorf <[email protected]>2019-06-28 12:38:37 -0700
commit765d1f0644658d772addeb9b2dd5039ac43177ad (patch)
tree9c7bf6299e4a9109a1759d4ac9227774f148a259 /cmd/zfs
parent679b0f2abf4cfce9e1520f877bd1970c6cb6426b (diff)
Add 'zfs umount -u' for encrypted datasets
This patch adds the ability for the user to unload keys for datasets as they are being unmounted. This is analogous to 'zfs mount -l'. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alek Pinchuk <[email protected]> Signed-off-by: Tom Caputi <[email protected]> Closes: #8917 Closes: #8952
Diffstat (limited to 'cmd/zfs')
-rw-r--r--cmd/zfs/zfs_main.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c
index 30942e1f0..bddf25c2d 100644
--- a/cmd/zfs/zfs_main.c
+++ b/cmd/zfs/zfs_main.c
@@ -315,7 +315,7 @@ get_usage(zfs_help_t idx)
return (gettext("\tsnapshot [-r] [-o property=value] ... "
"<filesystem|volume>@<snap> ...\n"));
case HELP_UNMOUNT:
- return (gettext("\tunmount [-f] "
+ return (gettext("\tunmount [-fu] "
"<-a | filesystem|mountpoint>\n"));
case HELP_UNSHARE:
return (gettext("\tunshare "
@@ -7015,13 +7015,16 @@ unshare_unmount(int op, int argc, char **argv)
char sharesmb[ZFS_MAXPROPLEN];
/* check options */
- while ((c = getopt(argc, argv, op == OP_SHARE ? ":a" : "af")) != -1) {
+ while ((c = getopt(argc, argv, op == OP_SHARE ? ":a" : "afu")) != -1) {
switch (c) {
case 'a':
do_all = 1;
break;
case 'f':
- flags = MS_FORCE;
+ flags |= MS_FORCE;
+ break;
+ case 'u':
+ flags |= MS_CRYPT;
break;
case ':':
(void) fprintf(stderr, gettext("missing argument for "
@@ -7281,8 +7284,8 @@ unshare_unmount(int op, int argc, char **argv)
}
/*
- * zfs unmount -a
- * zfs unmount filesystem
+ * zfs unmount [-fu] -a
+ * zfs unmount [-fu] filesystem
*
* Unmount all filesystems, or a specific ZFS filesystem.
*/