lkml.org 
[lkml]   [2009]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: How to tell whether a struct file is held by a process?
From
On Fri, May 22, 2009 at 4:43 PM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
>> Suppose a device needs a reset as part of its init sequence (a whole lot
>> of them do, this is not purely hypothetical). Then a different process may
>> get to operate the device before and after the reset and hilarity may result
>> from that.
>
> Thats surely up to you to get your lock file usage right. The kernel
> isn't there to play mother to crap programming.

Who is "me" in this case? Assuming that those writing the userspace programs
are cooperative though, I agree. We can declare that whatever program does not
play by the (userspace locking) rules is crap and either fix it (if open source)
or refuse to install it / complain (if closed source).

>
>> So, if there is a clean / acceptable way to handle the reset issue in userspace
>
> Firstly can you explain *why* you think there is a problem ?
>

I admit this could be a bias from the way I imagined the whole thing
to work before
this discussion. I think I can see how a userspace locking scheme based on port
numbers could avoid also the reset problem.

Thanks,
Pantelis


\
 
 \ /
  Last update: 2009-05-22 15:55    [W:0.047 / U:1.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site