From 4cd8ea7346f6397c208f0dfde99b8a4d9ad08d80 Mon Sep 17 00:00:00 2001 From: Faruk Kasumovic Date: Mon, 6 Aug 2018 10:34:42 +0200 Subject: [PATCH] Skip destroyed pools in pool import search --- zpool.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zpool.go b/zpool.go index 6d00056..153cc97 100644 --- a/zpool.go +++ b/zpool.go @@ -319,6 +319,9 @@ func PoolImportSearch(searchpaths []string) (epools []ExportedPool, err error) { } ep.State = PoolState(C.get_zpool_state(config)) + if ep.State == PoolStateDestroyed { + continue // skip destroyed pools + } if cname = C.get_zpool_name(config); cname == nil { err = fmt.Errorf("Failed to fetch %s", C.ZPOOL_CONFIG_POOL_NAME)