Skip to content

Commit bfa46f6

Browse files
openzfs#15972: Added fix for zpool get segfaults with two or more vdevs.
Signed-off-by: Syed Shahrukh Hussain <[email protected]>
1 parent 7be9fa2 commit bfa46f6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cmd/zpool/zpool_main.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12747,11 +12747,13 @@ zpool_do_get(int argc, char **argv)
1274712747

1274812748
if (strcmp(argv[1], "root") == 0)
1274912749
vdev = strdup("root-0");
12750-
else
12751-
vdev = strdup(argv[1]);
1275212750

1275312751
/* ... and the rest are vdev names */
12754-
cb.cb_vdevs.cb_names = &vdev;
12752+
if (vdev == NULL)
12753+
cb.cb_vdevs.cb_names = argv + 1;
12754+
else
12755+
cb.cb_vdevs.cb_names = &vdev;
12756+
1275512757
cb.cb_vdevs.cb_names_count = argc - 1;
1275612758
cb.cb_type = ZFS_TYPE_VDEV;
1275712759
argc = 1; /* One pool to process */

0 commit comments

Comments
 (0)