summaryrefslogtreecommitdiff
path: root/usr/src/lib/libzfs/common/libzfs_import.c
diff options
context:
space:
mode:
authorck153898 <none@none>2008-06-25 12:55:26 -0700
committerck153898 <none@none>2008-06-25 12:55:26 -0700
commite829d913cde9eeff0efd355502799863d4f74f69 (patch)
tree08c5380be0ab16d84d73d5e19d667c9235781ee9 /usr/src/lib/libzfs/common/libzfs_import.c
parent44aa1912a7997724e93628021ba24710b116bfd4 (diff)
downloadillumos-joyent-e829d913cde9eeff0efd355502799863d4f74f69.tar.gz
6689844 ztest fails with "zdb: can't open ztest: No such device or address"
Diffstat (limited to 'usr/src/lib/libzfs/common/libzfs_import.c')
-rw-r--r--usr/src/lib/libzfs/common/libzfs_import.c49
1 files changed, 19 insertions, 30 deletions
diff --git a/usr/src/lib/libzfs/common/libzfs_import.c b/usr/src/lib/libzfs/common/libzfs_import.c
index 36a4d3a18f..f656695021 100644
--- a/usr/src/lib/libzfs/common/libzfs_import.c
+++ b/usr/src/lib/libzfs/common/libzfs_import.c
@@ -980,7 +980,7 @@ zpool_find_import_activeok(libzfs_handle_t *hdl, int argc, char **argv)
*/
nvlist_t *
zpool_find_import_cached(libzfs_handle_t *hdl, const char *cachefile,
- boolean_t active_ok, char *poolname, uint64_t guid)
+ char *poolname, uint64_t guid)
{
char *buf;
int fd;
@@ -1063,40 +1063,29 @@ zpool_find_import_cached(libzfs_handle_t *hdl, const char *cachefile,
continue;
}
- if (!active_ok) {
- if (pool_active(hdl, name, this_guid, &active) != 0) {
- nvlist_free(raw);
- nvlist_free(pools);
- return (NULL);
- }
+ if (pool_active(hdl, name, this_guid, &active) != 0) {
+ nvlist_free(raw);
+ nvlist_free(pools);
+ return (NULL);
+ }
- if (active)
- continue;
+ if (active)
+ continue;
- if ((dst = refresh_config(hdl, src)) == NULL) {
- nvlist_free(raw);
- nvlist_free(pools);
- return (NULL);
- }
+ if ((dst = refresh_config(hdl, src)) == NULL) {
+ nvlist_free(raw);
+ nvlist_free(pools);
+ return (NULL);
+ }
- if (nvlist_add_nvlist(pools, nvpair_name(elem), dst)
- != 0) {
- (void) no_memory(hdl);
- nvlist_free(dst);
- nvlist_free(raw);
- nvlist_free(pools);
- return (NULL);
- }
+ if (nvlist_add_nvlist(pools, nvpair_name(elem), dst) != 0) {
+ (void) no_memory(hdl);
nvlist_free(dst);
- } else {
- if (nvlist_add_nvlist(pools, nvpair_name(elem), src)
- != 0) {
- (void) no_memory(hdl);
- nvlist_free(raw);
- nvlist_free(pools);
- return (NULL);
- }
+ nvlist_free(raw);
+ nvlist_free(pools);
+ return (NULL);
}
+ nvlist_free(dst);
}
nvlist_free(raw);