OpenSolaris

Printable Version Enter a New Search
Bug ID 6769612
Synopsis zpool_import() will continue to write to cachefile even if altroot is set
State 10-Fix Delivered (Fix available in build)
Category:Subcategory utility:zfs
Keywords 2008.11-reviewed
Responsible Engineer George Wilson
Reported Against solaris_10u6 , osol_2008.05u3
Duplicate Of
Introduced In solaris_nevada
Commit to Fix snv_104
Fixed In snv_104
Release Fixed solaris_nevada(snv_104) , solaris_10u7(s10u7_02) (Bug ID:2169440)
Related Bugs 6620452 , 6769922
Submit Date 10-November-2008
Last Update Date 4-December-2008
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));
                }
Work Around
N/A
Comments
N/A