]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - fs/nfsd/nfs4state.c
locks: give posix_test_lock same interface as ->lock
[mirror_ubuntu-artful-kernel.git] / fs / nfsd / nfs4state.c
index af360705e551afc5f9bf9954db7a2790aebca6cc..e42c7a0eb6facfd28fbf5acc16d903ebbda776b3 100644 (file)
@@ -2813,7 +2813,6 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
        struct inode *inode;
        struct file file;
        struct file_lock file_lock;
-       struct file_lock conflock;
        __be32 status;
 
        if (nfs4_in_grace())
@@ -2878,9 +2877,10 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
        file.f_path.dentry = cstate->current_fh.fh_dentry;
 
        status = nfs_ok;
-       if (posix_test_lock(&file, &file_lock, &conflock)) {
+       posix_test_lock(&file, &file_lock);
+       if (file_lock.fl_type != F_UNLCK) {
                status = nfserr_denied;
-               nfs4_set_lock_denied(&conflock, &lockt->lt_denied);
+               nfs4_set_lock_denied(&file_lock, &lockt->lt_denied);
        }
 out:
        nfs4_unlock_state();