Page MenuHomeFreeBSD

D20501.id58317.diff
No OneTemporary

D20501.id58317.diff

Index: head/stand/common/disk.c
===================================================================
--- head/stand/common/disk.c
+++ head/stand/common/disk.c
@@ -263,8 +263,8 @@
slice = dev->d_slice;
partition = dev->d_partition;
- DPRINTF("%s unit %d, slice %d, partition %d => %p",
- disk_fmtdev(dev), dev->dd.d_unit, dev->d_slice, dev->d_partition, od);
+ DPRINTF("%s unit %d, slice %d, partition %d => %p", disk_fmtdev(dev),
+ dev->dd.d_unit, dev->d_slice, dev->d_partition, od);
/* Determine disk layout. */
od->table = ptable_open(&partdev, mediasize / sectorsize, sectorsize,
@@ -309,17 +309,25 @@
} else if (partition == D_PARTISGPT) {
/*
* When we try to open GPT partition, but partition
- * table isn't GPT, reset d_partition value to -1
- * and try to autodetect appropriate value.
+ * table isn't GPT, reset partition value to
+ * D_PARTWILD and try to autodetect appropriate value.
*/
- partition = -1;
+ partition = D_PARTWILD;
}
+
/*
- * If d_partition < 0 and we are looking at a BSD slice,
+ * If partition is D_PARTNONE, then disk_open() was called
+ * to open raw MBR slice.
+ */
+ if (partition == D_PARTNONE)
+ goto out;
+
+ /*
+ * If partition is D_PARTWILD and we are looking at a BSD slice,
* then try to read BSD label, otherwise return the
* whole MBR slice.
*/
- if (partition == -1 &&
+ if (partition == D_PARTWILD &&
part.type != PART_FREEBSD)
goto out;
/* Try to read BSD label */
@@ -331,7 +339,7 @@
goto out;
}
/*
- * If slice contains BSD label and d_partition < 0, then
+ * If slice contains BSD label and partition < 0, then
* assume the 'a' partition. Otherwise just return the
* whole MBR slice, because it can contain ZFS.
*/

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 13, 9:00 AM (13 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31307649
Default Alt Text
D20501.id58317.diff (1 KB)

Event Timeline