From: Brian Behlendorf Date: Wed, 18 Feb 2009 21:12:35 +0000 (-0800) Subject: Merge commit 'refs/top-bases/gcc-cast' into gcc-cast X-Git-Tag: zfs-0.4.4~12^2~48^2~2^2^2~8^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e203e7b48f1539cbe7957728ea3aee248f4bb5e5;p=zfs Merge commit 'refs/top-bases/gcc-cast' into gcc-cast --- e203e7b48f1539cbe7957728ea3aee248f4bb5e5 diff --cc module/zfs/zfs_ioctl.c index 500a2fb5f,d032648b5..aa7ffb59d --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@@ -1665,12 -1695,22 +1695,22 @@@ zfs_ioc_pool_get_props(zfs_cmd_t *zc int error; nvlist_t *nvp = NULL; - if ((error = spa_open(zc->zc_name, &spa, FTAG)) != 0) - return (error); - - error = spa_prop_get(spa, &nvp); + if ((error = spa_open(zc->zc_name, &spa, FTAG)) != 0) { + /* + * If the pool is faulted, there may be properties we can still + * get (such as altroot and cachefile), so attempt to get them + * anyway. + */ + mutex_enter(&spa_namespace_lock); + if ((spa = spa_lookup(zc->zc_name)) != NULL) + error = spa_prop_get(spa, &nvp); + mutex_exit(&spa_namespace_lock); + } else { + error = spa_prop_get(spa, &nvp); + spa_close(spa, FTAG); + } - if (error == 0 && zc->zc_nvlist_dst != NULL) + if (error == 0 && zc->zc_nvlist_dst != 0) error = put_nvlist(zc, nvp); else error = EFAULT;