Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.
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 <email@example.com>
Tue, 7 Dec 2004 18:52:42 -0800 (PST)
Andrew Morton <firstname.lastname@example.org>
email@example.com, Ricky Ng-Adam
<firstname.lastname@example.org>, 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..