]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.19.31/nfsv4.1-reinitialise-sequence-results-before-retransmitting-a-request.patch
Linux 4.14.108
[thirdparty/kernel/stable-queue.git] / releases / 4.19.31 / nfsv4.1-reinitialise-sequence-results-before-retransmitting-a-request.patch
1 From c1dffe0bf7f9c3d57d9f237a7cb2a81e62babd2b Mon Sep 17 00:00:00 2001
2 From: Trond Myklebust <trond.myklebust@hammerspace.com>
3 Date: Fri, 1 Mar 2019 12:13:34 -0500
4 Subject: NFSv4.1: Reinitialise sequence results before retransmitting a request
5
6 From: Trond Myklebust <trond.myklebust@hammerspace.com>
7
8 commit c1dffe0bf7f9c3d57d9f237a7cb2a81e62babd2b upstream.
9
10 If we have to retransmit a request, we should ensure that we reinitialise
11 the sequence results structure, since in the event of a signal
12 we need to treat the request as if it had not been sent.
13
14 Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
15 Cc: stable@vger.kernel.org
16 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17
18 ---
19 fs/nfs/nfs4proc.c | 12 ++++++++----
20 1 file changed, 8 insertions(+), 4 deletions(-)
21
22 --- a/fs/nfs/nfs4proc.c
23 +++ b/fs/nfs/nfs4proc.c
24 @@ -947,6 +947,13 @@ nfs4_sequence_process_interrupted(struct
25
26 #endif /* !CONFIG_NFS_V4_1 */
27
28 +static void nfs41_sequence_res_init(struct nfs4_sequence_res *res)
29 +{
30 + res->sr_timestamp = jiffies;
31 + res->sr_status_flags = 0;
32 + res->sr_status = 1;
33 +}
34 +
35 static
36 void nfs4_sequence_attach_slot(struct nfs4_sequence_args *args,
37 struct nfs4_sequence_res *res,
38 @@ -958,10 +965,6 @@ void nfs4_sequence_attach_slot(struct nf
39 args->sa_slot = slot;
40
41 res->sr_slot = slot;
42 - res->sr_timestamp = jiffies;
43 - res->sr_status_flags = 0;
44 - res->sr_status = 1;
45 -
46 }
47
48 int nfs4_setup_sequence(struct nfs_client *client,
49 @@ -1007,6 +1010,7 @@ int nfs4_setup_sequence(struct nfs_clien
50
51 trace_nfs4_setup_sequence(session, args);
52 out_start:
53 + nfs41_sequence_res_init(res);
54 rpc_call_start(task);
55 return 0;
56