fcntl23 attempts to set a read lease
on a file which it opens read/write
fd = open(fname,O_RDWR|O_CREAT,0777)
and naturally receives -EAGAIN. The attached file
fixes it to open the file readonly.
Open file readonly to enable setting a read lease on it
Logged In: YES
This is working correctly. Here's a note regarding the bug
you may be encountering:
Re: Fw: [2.6.10-rc3:fs/locks.c] fcntl F_SETLEASE/[ F_WRLCK|
Linus Torvalds <firstname.lastname@example.org>
Tue, 7 Dec 2004 18:52:42 -0800 (PST)
Andrew Morton <email@example.com>
firstname.lastname@example.org, Ricky Ng-Adam
<email@example.com>, Matthew Wilcox
On Tue, 7 Dec 2004, Andrew Morton wrote:
Well, The "0" can definitely not be just changed to a "1"
i_writecount check, but maybe something like
int maxwrites = (file->f_mode & FMODE_WRITE) ? 1 : 0;
if (arg == F_RDLCK &&
atomic_read(&inode->i_writecount) > maxwrites)
Who uses F_SETLEASE? Just the samba/NFSv4 servers? It really
should be up
to those, unless there are other real users..