|
Description
|
The zpool_import() interface takes the 'altroot' value as one of its arguments. This used to guarantee that when called with an altroot that the pool information would not be added to the zpool.cache file. This interface was broken when the 'cachefile' property was added. The interface is a contracted interface and must be fixed to ensure previous behavior. It needs to explicitly set the 'cachefile' property to 'none':
if (altroot != NULL) {
if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) {
return (zfs_error_fmt(hdl, EZFS_NOMEM,
dgettext(TEXT_DOMAIN, "cannot import '%s'"),
newname));
}
if (nvlist_add_string(props,
! zpool_prop_to_name(ZPOOL_PROP_ALTROOT), altroot) != 0 ||
! nvlist_add_string(props,
! zpool_prop_to_name(ZPOOL_PROP_CACHEFILE), "none") != 0) {
nvlist_free(props);
return (zfs_error_fmt(hdl, EZFS_NOMEM,
dgettext(TEXT_DOMAIN, "cannot import '%s'"),
newname));
}
|