aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Schumaker <bjschuma@netapp.com>2011-04-18 15:57:32 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-04-18 17:05:48 -0400
commit468f86134ee515234afe5c5b3f39f266c50e61a5 (patch)
tree912d0d587ffa2897ce16ed1258e8f52b23308b61
parent47c2199b6eb5fbe38ddb844db7cdbd914d304f9c (diff)
NFSv4.1: Don't update sequence number if rpc_task is not sent
If we fail to contact the gss upcall program, then no message will be sent to the server. The client still updated the sequence number, however, and this lead to NFS4ERR_SEQ_MISMATCH for the next several RPC calls. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/nfs4proc.c4
-rw-r--r--include/linux/sunrpc/sched.h2
-rw-r--r--net/sunrpc/xprt.c1
3 files changed, 5 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index b8e1ac69b743..e7e2077eebd9 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -444,8 +444,8 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *
444 if (res->sr_status == 1) 444 if (res->sr_status == 1)
445 res->sr_status = NFS_OK; 445 res->sr_status = NFS_OK;
446 446
447 /* -ERESTARTSYS can result in skipping nfs41_sequence_setup */ 447 /* don't increment the sequence number if the task wasn't sent */
448 if (!res->sr_slot) 448 if (!RPC_WAS_SENT(task))
449 goto out; 449 goto out;
450 450
451 /* Check the SEQUENCE operation status */ 451 /* Check the SEQUENCE operation status */
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index d81db8012c63..3b94f804b852 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -127,6 +127,7 @@ struct rpc_task_setup {
127#define RPC_TASK_KILLED 0x0100 /* task was killed */ 127#define RPC_TASK_KILLED 0x0100 /* task was killed */
128#define RPC_TASK_SOFT 0x0200 /* Use soft timeouts */ 128#define RPC_TASK_SOFT 0x0200 /* Use soft timeouts */
129#define RPC_TASK_SOFTCONN 0x0400 /* Fail if can't connect */ 129#define RPC_TASK_SOFTCONN 0x0400 /* Fail if can't connect */
130#define RPC_TASK_SENT 0x0800 /* message was sent */
130 131
131#define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC) 132#define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC)
132#define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) 133#define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER)
@@ -134,6 +135,7 @@ struct rpc_task_setup {
134#define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED) 135#define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED)
135#define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT) 136#define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT)
136#define RPC_IS_SOFTCONN(t) ((t)->tk_flags & RPC_TASK_SOFTCONN) 137#define RPC_IS_SOFTCONN(t) ((t)->tk_flags & RPC_TASK_SOFTCONN)
138#define RPC_WAS_SENT(t) ((t)->tk_flags & RPC_TASK_SENT)
137 139
138#define RPC_TASK_RUNNING 0 140#define RPC_TASK_RUNNING 0
139#define RPC_TASK_QUEUED 1 141#define RPC_TASK_QUEUED 1
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 9494c3767356..ce5eb68a9664 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -906,6 +906,7 @@ void xprt_transmit(struct rpc_task *task)
906 } 906 }
907 907
908 dprintk("RPC: %5u xmit complete\n", task->tk_pid); 908 dprintk("RPC: %5u xmit complete\n", task->tk_pid);
909 task->tk_flags |= RPC_TASK_SENT;
909 spin_lock_bh(&xprt->transport_lock); 910 spin_lock_bh(&xprt->transport_lock);
910 911
911 xprt->ops->set_retrans_timeout(task); 912 xprt->ops->set_retrans_timeout(task);