linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: ams@gnu.org
Cc: Jeff Layton <jlayton@redhat.com>,
	"libc-alpha@sourceware.org" <libc-alpha@sourceware.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	"Theodore Ts'o" <tytso@mit.edu>, Rich Felker <dalias@libc.org>,
	samba-technical@lists.samba.org,
	Ganesha NFS List <nfs-ganesha-devel@lists.sourceforge.net>,
	"Carlos O'Donell" <carlos@redhat.com>,
	"Stefan (metze) Metzmacher" <metze@samba.org>,
	Christoph Hellwig <hch@infradead.org>,
	Boaz Harrosh <bharrosh@panasas.com>
Subject: Re: [RFC][glibc PATCH] fcntl-linux.h: add new definitions and manual updates for open file description locks
Date: Wed, 23 Apr 2014 21:13:03 +0200	[thread overview]
Message-ID: <CAKgNAkju-vzgJ=p568ksLy7L63qo_3tHxf_tzNZrDgGoD_vNUA@mail.gmail.com> (raw)
In-Reply-To: <E1Wd2Os-00061e-GU@fencepost.gnu.org>

On Wed, Apr 23, 2014 at 9:00 PM, Alfred M. Szmidt <ams@gnu.org> wrote:
>    > Likewise.  You infact write that it does get the lock information
>    > later in the document wrt. F_OFD_GETLK.
>
>    Sorry, I disagree here...GETLK is really a misnomer, IMO. TESTLK
>    would have been a better name.

I'm inclined to agree.

>    GETLK are used is to "get the first lock".
>
>    It's a way to test whether a particular lock can be applied, and to
>    return information about a conflicting lock if it can't. If, for
>    instance there is no conflicting lock, then you don't "get" any
>    lock information back (l_type just gets reset to F_UNLCK).
>
> While I kinda see your point, it isn't what GETLK does; it really does
> get you information about the first lock -- you're not testing
> anything.  It is also the terminology used in the POSIX standard.

The POSIX wording is a little confused. For example, what does "first"
mean in this context? F_GETLK returns information about one
(arbitrarily selected) lock that blocks a lock you would like to
place. So, I'm inclined to agree with Jeff -- this really is a "test"
(or "can I lock it") operation.

Of course, the operation has no reliable use: by the time it returns
the information might already be out of date. I suspect that it was
designed to solve the problem: "My F_GETLK operation failed. Who's
blocking me?"

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

  reply	other threads:[~2014-04-23 19:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-23 11:39 [RFC][glibc PATCH] fcntl-linux.h: add new definitions and manual updates for open file description locks Jeff Layton
2014-04-23 12:37 ` Michael Kerrisk (man-pages)
2014-04-23 15:09 ` Alfred M. Szmidt
2014-04-23 15:28   ` Jeff Layton
2014-04-23 19:00     ` Alfred M. Szmidt
2014-04-23 19:13       ` Michael Kerrisk (man-pages) [this message]
2014-04-23 19:23       ` Jeff Layton

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='CAKgNAkju-vzgJ=p568ksLy7L63qo_3tHxf_tzNZrDgGoD_vNUA@mail.gmail.com' \
    --to=mtk.manpages@gmail.com \
    --cc=ams@gnu.org \
    --cc=bharrosh@panasas.com \
    --cc=carlos@redhat.com \
    --cc=dalias@libc.org \
    --cc=hch@infradead.org \
    --cc=jlayton@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=metze@samba.org \
    --cc=nfs-ganesha-devel@lists.sourceforge.net \
    --cc=samba-technical@lists.samba.org \
    --cc=tytso@mit.edu \
    /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;
as well as URLs for NNTP newsgroup(s).