Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153877990
D14685.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
949 B
Referenced Files
None
Subscribers
None
D14685.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D14685: Don't overflow the kernel struct mdio in the MDIOCLIST ioctl.
Attached
Detach File
Event Timeline
Log In to Comment