aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/lockd/host.c10
-rw-r--r--fs/lockd/svclock.c28
-rw-r--r--include/linux/sunrpc/svc.h13
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma_sendto.c3
4 files changed, 40 insertions, 14 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index ca6b16fc3101..f1ef49fff118 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -243,10 +243,18 @@ nlm_bind_host(struct nlm_host *host)
243 .program = &nlm_program, 243 .program = &nlm_program,
244 .version = host->h_version, 244 .version = host->h_version,
245 .authflavor = RPC_AUTH_UNIX, 245 .authflavor = RPC_AUTH_UNIX,
246 .flags = (RPC_CLNT_CREATE_HARDRTRY | 246 .flags = (RPC_CLNT_CREATE_NOPING |
247 RPC_CLNT_CREATE_AUTOBIND), 247 RPC_CLNT_CREATE_AUTOBIND),
248 }; 248 };
249 249
250 /*
251 * lockd retries server side blocks automatically so we want
252 * those to be soft RPC calls. Client side calls need to be
253 * hard RPC tasks.
254 */
255 if (!host->h_server)
256 args.flags |= RPC_CLNT_CREATE_HARDRTRY;
257
250 clnt = rpc_create(&args); 258 clnt = rpc_create(&args);
251 if (!IS_ERR(clnt)) 259 if (!IS_ERR(clnt))
252 host->h_rpcclnt = clnt; 260 host->h_rpcclnt = clnt;
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index 2f4d8fa66689..fe9bdb4a220c 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -763,11 +763,20 @@ callback:
763 dprintk("lockd: GRANTing blocked lock.\n"); 763 dprintk("lockd: GRANTing blocked lock.\n");
764 block->b_granted = 1; 764 block->b_granted = 1;
765 765
766 /* Schedule next grant callback in 30 seconds */ 766 /* keep block on the list, but don't reattempt until the RPC
767 nlmsvc_insert_block(block, 30 * HZ); 767 * completes or the submission fails
768 */
769 nlmsvc_insert_block(block, NLM_NEVER);
770
771 /* Call the client -- use a soft RPC task since nlmsvc_retry_blocked
772 * will queue up a new one if this one times out
773 */
774 error = nlm_async_call(block->b_call, NLMPROC_GRANTED_MSG,
775 &nlmsvc_grant_ops);
768 776
769 /* Call the client */ 777 /* RPC submission failed, wait a bit and retry */
770 nlm_async_call(block->b_call, NLMPROC_GRANTED_MSG, &nlmsvc_grant_ops); 778 if (error < 0)
779 nlmsvc_insert_block(block, 10 * HZ);
771} 780}
772 781
773/* 782/*
@@ -786,6 +795,17 @@ static void nlmsvc_grant_callback(struct rpc_task *task, void *data)
786 795
787 dprintk("lockd: GRANT_MSG RPC callback\n"); 796 dprintk("lockd: GRANT_MSG RPC callback\n");
788 797
798 /* if the block is not on a list at this point then it has
799 * been invalidated. Don't try to requeue it.
800 *
801 * FIXME: it's possible that the block is removed from the list
802 * after this check but before the nlmsvc_insert_block. In that
803 * case it will be added back. Perhaps we need better locking
804 * for nlm_blocked?
805 */
806 if (list_empty(&block->b_list))
807 return;
808
789 /* Technically, we should down the file semaphore here. Since we 809 /* Technically, we should down the file semaphore here. Since we
790 * move the block towards the head of the queue only, no harm 810 * move the block towards the head of the queue only, no harm
791 * can be done, though. */ 811 * can be done, though. */
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 64c771056187..64c97552964a 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -409,16 +409,13 @@ char * svc_print_addr(struct svc_rqst *, char *, size_t);
409 * for all cases without actually generating the checksum, so we just use a 409 * for all cases without actually generating the checksum, so we just use a
410 * static value. 410 * static value.
411 */ 411 */
412static inline void 412static inline void svc_reserve_auth(struct svc_rqst *rqstp, int space)
413svc_reserve_auth(struct svc_rqst *rqstp, int space)
414{ 413{
415 int added_space = 0; 414 int added_space = 0;
416 415
417 switch(rqstp->rq_authop->flavour) { 416 if (rqstp->rq_authop->flavour)
418 case RPC_AUTH_GSS: 417 added_space = RPC_MAX_AUTH_SIZE;
419 added_space = RPC_MAX_AUTH_SIZE; 418 svc_reserve(rqstp, space + added_space);
420 }
421 return svc_reserve(rqstp, space + added_space);
422} 419}
423 420
424#endif /* SUNRPC_SVC_H */ 421#endif /* SUNRPC_SVC_H */
diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
index 3e321949e1dc..0598b229c11d 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
@@ -159,7 +159,8 @@ static int send_write(struct svcxprt_rdma *xprt, struct svc_rqst *rqstp,
159 BUG_ON(sge_count >= 32); 159 BUG_ON(sge_count >= 32);
160 dprintk("svcrdma: RDMA_WRITE rmr=%x, to=%llx, xdr_off=%d, " 160 dprintk("svcrdma: RDMA_WRITE rmr=%x, to=%llx, xdr_off=%d, "
161 "write_len=%d, xdr_sge=%p, sge_count=%d\n", 161 "write_len=%d, xdr_sge=%p, sge_count=%d\n",
162 rmr, to, xdr_off, write_len, xdr_sge, sge_count); 162 rmr, (unsigned long long)to, xdr_off,
163 write_len, xdr_sge, sge_count);
163 164
164 ctxt = svc_rdma_get_context(xprt); 165 ctxt = svc_rdma_get_context(xprt);
165 ctxt->count = 0; 166 ctxt->count = 0;