aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Yao <[email protected]>2014-06-23 14:26:47 -0400
committerBrian Behlendorf <[email protected]>2014-09-30 10:46:58 -0700
commit00d2a8c92f614f49d23dea5d73f7ea7eb489ccf1 (patch)
tree5d987676f4bd880661b820ef583cd8bd4abdbe54
parent2f3ec9006146844af6763d1fa4e823fd9047fd54 (diff)
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 <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #2417
-rw-r--r--cmd/zpool/zpool_main.c3
-rw-r--r--man/man8/zpool.82
2 files changed, 4 insertions, 1 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
index d6fa8a829..13577d13c 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 f6781bda0..ecf898cbd 100644
--- a/man/man8/zpool.8
+++ b/man/man8/zpool.8
@@ -1503,7 +1503,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