subr_disk - don't show 0-size slices
authorAlex Hornung <ahornung@gmail.com>
Fri, 7 Aug 2009 20:23:41 +0000 (21:23 +0100)
committerAlex Hornung <ahornung@gmail.com>
Fri, 7 Aug 2009 20:26:06 +0000 (21:26 +0100)
When probing the disk, check for 0-size slices and avoid calling
make_dev for them.

Reported-By: Simon "corecode" Schubert
sys/kern/subr_disk.c

index 6447b26..c2fe1a0 100644 (file)
@@ -279,6 +279,9 @@ disk_probe(struct disk *dp, int reprobe)
 
                }
                for (i = BASE_SLICE; i < dp->d_slice->dss_nslices; i++) {
+                       if (dp->d_slice->dss_slices[i].ds_size == 0)
+                               continue;
+
                        if (reprobe &&
                                (ndev = devfs_find_device_by_name("%ss%d",
                                dev->si_name, i-1))) {