Page MenuHomeFreeBSD

kern_conf: fully initialize cloned devices with make_dev_args, too
ClosedPublic

Authored by kevans on Oct 5 2019, 12:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jan 26, 8:23 PM
Unknown Object (File)
Sat, Jan 25, 7:38 PM
Unknown Object (File)
Fri, Jan 24, 5:12 PM
Unknown Object (File)
Wed, Jan 22, 7:18 PM
Unknown Object (File)
Sat, Jan 18, 5:28 PM
Unknown Object (File)
Thu, Jan 9, 3:00 AM
Unknown Object (File)
Dec 12 2024, 8:45 PM
Unknown Object (File)
Nov 22 2024, 4:20 AM
Subscribers

Details

Summary

Attempting to initialize si_drv{1,2} with mda_si_drv{1,2} does not work if you are operating on cloned devices.

clone_create must be called prior to the make_dev* family to create/return the device on the clonelist as needed. This device is later returned early in newdev(), prior to si_drv{0,1,2} initialization.

This patch simply breaks out of the loop if we've found a non-(SI_CHEAPCLONE | SI_NAMED) device and finishes init. I'm not convinced SI_CHEAPCLONE needs to stick around from a brief poke around this stuff, but I've made sure we don't touch these devices if they are already initialized here.

Later check of !SI_NAMED in make_dev_sv could be removed now that newdev() should catch it earlier, but I've not done so.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib added inline comments.
sys/kern/kern_conf.c
586 ↗(On Diff #62930)

I do not believe we ever set the SI_CHEAPCLONE flag anywhere. It probably should be removed finally. Or at least new uses should not be added.

This revision is now accepted and ready to land.Oct 5 2019, 7:08 PM
sys/kern/kern_conf.c
586 ↗(On Diff #62930)

grep seemed to think that SI_CHEAPCLONE was effectively a read-only flag. I added it here because make_dev_sv expects that it can happen. Do you mind if I commit it with SI_CHEAPCLONE then subsequently rip out SI_CHEAPCLONE altogether?

I think it's a good idea to make sure we're honoring callers' expectations until we rip it out, in case any downstream projects use it (for what reason, I do not understand).

sys/kern/kern_conf.c
586 ↗(On Diff #62930)

Do not add it there. Remove in follow-up commit.

sys/kern/kern_conf.c
586 ↗(On Diff #62930)

Alrighty then.