OpenSolaris

Printable Version Enter a New Search
Bug ID 6617720
Synopsis zpool_label_disk() doesn't correctly indicate failure
State 10-Fix Delivered (Fix available in build)
Category:Subcategory utility:zfs
Keywords oss-request
Sponsor
Submitter
Responsible Engineer Mark Musante
Reported Against
Duplicate Of
Introduced In solaris_nevada
Commit to Fix snv_87
Fixed In snv_87
Release Fixed solaris_nevada(snv_87) , solaris_10u6(s10u6_03) (Bug ID:2161985)
Related Bugs
Submit Date 16-October-2007
Last Update Date 9-April-2008
Description
In zpool_label_disks(), we have:

int
zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, char *name)
{
        char path[MAXPATHLEN];
        struct dk_gpt *vtoc;
        int fd;
        size_t resv = EFI_MIN_RESV_SIZE;
        uint64_t slice_size;
        diskaddr_t start_block;
        char errbuf[1024];

	...

        if ((fd = open(path, O_RDWR | O_NDELAY)) < 0) {
                /*
                 * This shouldn't happen.  We've long since verified that this
                 * is a valid device.
                 */
                zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "cannot "
                    "label '%s': unable to open device"), name);
                return (zfs_error(hdl, EZFS_OPENFAILED, errbuf));
        }

	...

First off, 'errbuf' is used without being initialized.  Second of all,
the error message is supposed to be split into action, errno, and 
description.  So "cannot label '%s'" should be the argument to
zfs_error(), and "unable to open device" should be the aux string (the
description).
Work Around
N/A
Comments
N/A