lkml.org 
[lkml]   [1999]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: RFC: Devices, buses and hotplug
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/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.046 / U:0.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site