lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 23 Apr 2014 21:13:03 +0200
From:	"Michael Kerrisk (man-pages)" <mtk.manpages@...il.com>
To:	ams@....org
Cc:	Jeff Layton <jlayton@...hat.com>,
	"libc-alpha@...rceware.org" <libc-alpha@...rceware.org>,
	"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
	lkml <linux-kernel@...r.kernel.org>,
	"Theodore Ts'o" <tytso@....edu>, Rich Felker <dalias@...c.org>,
	samba-technical@...ts.samba.org,
	Ganesha NFS List <nfs-ganesha-devel@...ts.sourceforge.net>,
	"Carlos O'Donell" <carlos@...hat.com>,
	"Stefan (metze) Metzmacher" <metze@...ba.org>,
	Christoph Hellwig <hch@...radead.org>,
	Boaz Harrosh <bharrosh@...asas.com>
Subject: Re: [RFC][glibc PATCH] fcntl-linux.h: add new definitions and manual
 updates for open file description locks

On Wed, Apr 23, 2014 at 9:00 PM, Alfred M. Szmidt <ams@....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/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ