Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54491
b: refs/heads/master
c: fd85b81
h: refs/heads/master
i:
  54489: c7d123f
  54487: 37870a2
v: v3
  • Loading branch information
Marc Eshel authored and J. Bruce Fields committed May 7, 2007
1 parent 7e0b7d5 commit 94e58f4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9b9d2ab4154a42ea4a119f7d3e4e0288bfe0bb79
refs/heads/master: fd85b8170dabbf021987875ef7f903791f4f181e
20 changes: 13 additions & 7 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include <linux/nfsd/xdr4.h>
#include <linux/namei.h>
#include <linux/mutex.h>
#include <linux/lockd/bind.h>

#define NFSDDBG_FACILITY NFSDDBG_PROC

Expand Down Expand Up @@ -2773,7 +2774,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
/* XXX?: Just to divert the locks_release_private at the start of
* locks_copy_lock: */
locks_init_lock(&conflock);
err = posix_lock_file(filp, &file_lock, &conflock);
err = vfs_lock_file(filp, cmd, &file_lock, &conflock);
switch (-err) {
case 0: /* success! */
update_stateid(&lock_stp->st_stateid);
Expand All @@ -2790,7 +2791,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
status = nfserr_deadlock;
break;
default:
dprintk("NFSD: nfsd4_lock: posix_lock_file_conf() failed! status %d\n",err);
dprintk("NFSD: nfsd4_lock: vfs_lock_file() failed! status %d\n",err);
status = nfserr_resource;
break;
}
Expand All @@ -2815,6 +2816,7 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
struct inode *inode;
struct file file;
struct file_lock file_lock;
int error;
__be32 status;

if (nfs4_in_grace())
Expand Down Expand Up @@ -2870,16 +2872,20 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,

nfs4_transform_lock_offset(&file_lock);

/* posix_test_lock uses the struct file _only_ to resolve the inode.
/* vfs_test_lock uses the struct file _only_ to resolve the inode.
* since LOCKT doesn't require an OPEN, and therefore a struct
* file may not exist, pass posix_test_lock a struct file with
* file may not exist, pass vfs_test_lock a struct file with
* only the dentry:inode set.
*/
memset(&file, 0, sizeof (struct file));
file.f_path.dentry = cstate->current_fh.fh_dentry;

status = nfs_ok;
posix_test_lock(&file, &file_lock);
error = vfs_test_lock(&file, &file_lock);
if (error) {
status = nfserrno(error);
goto out;
}
if (file_lock.fl_type != F_UNLCK) {
status = nfserr_denied;
nfs4_set_lock_denied(&file_lock, &lockt->lt_denied);
Expand Down Expand Up @@ -2935,9 +2941,9 @@ nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
/*
* Try to unlock the file in the VFS.
*/
err = posix_lock_file(filp, &file_lock, NULL);
err = vfs_lock_file(filp, F_SETLK, &file_lock, NULL);
if (err) {
dprintk("NFSD: nfs4_locku: posix_lock_file failed!\n");
dprintk("NFSD: nfs4_locku: vfs_lock_file failed!\n");
goto out_nfserr;
}
/*
Expand Down

0 comments on commit 94e58f4

Please sign in to comment.