public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] NFSv4.1: Reinitialise sequence results before retransmitting a request
@ 2019-03-01 19:11 Trond Myklebust
  2019-03-01 19:11 ` [PATCH 2/2] NFSv4.1: Don't process the sequence op more than once Trond Myklebust
  2019-03-05 13:35 ` [PATCH 1/2] NFSv4.1: Reinitialise sequence results before retransmitting a request Sasha Levin
  0 siblings, 2 replies; 3+ messages in thread
From: Trond Myklebust @ 2019-03-01 19:11 UTC (permalink / raw)
  To: linux-nfs

If we have to retransmit a request, we should ensure that we reinitialise
the sequence results structure, since in the event of a signal
we need to treat the request as if it had not been sent.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Cc: stable@vger.kernel.org
---
 fs/nfs/nfs4proc.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 77c6e2d3f3fc..5f8517d1a0a5 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -945,6 +945,13 @@ EXPORT_SYMBOL_GPL(nfs4_sequence_done);
 
 #endif	/* !CONFIG_NFS_V4_1 */
 
+static void nfs41_sequence_res_init(struct nfs4_sequence_res *res)
+{
+	res->sr_timestamp = jiffies;
+	res->sr_status_flags = 0;
+	res->sr_status = 1;
+}
+
 static
 void nfs4_sequence_attach_slot(struct nfs4_sequence_args *args,
 		struct nfs4_sequence_res *res,
@@ -956,10 +963,6 @@ void nfs4_sequence_attach_slot(struct nfs4_sequence_args *args,
 	args->sa_slot = slot;
 
 	res->sr_slot = slot;
-	res->sr_timestamp = jiffies;
-	res->sr_status_flags = 0;
-	res->sr_status = 1;
-
 }
 
 int nfs4_setup_sequence(struct nfs_client *client,
@@ -998,6 +1001,7 @@ int nfs4_setup_sequence(struct nfs_client *client,
 
 	trace_nfs4_setup_sequence(session, args);
 out_start:
+	nfs41_sequence_res_init(res);
 	rpc_call_start(task);
 	return 0;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-03-05 13:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-01 19:11 [PATCH 1/2] NFSv4.1: Reinitialise sequence results before retransmitting a request Trond Myklebust
2019-03-01 19:11 ` [PATCH 2/2] NFSv4.1: Don't process the sequence op more than once Trond Myklebust
2019-03-05 13:35 ` [PATCH 1/2] NFSv4.1: Reinitialise sequence results before retransmitting a request Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox