Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38385
b: refs/heads/master
c: 39be450
h: refs/heads/master
i:
  38383: 58a1178
v: v3
  • Loading branch information
Olaf Kirch authored and Linus Torvalds committed Oct 4, 2006
1 parent 319b9f0 commit 996250b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 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: 031d869d0e0be18cfe35526be5608225b8f0a7be
refs/heads/master: 39be4502cb75dc26007fe1659735b26c8e63fcc6
2 changes: 1 addition & 1 deletion trunk/fs/lockd/svc4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ nlm4svc_proc_granted_res(struct svc_rqst *rqstp, struct nlm_res *argp,

dprintk("lockd: GRANTED_RES called\n");

nlmsvc_grant_reply(rqstp, &argp->cookie, argp->status);
nlmsvc_grant_reply(&argp->cookie, argp->status);
return rpc_success;
}

Expand Down
24 changes: 13 additions & 11 deletions trunk/fs/lockd/svclock.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,19 @@ static inline int nlm_cookie_match(struct nlm_cookie *a, struct nlm_cookie *b)
* Find a block with a given NLM cookie.
*/
static inline struct nlm_block *
nlmsvc_find_block(struct nlm_cookie *cookie, struct sockaddr_in *sin)
nlmsvc_find_block(struct nlm_cookie *cookie)
{
struct nlm_block *block;

list_for_each_entry(block, &nlm_blocked, b_list) {
if (nlm_cookie_match(&block->b_call->a_args.cookie,cookie)
&& nlm_cmp_addr(sin, &block->b_host->h_addr))
if (nlm_cookie_match(&block->b_call->a_args.cookie,cookie))
goto found;
}

return NULL;

found:
dprintk("nlmsvc_find_block(%s): block=%p\n", nlmdbg_cookie2a(cookie), block);
kref_get(&block->b_count);
return block;
}
Expand All @@ -165,6 +165,11 @@ nlmsvc_find_block(struct nlm_cookie *cookie, struct sockaddr_in *sin)
* request, but (as I found out later) that's because some implementations
* do just this. Never mind the standards comittees, they support our
* logging industries.
*
* 10 years later: I hope we can safely ignore these old and broken
* clients by now. Let's fix this so we can uniquely identify an incoming
* GRANTED_RES message by cookie, without having to rely on the client's IP
* address. --okir
*/
static inline struct nlm_block *
nlmsvc_create_block(struct svc_rqst *rqstp, struct nlm_file *file,
Expand Down Expand Up @@ -197,7 +202,7 @@ nlmsvc_create_block(struct svc_rqst *rqstp, struct nlm_file *file,
/* Set notifier function for VFS, and init args */
call->a_args.lock.fl.fl_flags |= FL_SLEEP;
call->a_args.lock.fl.fl_lmops = &nlmsvc_lock_operations;
call->a_args.cookie = *cookie; /* see above */
nlmclnt_next_cookie(&call->a_args.cookie);

dprintk("lockd: created block %p...\n", block);

Expand Down Expand Up @@ -640,17 +645,14 @@ static const struct rpc_call_ops nlmsvc_grant_ops = {
* block.
*/
void
nlmsvc_grant_reply(struct svc_rqst *rqstp, struct nlm_cookie *cookie, u32 status)
nlmsvc_grant_reply(struct nlm_cookie *cookie, u32 status)
{
struct nlm_block *block;
struct nlm_file *file;

dprintk("grant_reply: looking for cookie %x, host (%08x), s=%d \n",
*(unsigned int *)(cookie->data),
ntohl(rqstp->rq_addr.sin_addr.s_addr), status);
if (!(block = nlmsvc_find_block(cookie, &rqstp->rq_addr)))
dprintk("grant_reply: looking for cookie %x, s=%d \n",
*(unsigned int *)(cookie->data), status);
if (!(block = nlmsvc_find_block(cookie)))
return;
file = block->b_file;

if (block) {
if (status == NLM_LCK_DENIED_GRACE_PERIOD) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/lockd/svcproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ nlmsvc_proc_granted_res(struct svc_rqst *rqstp, struct nlm_res *argp,

dprintk("lockd: GRANTED_RES called\n");

nlmsvc_grant_reply(rqstp, &argp->cookie, argp->status);
nlmsvc_grant_reply(&argp->cookie, argp->status);
return rpc_success;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/lockd/lockd.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ u32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *);
unsigned long nlmsvc_retry_blocked(void);
void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *,
nlm_host_match_fn_t match);
void nlmsvc_grant_reply(struct svc_rqst *, struct nlm_cookie *, u32);
void nlmsvc_grant_reply(struct nlm_cookie *, u32);

/*
* File handling for the server personality
Expand Down

0 comments on commit 996250b

Please sign in to comment.