mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Michael Kerrisk" <mtk-lkml@gmx.net>
To: Peter Chubb <peterc@gelato.unsw.edu.au>
Cc: trond.myklebust@fys.uio.no, peterc@gelato.unsw.edu.au,
	linux-kernel@vger.kernel.org, sfr@canb.auug.org.au,
	michael.kerrisk@gmx.net
Subject: Re: fcntl(F GETLEASE) semantics??
Date: Thu, 11 Aug 2005 10:14:15 +0200 (MEST)	[thread overview]
Message-ID: <19888.1123748055@www44.gmx.net> (raw)
In-Reply-To: <17146.43490.8672.13906@wombat.chubb.wattle.id.au>

> Von: Peter Chubb <peterc@gelato.unsw.edu.au>
> 
> >>>>> "Trond" == Trond Myklebust <trond.myklebust@fys.uio.no> writes:
> 
> Trond> to den 11.08.2005 Klokka 09:48 (+1000) skreiv Peter Chubb:
> >> Hi, The LTP test fcntl23 is failing.  It does, in essence, fd =
> >> open(xxx, O_RDWR|O_CREAT, 0777); if (fcntl(fd, F_SETLEASE, F_RDLCK)
> >> == -1) fail;
> >> 
> >> fcntl always returns EAGAIN here.  The manual page says that a read
> >> lease causes notification when `another process' opens the file for
> >> writing or truncates it.  The kernel implements `any process'
> >> (including the current one).
> >> 
> >> Which semantics are correct?  Personally I think that what the
> >> kernel implements is correct (you can't get a read lease unsless
> >> there are no writers _at_ _all_)
> 
> Trond> A read lease should mean that there are no writers at all.
> 
> Trond> If we were to allow the current process to open for write, then
> Trond> that would still mean that nobody else can get a lease. In
> Trond> effect you have been granted a lease with exclusive semantics
> Trond> (i.e. a write lease). You might as well request that instead of
> Trond> pretending it is a read lease.
> 
> So the manual page is wrong.  Fine.

No.  The behavior in Linux recently, and arbitrarily (IMO) changed:

http://marc.theaimsgroup.com/?l=linux-kernel&m=111502547506310&w=2
http://marc.theaimsgroup.com/?l=linux-kernel&m=111755426027086&w=2

One of the developers of the file leases mechanism seems to have 
agreed that this change should not have occurred:

http://marc.theaimsgroup.com/?l=linux-kernel&m=111512619520116&w=2

but the suggested patch did not (yet) make its way into the kernel.

Stephen -- what is your take on this now?

Cheers,

Michael

-- 
GMX DSL = Maximale Leistung zum minimalen Preis!
2000 MB nur 2,99, Flatrate ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl

  reply	other threads:[~2005-08-11  8:14 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-10 23:48 fcntl(F_GETLEASE) semantics?? Peter Chubb
2005-08-11  1:14 ` Trond Myklebust
2005-08-11  1:29   ` Peter Chubb
2005-08-11  8:14     ` Michael Kerrisk [this message]
2005-08-11 11:51       ` fcntl(F GETLEASE) semantics?? Trond Myklebust
2005-08-11 12:27         ` Michael Kerrisk
2005-08-11 12:49           ` Trond Myklebust
2005-08-11 13:22             ` Michael Kerrisk
2005-08-11 14:06               ` Trond Myklebust
2005-08-11 14:12                 ` Trond Myklebust
2005-08-11 14:20                 ` J. Bruce Fields
2005-08-11 14:42                   ` Michael Kerrisk
2005-08-11 14:40                 ` Michael Kerrisk
2005-08-11 15:06                   ` Trond Myklebust
2005-08-11 15:25                     ` Trond Myklebust
2005-08-11 14:10               ` Stephen Rothwell
2005-08-11 18:41 ` fcntl(F_GETLEASE) semantics?? Heikki Orsila
2005-08-11 18:56   ` Trond Myklebust
2005-08-11 19:02     ` Heikki Orsila
2005-08-11 19:15       ` Trond Myklebust
2005-08-11 19:23         ` Heikki Orsila
2005-08-11 19:31           ` Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19888.1123748055@www44.gmx.net \
    --to=mtk-lkml@gmx.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.kerrisk@gmx.net \
    --cc=peterc@gelato.unsw.edu.au \
    --cc=sfr@canb.auug.org.au \
    --cc=trond.myklebust@fys.uio.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®