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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 AC036C3A5A6 for ; Thu, 19 Sep 2019 22:08:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7CE0021920 for ; Thu, 19 Sep 2019 22:08:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568930893; bh=NjRPUgu6FMXfgGHAXdGdhpBFv17LwrP5rPdyr66FpIQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Hah78Wkb9S4ZEdBFFI5pE39JLndIdUXo4Szff9Z6PRx5ogchomdRYWZ47mlF2d/Kd 5XCi6hLAFcOLCyWQjsapekFhwT6KWnvkn/Ba16dE9a+d+9iL0pvCSII+OOpyZZAdn/ 7i+PYTB1ZT3nXlOUJP0wAovvT/m3n14ClGDtqIcU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393368AbfISWIM (ORCPT ); Thu, 19 Sep 2019 18:08:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:46030 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393355AbfISWIK (ORCPT ); Thu, 19 Sep 2019 18:08:10 -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 F2238218AF; Thu, 19 Sep 2019 22:08:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568930889; bh=NjRPUgu6FMXfgGHAXdGdhpBFv17LwrP5rPdyr66FpIQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GbAMUTcY6PKSax3CQ27Makr0dehlQwo4DRKK1gxJF1K0h/tuWnhVeiNZzK65BTD3b G6198S0EUPDpZrIs2G5vEuSU6fEcM7BM7ZZQvCtYIDjKTbhKM95z3z4cnE6zxodK8P 9nexeakP0QqX0w/AOcL/qK/VEs6+qcIfwEmHOWJQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust , Sasha Levin Subject: [PATCH 5.2 052/124] NFS: Fix initialisation of I/O result struct in nfs_pgio_rpcsetup Date: Fri, 20 Sep 2019 00:02:20 +0200 Message-Id: <20190919214820.896371438@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190919214819.198419517@linuxfoundation.org> References: <20190919214819.198419517@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Trond Myklebust [ Upstream commit 17d8c5d145000070c581f2a8aa01edc7998582ab ] Initialise the result count to 0 rather than initialising it to the argument count. The reason is that we want to ensure we record the I/O stats correctly in the case where an error is returned (for instance in the layoutstats). Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- fs/nfs/pagelist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index 8b62117532289..eae584dbfa085 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c @@ -590,7 +590,7 @@ static void nfs_pgio_rpcsetup(struct nfs_pgio_header *hdr, } hdr->res.fattr = &hdr->fattr; - hdr->res.count = count; + hdr->res.count = 0; hdr->res.eof = 0; hdr->res.verf = &hdr->verf; nfs_fattr_init(&hdr->fattr); -- 2.20.1