Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18946
b: refs/heads/master
c: a6f6ef2
h: refs/heads/master
v: v3
  • Loading branch information
Andy Adamson authored and Linus Torvalds committed Jan 19, 2006
1 parent 9f2024a commit 632c2ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 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: 1918e341383ab787d6c5b17200f4ed901b10c777
refs/heads/master: a6f6ef2f1d7329111fcad7db48fb7adba5062d0a
14 changes: 5 additions & 9 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -2700,6 +2700,11 @@ nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock
if (check_lock_length(lock->lk_offset, lock->lk_length))
return nfserr_inval;

if ((status = fh_verify(rqstp, current_fh, S_IFREG, MAY_LOCK))) {
dprintk("NFSD: nfsd4_lock: permission denied!\n");
return status;
}

nfs4_lock_state();

if (lock->lk_is_new) {
Expand Down Expand Up @@ -2757,11 +2762,6 @@ nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock
/* lock->lk_stateowner and lock_stp have been created or found */
filp = lock_stp->st_vfs_file;

if ((status = fh_verify(rqstp, current_fh, S_IFREG, MAY_LOCK))) {
dprintk("NFSD: nfsd4_lock: permission denied!\n");
goto out;
}

status = nfserr_grace;
if (nfs4_in_grace() && !lock->lk_reclaim)
goto out;
Expand Down Expand Up @@ -2802,8 +2802,6 @@ nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock
*/

status = posix_lock_file(filp, &file_lock);
if (file_lock.fl_ops && file_lock.fl_ops->fl_release_private)
file_lock.fl_ops->fl_release_private(&file_lock);
dprintk("NFSD: nfsd4_lock: posix_lock_file status %d\n",status);
switch (-status) {
case 0: /* success! */
Expand Down Expand Up @@ -2977,8 +2975,6 @@ nfsd4_locku(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock
* Try to unlock the file in the VFS.
*/
status = posix_lock_file(filp, &file_lock);
if (file_lock.fl_ops && file_lock.fl_ops->fl_release_private)
file_lock.fl_ops->fl_release_private(&file_lock);
if (status) {
dprintk("NFSD: nfs4_locku: posix_lock_file failed!\n");
goto out_nfserr;
Expand Down

0 comments on commit 632c2ca

Please sign in to comment.