lkml.org 
[lkml]   [2005]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: fcntl(F_GETLEASE) semantics??
From
Date
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_)

A read lease should mean that there are no writers at all.

If we were to allow the current process to open for write, then that
would still mean that nobody else can get a lease. In effect you have
been granted a lease with exclusive semantics (i.e. a write lease). You
might as well request that instead of pretending it is a read lease.

Cheers,
Trond

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-08-11 03:20    [W:0.101 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site