summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-12-04 19:43:11 +0100
committerAdrian Bunk <bunk@stusta.de>2006-12-04 19:43:11 +0100
commit25e1dd8a73c6661c03104f53199b501be489888d (patch)
tree9bc8a9dfa3f09c1e84a2de832600a7c62313b2e1
parentba6c35f8887b3c483d8f63639f3959c163f05e72 (diff)
fcntl(F_SETSIG) fix
fcntl(F_SETSIG) no longer works on leases because lease_release_private_callback() gets called as the lease is copied in order to initialise it. The problem is that lease_alloc() performs an unnecessary initialisation, which sets the lease_manager_ops. Avoid the problem by allocating the target lease structure using locks_alloc_lock(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Adrian Bunk <bunk@stusta.de>
-rw-r--r--fs/locks.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/locks.c b/fs/locks.c
index 39b038bfd5cc..e414a86f9d5c 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1356,8 +1356,9 @@ static int __setlease(struct file *filp, long arg, struct file_lock **flp)
if (!leases_enable)
goto out;
- error = lease_alloc(filp, arg, &fl);
- if (error)
+ error = -ENOMEM;
+ fl = locks_alloc_lock();
+ if (fl == NULL)
goto out;
locks_copy_lock(fl, lease);
@@ -1365,6 +1366,7 @@ static int __setlease(struct file *filp, long arg, struct file_lock **flp)
locks_insert_lock(before, fl);
*flp = fl;
+ error = 0;
out:
return error;
}