locks,lockd: fix race in nlmsvc_testlock
[safe/jmp/linux-2.6] / fs / nfs / file.c
index 1cf07e4..ee140c5 100644 (file)
@@ -392,15 +392,14 @@ out_swapfile:
 
 static int do_getlk(struct file *filp, int cmd, struct file_lock *fl)
 {
-       struct file_lock *cfl;
+       struct file_lock cfl;
        struct inode *inode = filp->f_mapping->host;
        int status = 0;
 
        lock_kernel();
        /* Try local locking first */
-       cfl = posix_test_lock(filp, fl);
-       if (cfl != NULL) {
-               locks_copy_lock(fl, cfl);
+       if (posix_test_lock(filp, fl, &cfl)) {
+               locks_copy_lock(fl, &cfl);
                goto out;
        }