From a7e675d8e09fe1536f4ee337b5a0beb5f5e96a61 Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Mon, 23 Jun 2014 14:26:47 -0400 Subject: [PATCH] zpool import -t should not update cachefile zpool import's -t parameter is intended for use with -R when operating on pools that belong to other systems. Like -R, pools imported in this way should not update the cachefile unless explicitly requested. The initial implementation allowed the cachefile to be updated when -R was not used. This went uncaught during testing because -R had implicitly disabled use of the cachefile. Signed-off-by: Richard Yao Signed-off-by: Brian Behlendorf Issue #2417 --- cmd/zpool/zpool_main.c | 3 +++ man/man8/zpool.8 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index ebe760bd5ced..e73a38cb278e 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -2085,6 +2085,9 @@ zpool_do_import(int argc, char **argv) break; case 't': flags |= ZFS_IMPORT_TEMP_NAME; + if (add_prop_list_default(zpool_prop_to_name( + ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE)) + goto error; break; case 'T': diff --git a/man/man8/zpool.8 b/man/man8/zpool.8 index 7f0f3f37c61c..df107b182ba5 100644 --- a/man/man8/zpool.8 +++ b/man/man8/zpool.8 @@ -1474,7 +1474,7 @@ Specify the txg to use for rollback. Implies \fB-FX\fR. For more details about .ad .sp .6 .RS 4n -Used with "\fBnewpool\fR". Specifies that "\fBnewpool\fR" is temporary. Temporary pool names last until export. Ensures that the original pool name will be used in all label updates and therefore is retained upon export. +Used with "\fBnewpool\fR". Specifies that "\fBnewpool\fR" is temporary. Temporary pool names last until export. Ensures that the original pool name will be used in all label updates and therefore is retained upon export. Will also set -o cachefile=none when not explicitly specified. .RE .sp