From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C58DDC43381 for ; Fri, 22 Mar 2019 12:21:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8BA0C218A1 for ; Fri, 22 Mar 2019 12:21:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553257308; bh=m0FXCEsHKVZ9XXQxBjdVQ0Cy1fBB37hlmpY4YjIeqg0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=qXZIEaboELHTVrQGIzXBUgXYw2EjLkKaY84nVPj+e3I3ZPz2rxg6J38/+zkG7Dfmo r1XcFsO8ShV9T1NQTG+yGNisp3TZrbxwcxawcSAZzIocdh25muXTbtsUOraFLXUa5a ccMA+Nznyit8rP9Ifno/wKclB5fZhQIfk/D1OInY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390710AbfCVMVr (ORCPT ); Fri, 22 Mar 2019 08:21:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:60810 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390894AbfCVMVn (ORCPT ); Fri, 22 Mar 2019 08:21:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 91E792054F; Fri, 22 Mar 2019 12:21:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553257303; bh=m0FXCEsHKVZ9XXQxBjdVQ0Cy1fBB37hlmpY4YjIeqg0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2R8zm7cwBoYvD2IP/Zq7E7wc60J7i90gJUTjprICTQ1fEfo/kPViora8aDAVOGQ7p Brrs0xDiTH0ZfNjUl18s1RLFkI/0NSh7YqvcwwiLxsFdraKJHmv7QdH0rS44DGUY+5 yqm7G1EKAfosoO+vbAa2iylB10oASTgxXeRlKAzQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust Subject: [PATCH 5.0 190/238] NFSv4.1: Reinitialise sequence results before retransmitting a request Date: Fri, 22 Mar 2019 12:16:49 +0100 Message-Id: <20190322111309.435585917@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111258.383569278@linuxfoundation.org> References: <20190322111258.383569278@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 5.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Trond Myklebust 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 Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/nfs/nfs4proc.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -947,6 +947,13 @@ nfs4_sequence_process_interrupted(struct #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, @@ -958,10 +965,6 @@ void nfs4_sequence_attach_slot(struct nf 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, @@ -1007,6 +1010,7 @@ int nfs4_setup_sequence(struct nfs_clien trace_nfs4_setup_sequence(session, args); out_start: + nfs41_sequence_res_init(res); rpc_call_start(task); return 0;