Skip to content

Commit

Permalink
[PATCH] fcntl(F_SETSIG) fix
Browse files Browse the repository at this point in the history
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: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Trond Myklebust authored and Greg Kroah-Hartman committed Aug 14, 2006
1 parent 1d7ea73 commit 74361cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/locks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1421,15 +1421,17 @@ 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);

locks_insert_lock(before, fl);

*flp = fl;
error = 0;
out:
return error;
}
Expand Down

0 comments on commit 74361cb

Please sign in to comment.