RESEND lease interfaces for version 4 NFSD
Subsystems (2)
PATCH 1/1 RESEND lease interfaces for version 4 NFSD
VFS: use the inode i_writecount to test for handing out a F_RDLCK lease.
Signed-off-by Andy Adamson <[email protected]>
---
linux-2.6.9-rc2-andros/fs/locks.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
fs/locks.c renamed from fs/locks.c~setlease-fixme +2 -3
@@ -1278,10 +1278,9 @@ int __setlease(struct file *filp, long aif (!flp || !(*flp) || !(*flp)->fl_lmops || !(*flp)->fl_lmops->fl_break) goto out; -/* -* FIXME: What about F_RDLCK and files open for writing? -*/ error = -EAGAIN ; +if ((arg ==F_RDLCK ) && (atomic_read (&inode->i_writecount) >0 )) + goto out;if ((arg ==F_WRLCK ) && ((atomic_read (&dentry->d_count) >1 ) || (atomic_read (&inode->i_count) >1 )))
_