Skip to content

Commit

Permalink
zpool import -t should not update cachefile
Browse files Browse the repository at this point in the history
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 openzfs#2417
  • Loading branch information
ryao authored and behlendorf committed Sep 30, 2014
1 parent 2f3ec90 commit 00d2a8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cmd/zpool/zpool_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
2 changes: 1 addition & 1 deletion man/man8/zpool.8
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 00d2a8c

Please sign in to comment.