aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-12-20 14:31:56 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-12-20 14:31:56 -0500
commit822a5d313197c059924d394e6851be3cb312caa7 (patch)
tree7f93e12fc7f204f3ef6856e4912f2c5d0856ffdd /net
parent929e8d4a888cd15df486e5964c8e2021581a8a0f (diff)
parent6c52961743f38747401b47127b82159ab6d8a7a4 (diff)
Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
* 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: NFS: Fix a regression in nfs_file_llseek() NFSv4: Do not accept delegated opens when a delegation recall is in effect NFSv4: Ensure correct locking when accessing the 'lock_states' list NFSv4.1: Ensure that we handle _all_ SEQUENCE status bits. NFSv4: Don't error if we handled it in nfs4_recovery_handle_error SUNRPC: Ensure we always bump the backlog queue in xprt_free_slot SUNRPC: Fix the execution time statistics in the face of RPC restarts
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/sched.c30
-rw-r--r--net/sunrpc/xprt.c10
2 files changed, 27 insertions, 13 deletions
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index d12ffa545811..00a1a2acd587 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -590,6 +590,27 @@ void rpc_prepare_task(struct rpc_task *task)
590 task->tk_ops->rpc_call_prepare(task, task->tk_calldata); 590 task->tk_ops->rpc_call_prepare(task, task->tk_calldata);
591} 591}
592 592
593static void
594rpc_init_task_statistics(struct rpc_task *task)
595{
596 /* Initialize retry counters */
597 task->tk_garb_retry = 2;
598 task->tk_cred_retry = 2;
599 task->tk_rebind_retry = 2;
600
601 /* starting timestamp */
602 task->tk_start = ktime_get();
603}
604
605static void
606rpc_reset_task_statistics(struct rpc_task *task)
607{
608 task->tk_timeouts = 0;
609 task->tk_flags &= ~(RPC_CALL_MAJORSEEN|RPC_TASK_KILLED|RPC_TASK_SENT);
610
611 rpc_init_task_statistics(task);
612}
613
593/* 614/*
594 * Helper that calls task->tk_ops->rpc_call_done if it exists 615 * Helper that calls task->tk_ops->rpc_call_done if it exists
595 */ 616 */
@@ -602,6 +623,7 @@ void rpc_exit_task(struct rpc_task *task)
602 WARN_ON(RPC_ASSASSINATED(task)); 623 WARN_ON(RPC_ASSASSINATED(task));
603 /* Always release the RPC slot and buffer memory */ 624 /* Always release the RPC slot and buffer memory */
604 xprt_release(task); 625 xprt_release(task);
626 rpc_reset_task_statistics(task);
605 } 627 }
606 } 628 }
607} 629}
@@ -804,11 +826,6 @@ static void rpc_init_task(struct rpc_task *task, const struct rpc_task_setup *ta
804 task->tk_calldata = task_setup_data->callback_data; 826 task->tk_calldata = task_setup_data->callback_data;
805 INIT_LIST_HEAD(&task->tk_task); 827 INIT_LIST_HEAD(&task->tk_task);
806 828
807 /* Initialize retry counters */
808 task->tk_garb_retry = 2;
809 task->tk_cred_retry = 2;
810 task->tk_rebind_retry = 2;
811
812 task->tk_priority = task_setup_data->priority - RPC_PRIORITY_LOW; 829 task->tk_priority = task_setup_data->priority - RPC_PRIORITY_LOW;
813 task->tk_owner = current->tgid; 830 task->tk_owner = current->tgid;
814 831
@@ -818,8 +835,7 @@ static void rpc_init_task(struct rpc_task *task, const struct rpc_task_setup *ta
818 if (task->tk_ops->rpc_call_prepare != NULL) 835 if (task->tk_ops->rpc_call_prepare != NULL)
819 task->tk_action = rpc_prepare_task; 836 task->tk_action = rpc_prepare_task;
820 837
821 /* starting timestamp */ 838 rpc_init_task_statistics(task);
822 task->tk_start = ktime_get();
823 839
824 dprintk("RPC: new task initialized, procpid %u\n", 840 dprintk("RPC: new task initialized, procpid %u\n",
825 task_pid_nr(current)); 841 task_pid_nr(current));
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index f4385e45a5fc..c64c0ef519b5 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -995,13 +995,11 @@ out_init_req:
995 995
996static void xprt_free_slot(struct rpc_xprt *xprt, struct rpc_rqst *req) 996static void xprt_free_slot(struct rpc_xprt *xprt, struct rpc_rqst *req)
997{ 997{
998 if (xprt_dynamic_free_slot(xprt, req))
999 return;
1000
1001 memset(req, 0, sizeof(*req)); /* mark unused */
1002
1003 spin_lock(&xprt->reserve_lock); 998 spin_lock(&xprt->reserve_lock);
1004 list_add(&req->rq_list, &xprt->free); 999 if (!xprt_dynamic_free_slot(xprt, req)) {
1000 memset(req, 0, sizeof(*req)); /* mark unused */
1001 list_add(&req->rq_list, &xprt->free);
1002 }
1005 rpc_wake_up_next(&xprt->backlog); 1003 rpc_wake_up_next(&xprt->backlog);
1006 spin_unlock(&xprt->reserve_lock); 1004 spin_unlock(&xprt->reserve_lock);
1007} 1005}