Index: cddl/usr.sbin/zfsd/zfsd_event.cc =================================================================== --- cddl/usr.sbin/zfsd/zfsd_event.cc +++ cddl/usr.sbin/zfsd/zfsd_event.cc @@ -36,6 +36,7 @@ #include #include #include +#include #include @@ -93,6 +94,7 @@ pool_state_t poolState; char *poolName; boolean_t b_inuse; + int nlabels; inUse = false; degraded = false; @@ -105,8 +107,16 @@ if (poolName != NULL) free(poolName); - if (zpool_read_label(devFd, &devLabel) != 0 - || devLabel == NULL) + nlabels = zpool_read_all_labels(devFd, &devLabel); + /* + * If we find a disk with fewer than the maximum number of + * labels, it might be the whole disk of a partitioned disk + * where ZFS resides on a partition. In that case, we should do + * nothing and wait for the partition to appear. Or, the disk + * might be damaged. In that case, zfsd should do nothing and + * wait for the sysadmin to decide. + */ + if (nlabels != VDEV_LABELS || devLabel == NULL) return (NULL); try {