HomeFreeBSD

Fix missing vdev names in zpool status output

Description

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

Details

Provenance
Ned Bass <bass6@llnl.gov>Authored on Sep 23 2010, 1:53 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Sep 23 2010, 7:14 PM
Parents
rG368f4c10aec9: Export ZFS symbols needed by Lustre.
Branches
Unknown
Tags
Unknown