mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Michael Kerrisk <mtk-lkml@gmx.net>
Cc: peterc@gelato.unsw.edu.au, linux-kernel@vger.kernel.org,
	sfr@canb.auug.org.au, matthew@wil.cx, michael.kerrisk@gmx.net
Subject: Re: fcntl(F GETLEASE) semantics??
Date: Thu, 11 Aug 2005 11:06:41 -0400	[thread overview]
Message-ID: <1123772802.8251.123.camel@lade.trondhjem.org> (raw)
In-Reply-To: <23689.1123771230@www9.gmx.net>

to den 11.08.2005 Klokka 16:40 (+0200) skreiv Michael Kerrisk:
> I think my metapoint really is this: there has never been a 
> clearly documented statement of how File Leases are supposed 
> to behave on Linux.  There is just some code... how is one 
> supposed to know what it _should_ do?  (The manual page text 
> was my attempt to discover the details, after the fact.)
> 
> Can you provide an explanation of how file leases should 
> behave?  That is, a tabulation of the expected behavious 
> for the possible cimbinations of
> 
> [lease type] X 
> [open() access-mode employed file placing lease] X
> [open() access-mode employed by other process(es)]

The only document that I have is RFC3530 (the NFSv4 spec) which doesn't
really define file leases, but does define the caching protocol that
they act as support for.
In principle it is supposed to be the same protocol that CIFS uses
(although CIFS doesn't really have much in the form of documentation
that we can use to verify that fact).

To me, the NFSv4 requirements suggest:

     open()  |  lease requested    | effect on existing leases |
      flag   | F_RDLCK  | F_WRLCK  | F_RDLCK  | F_WRLCK        |
    ---------+----------+----------+---------------------------+
    O_RDONLY | okay     |  okay    |  none    |  recall        |
    O_WRONLY | EAGAIN   |  okay    |  recall  |  recall        |
    O_RDWR   | EAGAIN   |  okay    |  recall  |  recall        |

-----
 fcntl(SETLK)| effect on existing leases |
     flag    | F_RDLCK   | F_WRLCK       |
    ---------+---------------------------+
     F_RDLCK | none      | none          |
     F_WRLCK | recall    | none          |

-----
Other operation that should recall leases (both types!) are

unlink(), link(), f/l/chown(), f/chmod(), rename(), setfacl().

truncate() and utime() calls by another process.

-----
Finally, operations that should recall read leases only:

truncate() and utime() calls by your process.
-----

Cheers,
  Trond


  reply	other threads:[~2005-08-11 15:07 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     ` fcntl(F GETLEASE) semantics?? Michael Kerrisk
2005-08-11 11:51       ` 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 [this message]
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=1123772802.8251.123.camel@lade.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=michael.kerrisk@gmx.net \
    --cc=mtk-lkml@gmx.net \
    --cc=peterc@gelato.unsw.edu.au \
    --cc=sfr@canb.auug.org.au \
    /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®