Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106033
b: refs/heads/master
c: cc77b15
h: refs/heads/master
i:
  106031: 732772b
v: v3
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Jul 25, 2008
1 parent 8a88e14 commit 2a7de6b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 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: b81f3ea92ba1fa676775677679889dc2a7f03c8b
refs/heads/master: cc77b1521d06be07c9bb1a4a3e1f775dcaa15093
10 changes: 9 additions & 1 deletion trunk/fs/lockd/clntproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,15 @@ nlmclnt_lock(struct nlm_rqst *req, struct file_lock *fl)
}
if (status < 0)
goto out_unlock;
status = nlm_stat_to_errno(resp->status);
/*
* EAGAIN doesn't make sense for sleeping locks, and in some
* cases NLM_LCK_DENIED is returned for a permanent error. So
* turn it into an ENOLCK.
*/
if (resp->status == nlm_lck_denied && (fl_flags & FL_SLEEP))
status = -ENOLCK;
else
status = nlm_stat_to_errno(resp->status);
out_unblock:
nlmclnt_finish_block(block);
out:
Expand Down
13 changes: 9 additions & 4 deletions trunk/fs/nfsd/lockd.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@

#define NFSDDBG_FACILITY NFSDDBG_LOCKD

#ifdef CONFIG_LOCKD_V4
#define nlm_stale_fh nlm4_stale_fh
#define nlm_failed nlm4_failed
#else
#define nlm_stale_fh nlm_lck_denied_nolocks
#define nlm_failed nlm_lck_denied_nolocks
#endif
/*
* Note: we hold the dentry use count while the file is open.
*/
Expand Down Expand Up @@ -47,12 +54,10 @@ nlm_fopen(struct svc_rqst *rqstp, struct nfs_fh *f, struct file **filp)
return 0;
case nfserr_dropit:
return nlm_drop_reply;
#ifdef CONFIG_LOCKD_V4
case nfserr_stale:
return nlm4_stale_fh;
#endif
return nlm_stale_fh;
default:
return nlm_lck_denied;
return nlm_failed;
}
}

Expand Down

0 comments on commit 2a7de6b

Please sign in to comment.