Re: Why /dev/sdc1 doesn't show up...

Alexander Viro
2002-11-17T20:09:17Z

On Sun, 17 Nov 2002, Alexander Viro wrote:

> There is a purpose? Seriously, "no use of ones object during init" is
> WRONG. Rusty, remember I've told you that block devices need to be
> able to open() during init? That's what it is.
>
> We _might_ eventually kludge around that, but IMO the ->live checks on
> the init side are just plain wrong.

PS: logics in case of block devices is very simple: by the time when you
can handle open and IO on a disk, you are already set up - no point
bailing out after that point; if other disks served by the same driver
do not work, it means that they should be left out, not that driver
should fail init. IOW, logics of init, regardless of modular/nonmodular
makes that a point where you are past failure exits.

And I'd rather see similar rules for other interfaces. Yes, it might
require API changes - e.g. old block API was badly b0rken in that respect
since register_blkdev() allowed open() attempts, no matter whether you are
ready or not, so block drivers used to be seriously racy in that area.

Right way is "don't export an object until you are ready to serve it" and
once your API is of that sort, you are pretty much done. Note that non-modular
case _also_ need that sort of logics, simply because we might get userland
up and running before the initcalls are done.