]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/lockd/svclock.c
locks: Copy fl_lmops information for conflock in locks_copy_conflock()
[mirror_ubuntu-bionic-kernel.git] / fs / lockd / svclock.c
index ab798a88ec1d52347afe05d4b8ed2eff13151de1..acfa94d5b48967ec21f55e52132df850c15ff6bc 100644 (file)
@@ -586,6 +586,7 @@ conf_lock:
        conflock->fl.fl_type = lock->fl.fl_type;
        conflock->fl.fl_start = lock->fl.fl_start;
        conflock->fl.fl_end = lock->fl.fl_end;
+       locks_release_private(&lock->fl);
        ret = nlm_lck_denied;
 out:
        if (block)
@@ -667,22 +668,16 @@ nlmsvc_cancel_blocked(struct net *net, struct nlm_file *file, struct nlm_lock *l
  * deferred rpc for GETLK and SETLK.
  */
 static void
-nlmsvc_update_deferred_block(struct nlm_block *block, struct file_lock *conf,
-                            int result)
+nlmsvc_update_deferred_block(struct nlm_block *block, int result)
 {
        block->b_flags |= B_GOT_CALLBACK;
        if (result == 0)
                block->b_granted = 1;
        else
                block->b_flags |= B_TIMED_OUT;
-       if (conf) {
-               if (block->b_fl)
-                       __locks_copy_lock(block->b_fl, conf);
-       }
 }
 
-static int nlmsvc_grant_deferred(struct file_lock *fl, struct file_lock *conf,
-                                       int result)
+static int nlmsvc_grant_deferred(struct file_lock *fl, int result)
 {
        struct nlm_block *block;
        int rc = -ENOENT;
@@ -697,7 +692,7 @@ static int nlmsvc_grant_deferred(struct file_lock *fl, struct file_lock *conf,
                                        rc = -ENOLCK;
                                        break;
                                }
-                               nlmsvc_update_deferred_block(block, conf, result);
+                               nlmsvc_update_deferred_block(block, result);
                        } else if (result == 0)
                                block->b_granted = 1;