When reading a vdev label skip libzfs_core_init()

There's no need to call libzfs_core_init() when `zdb -l` is used to
read a vdev label.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: tiehexue <tiehexue@hotmail.com>
Closes #18606
This commit is contained in:
tiehexue
2026-06-03 03:31:31 +08:00
committed by GitHub
parent bfe4a8bb9d
commit ef6f261454
+1 -1
View File
@@ -10230,7 +10230,7 @@ main(int argc, char **argv)
* Automate cachefile
*/
if (!spa_config_path_env && !config_path_console && target &&
libzfs_core_init() == 0) {
!dump_opt['l'] && libzfs_core_init() == 0) {
char *pname = strdup(target);
const char *value;
nvlist_t *pnvl = NULL;