Linux-kernel mailing list archive 1999-23,: Re: RFC: Devices, buses and hotplug

# Re: RFC: Devices, buses and hotplug

Martin Mares (mj@atrey.karlin.mff.cuni.cz)
Mon, 7 Jun 1999 19:58:10 +0200

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Chuck Lever: "Re: 2.2.x instabilities"
- Previous message: Thierry Danis: "Re: NFS bug in 2.2.9-ac? found (was Re: Kernel Panic: 2.2.9-ac1)"

Hello,

> There are cases where doing it in user mode can provide information
> that isn't available to the low level drivers. For example, PCMCIA
> will refuse an eject request on a network device that has open
> connections or mounted NFS filesystems, but the low-level driver
> doesn't have access to this information. But I agree with you that
> the low level drivers should do as much checking as they can.

I'm not sure at all about refusing eject of network card when
there are open connections being the Right Way to do things.

> Why not have the soft_eject hook just do the checking, but no actual
> cleanup? If everything checks out, then the hard eject call executes
> cleanly, and that avoids the issue of leaving things in a half-baked
> state. In your case, the return value from soft_eject doesn't give as
> much useful information: a failure means that some things may have
> been shut down, or not.

I was considering the "just do checking" approach when writing my
previous mail, but then I realized that it would be racy -- you would
need to make sure that nobody tries to mount a device between check
of device being used and the actual eject. On the other side, it could
be reasonably simple to avoid such problems if we decide that the
checking function can never sleep and always holds the kernel lock.

Have a nice fortnight

    --
    Martin `MJ' Mares   <mj@ucw.cz>   http://atrey.karlin.mff.cuni.cz/~mj/
    Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
    "Error: Compiler unable to abort!"

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/

- Next message: Chuck Lever: "Re: 2.2.x instabilities"
- Previous message: Thierry Danis: "Re: NFS bug in 2.2.9-ac? found (was Re: Kernel Panic: 2.2.9-ac1)"