Linux-kernel mailing list archive 2000-40,: Re: [RFC] Imminent death of /proc/locks predicted; film at 11

# Re: [RFC] Imminent death of /proc/locks predicted; film at 11

Matthew Wilcox (matthew@wil.cx)
Sun, 1 Oct 2000 02:43:08 +0100

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Sandy Harris: "SA_INTERRUPT"
- Previous message: Andries Brouwer: "breada bug"

On Sat, Sep 30, 2000 at 08:23:37PM -0500, Peter Samuelson wrote:
>
> [Matthew Wilcox]
> > if fcntl took a 4th argument specifying the length of the buffer, i'd
> > recommend a F_GETLKS fcntl. a horrid work around for this would be
> > that the first 4 bytes of the buffer pointed to by the third argument
> > of the fcntl is the length of the buffer.
>
> Ewwww! You're right, it's horrid. Anyway, I think this one can be
> solved in userspace -- as long as you don't need atomicity. Untested
> code with no error checking:

thanks for snipping the part of my email where i explain this won't work.
examples:

process 1 locks bytes 1 to 7 nonexclusively
process 2 locks bytes 2 to 5 nonexclusively

you now can't see the second lock.

and there's no way of seeing the blocked lock. This needs kernel support
some how.

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

- Next message: Sandy Harris: "SA_INTERRUPT"
- Previous message: Andries Brouwer: "breada bug"