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 <[email protected]>
Signed-off-by: tiehexue <[email protected]>
Closes #18606
This commit is contained in:
tiehexue authored and GitHub committed 2026-06-02 12:31:31 -07:00
1 parent bfe4a8bb9d
commit ef6f261454
1 file changed
+1 -1
+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;