]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
NFSv4.1: Reinitialise sequence results before retransmitting a request
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 1 Mar 2019 17:13:34 +0000 (12:13 -0500)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
BugLink: https://bugs.launchpad.net/bugs/1837952
commit c1dffe0bf7f9c3d57d9f237a7cb2a81e62babd2b upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/nfs/nfs4proc.c

index 78d839c2a43b94e9d07c2447fbebebd4978fd96b..4617da850d9b539611a39ba5f0a91c3861ce1ba8 100644 (file)
@@ -914,6 +914,13 @@ nfs4_sequence_process_interrupted(struct nfs_client *client,
 
 #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,
@@ -925,10 +932,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,
@@ -974,6 +977,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;