]> git.proxmox.com Git - mirror_zfs-debian.git/commit
Fix missing vdev names in zpool status output
authorNed Bass <bass6@llnl.gov>
Thu, 23 Sep 2010 01:53:59 +0000 (18:53 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 23 Sep 2010 19:14:06 +0000 (12:14 -0700)
commit858219cc4e44aea8373c56a94380f5be53026b38
tree8ad9174d44c0cc966a0b868373917a6cd84e964f
parent368f4c10aec9da58738750cf33de6d12e4fcb500
Fix missing vdev names in zpool status output

Top-level vdev names in zpool status output should follow a <type-id> naming
convention.  In the case of raidz devices, the type portion of the name was
missing.

This commit fixes a bug in zpool_vdev_name() where in this snprintf call

(void) snprintf(buf, sizeof (buf), "%s-%llu", path,
(u_longlong_t)id);

buf and path may point to the same location.  The result is that buf ends up
containing only the "-id" part.  This only occurred for raidz devices because
the code for appending the parity level to the type string stored its result in
buf then set path to point there.  To fix this we allocate a new temporary
buffer on the stack instead of reusing buf.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #57
lib/libzfs/libzfs_pool.c