Page MenuHomeFreeBSD

D14685.diff
No OneTemporary

D14685.diff

Index: head/sys/dev/md/md.c
===================================================================
--- head/sys/dev/md/md.c
+++ head/sys/dev/md/md.c
@@ -1750,13 +1750,24 @@
strlen(sc->file) + 1);
return (error);
case MDIOCLIST:
+ /*
+ * Write the number of md devices to mdio->md_pad[0].
+ * Write the unit number of the first (MDNPAD - 2) units
+ * to mdio->md_pad[1::(MDNPAD - 2)] and terminate the
+ * list with -1.
+ *
+ * XXX: There is currently no mechanism to retrieve unit
+ * numbers for more than (MDNPAD - 2) units.
+ *
+ * XXX: Due to the use of LIST_INSERT_HEAD in mdnew(), the
+ * list of visible unit numbers not stable.
+ */
i = 1;
LIST_FOREACH(sc, &md_softc_list, list) {
- if (i == MDNPAD - 1)
- mdio->md_pad[i] = -1;
- else
+ if (i < MDNPAD - 1)
mdio->md_pad[i++] = sc->unit;
}
+ mdio->md_pad[MIN(i, MDNPAD - 1)] = -1;
mdio->md_pad[0] = i - 1;
return (0);
default:

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 25, 11:43 AM (17 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32123285
Default Alt Text
D14685.diff (949 B)

Event Timeline