Merge branch 'for-linus' of git://linux-nfs.org/~bfields/linux
* 'for-linus' of git://linux-nfs.org/~bfields/linux: SUNPRC: Fix printk format warning nfsd: clean up svc_reserve_auth() NLM: don't requeue block if it was invalidated while GRANT_MSG was in flight NLM: don't reattempt GRANT_MSG when there is already an RPC in flight NLM: have server-side RPC clients default to soft RPC tasks NLM: set RPC_CLNT_CREATE_NOPING for NLM RPC clients
This commit is contained in:
@@ -243,10 +243,18 @@ nlm_bind_host(struct nlm_host *host)
|
|||||||
.program = &nlm_program,
|
.program = &nlm_program,
|
||||||
.version = host->h_version,
|
.version = host->h_version,
|
||||||
.authflavor = RPC_AUTH_UNIX,
|
.authflavor = RPC_AUTH_UNIX,
|
||||||
.flags = (RPC_CLNT_CREATE_HARDRTRY |
|
.flags = (RPC_CLNT_CREATE_NOPING |
|
||||||
RPC_CLNT_CREATE_AUTOBIND),
|
RPC_CLNT_CREATE_AUTOBIND),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* lockd retries server side blocks automatically so we want
|
||||||
|
* those to be soft RPC calls. Client side calls need to be
|
||||||
|
* hard RPC tasks.
|
||||||
|
*/
|
||||||
|
if (!host->h_server)
|
||||||
|
args.flags |= RPC_CLNT_CREATE_HARDRTRY;
|
||||||
|
|
||||||
clnt = rpc_create(&args);
|
clnt = rpc_create(&args);
|
||||||
if (!IS_ERR(clnt))
|
if (!IS_ERR(clnt))
|
||||||
host->h_rpcclnt = clnt;
|
host->h_rpcclnt = clnt;
|
||||||
|
@@ -763,11 +763,20 @@ callback:
|
|||||||
dprintk("lockd: GRANTing blocked lock.\n");
|
dprintk("lockd: GRANTing blocked lock.\n");
|
||||||
block->b_granted = 1;
|
block->b_granted = 1;
|
||||||
|
|
||||||
/* Schedule next grant callback in 30 seconds */
|
/* keep block on the list, but don't reattempt until the RPC
|
||||||
nlmsvc_insert_block(block, 30 * HZ);
|
* completes or the submission fails
|
||||||
|
*/
|
||||||
|
nlmsvc_insert_block(block, NLM_NEVER);
|
||||||
|
|
||||||
/* Call the client */
|
/* Call the client -- use a soft RPC task since nlmsvc_retry_blocked
|
||||||
nlm_async_call(block->b_call, NLMPROC_GRANTED_MSG, &nlmsvc_grant_ops);
|
* will queue up a new one if this one times out
|
||||||
|
*/
|
||||||
|
error = nlm_async_call(block->b_call, NLMPROC_GRANTED_MSG,
|
||||||
|
&nlmsvc_grant_ops);
|
||||||
|
|
||||||
|
/* RPC submission failed, wait a bit and retry */
|
||||||
|
if (error < 0)
|
||||||
|
nlmsvc_insert_block(block, 10 * HZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -786,6 +795,17 @@ static void nlmsvc_grant_callback(struct rpc_task *task, void *data)
|
|||||||
|
|
||||||
dprintk("lockd: GRANT_MSG RPC callback\n");
|
dprintk("lockd: GRANT_MSG RPC callback\n");
|
||||||
|
|
||||||
|
/* if the block is not on a list at this point then it has
|
||||||
|
* been invalidated. Don't try to requeue it.
|
||||||
|
*
|
||||||
|
* FIXME: it's possible that the block is removed from the list
|
||||||
|
* after this check but before the nlmsvc_insert_block. In that
|
||||||
|
* case it will be added back. Perhaps we need better locking
|
||||||
|
* for nlm_blocked?
|
||||||
|
*/
|
||||||
|
if (list_empty(&block->b_list))
|
||||||
|
return;
|
||||||
|
|
||||||
/* Technically, we should down the file semaphore here. Since we
|
/* Technically, we should down the file semaphore here. Since we
|
||||||
* move the block towards the head of the queue only, no harm
|
* move the block towards the head of the queue only, no harm
|
||||||
* can be done, though. */
|
* can be done, though. */
|
||||||
|
@@ -409,16 +409,13 @@ char * svc_print_addr(struct svc_rqst *, char *, size_t);
|
|||||||
* for all cases without actually generating the checksum, so we just use a
|
* for all cases without actually generating the checksum, so we just use a
|
||||||
* static value.
|
* static value.
|
||||||
*/
|
*/
|
||||||
static inline void
|
static inline void svc_reserve_auth(struct svc_rqst *rqstp, int space)
|
||||||
svc_reserve_auth(struct svc_rqst *rqstp, int space)
|
|
||||||
{
|
{
|
||||||
int added_space = 0;
|
int added_space = 0;
|
||||||
|
|
||||||
switch(rqstp->rq_authop->flavour) {
|
if (rqstp->rq_authop->flavour)
|
||||||
case RPC_AUTH_GSS:
|
|
||||||
added_space = RPC_MAX_AUTH_SIZE;
|
added_space = RPC_MAX_AUTH_SIZE;
|
||||||
}
|
svc_reserve(rqstp, space + added_space);
|
||||||
return svc_reserve(rqstp, space + added_space);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* SUNRPC_SVC_H */
|
#endif /* SUNRPC_SVC_H */
|
||||||
|
@@ -159,7 +159,8 @@ static int send_write(struct svcxprt_rdma *xprt, struct svc_rqst *rqstp,
|
|||||||
BUG_ON(sge_count >= 32);
|
BUG_ON(sge_count >= 32);
|
||||||
dprintk("svcrdma: RDMA_WRITE rmr=%x, to=%llx, xdr_off=%d, "
|
dprintk("svcrdma: RDMA_WRITE rmr=%x, to=%llx, xdr_off=%d, "
|
||||||
"write_len=%d, xdr_sge=%p, sge_count=%d\n",
|
"write_len=%d, xdr_sge=%p, sge_count=%d\n",
|
||||||
rmr, to, xdr_off, write_len, xdr_sge, sge_count);
|
rmr, (unsigned long long)to, xdr_off,
|
||||||
|
write_len, xdr_sge, sge_count);
|
||||||
|
|
||||||
ctxt = svc_rdma_get_context(xprt);
|
ctxt = svc_rdma_get_context(xprt);
|
||||||
ctxt->count = 0;
|
ctxt->count = 0;
|
||||||
|
Reference in New Issue
Block a user