usr/src/lib/libzfs/common/libzfs_status.c
changeset 13700 2889e2596bd6
parent 12296 7cf402a7f374
child 13753 2aba784c276b
equal deleted inserted replaced
13699:733714f4dc24 13700:2889e2596bd6
    16  * fields enclosed by brackets "[]" replaced with your own identifying
    16  * fields enclosed by brackets "[]" replaced with your own identifying
    17  * information: Portions Copyright [yyyy] [name of copyright owner]
    17  * information: Portions Copyright [yyyy] [name of copyright owner]
    18  *
    18  *
    19  * CDDL HEADER END
    19  * CDDL HEADER END
    20  */
    20  */
       
    21 
    21 /*
    22 /*
    22  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
    23  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
       
    24  * Copyright (c) 2012 by Delphix. All rights reserved.
    23  */
    25  */
    24 
    26 
    25 /*
    27 /*
    26  * This file contains the functions which analyze the status of a pool.  This
    28  * This file contains the functions which analyze the status of a pool.  This
    27  * include both the status of an active pool, as well as the status exported
    29  * include both the status of an active pool, as well as the status exported
   212 	if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
   214 	if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
   213 	    vs->vs_aux == VDEV_AUX_VERSION_NEWER)
   215 	    vs->vs_aux == VDEV_AUX_VERSION_NEWER)
   214 		return (ZPOOL_STATUS_VERSION_NEWER);
   216 		return (ZPOOL_STATUS_VERSION_NEWER);
   215 
   217 
   216 	/*
   218 	/*
       
   219 	 * Unsupported feature(s).
       
   220 	 */
       
   221 	if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
       
   222 	    vs->vs_aux == VDEV_AUX_UNSUP_FEAT) {
       
   223 		nvlist_t *nvinfo;
       
   224 
       
   225 		verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_LOAD_INFO,
       
   226 		    &nvinfo) == 0);
       
   227 		if (nvlist_exists(nvinfo, ZPOOL_CONFIG_CAN_RDONLY))
       
   228 			return (ZPOOL_STATUS_UNSUP_FEAT_WRITE);
       
   229 		return (ZPOOL_STATUS_UNSUP_FEAT_READ);
       
   230 	}
       
   231 
       
   232 	/*
   217 	 * Check that the config is complete.
   233 	 * Check that the config is complete.
   218 	 */
   234 	 */
   219 	if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
   235 	if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
   220 	    vs->vs_aux == VDEV_AUX_BAD_GUID_SUM)
   236 	    vs->vs_aux == VDEV_AUX_BAD_GUID_SUM)
   221 		return (ZPOOL_STATUS_BAD_GUID_SUM);
   237 		return (ZPOOL_STATUS_BAD_GUID_SUM);
   298 		return (ZPOOL_STATUS_REMOVED_DEV);
   314 		return (ZPOOL_STATUS_REMOVED_DEV);
   299 
   315 
   300 	/*
   316 	/*
   301 	 * Outdated, but usable, version
   317 	 * Outdated, but usable, version
   302 	 */
   318 	 */
   303 	if (version < SPA_VERSION)
   319 	if (SPA_VERSION_IS_SUPPORTED(version) && version != SPA_VERSION)
   304 		return (ZPOOL_STATUS_VERSION_OLDER);
   320 		return (ZPOOL_STATUS_VERSION_OLDER);
   305 
   321 
   306 	return (ZPOOL_STATUS_OK);
   322 	return (ZPOOL_STATUS_OK);
   307 }
   323 }
   308 
   324