From 5e5ef59162eacf173c9f7e501a98a9c5eca897d3 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Fri, 13 Mar 2015 10:44:12 +0100 Subject: [PATCH] spa_import_rootpool(): Fix ressource leaks if the pool label is missing Previously spa_namespace_lock was kept locked which prevented the system from booting even if the root pool label was actually found later on. An insignificant amount of memory was leaked as well. Obtained from: ElectroBSD --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c index 8700f4c..040a1c7 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c @@ -4127,6 +4127,8 @@ spa_import_rootpool(const char *name) &spa->spa_ubsync.ub_version) != 0) spa->spa_ubsync.ub_version = SPA_VERSION_INITIAL; } else if ((spa = spa_lookup(name)) == NULL) { + mutex_exit(&spa_namespace_lock); + nvlist_free(config); cmn_err(CE_NOTE, "Cannot find the pool label for '%s'", name); return (EIO); -- 2.3.0