Re: fcntl: F_SETLEASE/F_RDLCK question

From: Michael Kerrisk
Date: Tue May 03 2005 - 09:55:37 EST


> > On Tue, May 03, 2005 at 09:55:42AM -0400, William A.(Andy) Adamson
> > wrote:
> > > i believe the current implementation is correct. opening a file for
> > > write
> > > means that you can not have a read lease, caller included.
> >
> > Why not? Certainly, others will not be able to take out a read lease,
> > so there's very little point to only having a read lease, but I don't
> > see why we should deny it.
> >
>
> by definition: a read lease means there are no writers. so, the question
> is
> not 'why not', the question is why? why hand out a read lease to an open
> for write?

Andy,

Look more closely at my earlier table.

Regardless of what the answer to your question is, the
current semantics are bizarre. As things stand, a process
can open a file O_RDWR, and and can place a WRITE lease
but not a READ lease. That can't be right.

FWIW it's worth, I think the read lease should be allowed.
Oplocks are concerned with what other processes are doing,
not what the caller is doing. Also, the current semantcis
break backward compatibility.

Cheers,

Michael

--
+++ Neu: Echte DSL-Flatrates von GMX - Surfen ohne Limits +++
Always online ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/