Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1048906pxb; Thu, 28 Jan 2021 06:59:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJyYpPkoLjEx/a+7Dr6Sc8u5/0bbZVZaeq6aifGiiU6aadDazPrndSQwB+W8OJOb7QBdmjJx X-Received: by 2002:a17:907:9879:: with SMTP id ko25mr11642377ejc.524.1611845957119; Thu, 28 Jan 2021 06:59:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611845957; cv=none; d=google.com; s=arc-20160816; b=oDEjSrFRCkcyoG26DTsqvB8J24BbH4Lf4pC9Xti+zpUcSokh9TFWiG8uEL+VgKULBJ eXY0Jf5c6cCCFkW2PQNKU7oPjFuiOvCq6rW42nap1zI2uqihq1m45gG8XpjTErdaHlXY WQyUPv6defi4pwsZVijYfsTgEbYcib/PAem+TFLlf7y6rVnWEuukpptXzHv+V7RFNkQi JT2fAkdUlO4BVwDndS1DNTDKocqPyrIh6QGB7TCytEL8hfcSBvxZ9LXaApC+WgUb9vB2 Zp0zTy08fDQLh306RjJuHZrN3wH5NCIlsFoq5oHZi3Jh/zDmlvKKcvFxUs0Y8+AvqcqK PIxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=y1kmH+B7NLmOeBWZSsj7F/0dKzsLTNAZN/u+CN4Js9M=; b=KWYjq/b25whoJQI99tSLHyznPKlbc9LqRpCwxe4fwGcEKChKATC8NTC9heYBt0qliQ BxwYC4eJFnrWrcBuX+f52v5tLNJ16IfJQGq0nHiI0Rh1L7DW8k+9EdTLyPZ1Yyz2cHRF WBGabBcYEksCYuzU60wwkVN92cd2Y0ICMFLaj61a5vmqn7+e29qyMgTgSTGdE8GEa9ui nsGPdhTNdW2nD+erEdRJCWTcCyp+qvKqExm4MT/Uu80QJyUq5n4A+RMtnPvIeEWCjDFJ qbfWT5RLG3WfQhdabmNqloKt6Hljt2WDh96E+K9QG2r9QnEQIRY2F/OgAi/8D/rKaMR/ aofg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AYNYF12I; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e6si3579699edz.362.2021.01.28.06.58.52; Thu, 28 Jan 2021 06:59:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AYNYF12I; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231924AbhA1O5l (ORCPT + 99 others); Thu, 28 Jan 2021 09:57:41 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:46863 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231932AbhA1O4k (ORCPT ); Thu, 28 Jan 2021 09:56:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611845714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=y1kmH+B7NLmOeBWZSsj7F/0dKzsLTNAZN/u+CN4Js9M=; b=AYNYF12IFd2/9hX0Oo4Ej9hMj1sEVqC7LKZijo53hVDpp2aN1vRqoseNSjVq90WPYPKfGw Sj5Xrdp1JKZU53vZ/z0Qgubs6AbnKZqiAcm1LU2PQ/SRECTX3QVwWfXqcYGK63C2UN9Ynh IurjI4/NBVQ865W9pEFIgTfrAorzXYo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-492-3n7Z3wnhPmmHNCeHUowMHQ-1; Thu, 28 Jan 2021 09:55:12 -0500 X-MC-Unique: 3n7Z3wnhPmmHNCeHUowMHQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2DAA29CDAF; Thu, 28 Jan 2021 14:55:11 +0000 (UTC) Received: from dwysocha.rdu.csb (ovpn-112-111.rdu2.redhat.com [10.10.112.111]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BF591179B3; Thu, 28 Jan 2021 14:55:10 +0000 (UTC) From: Dave Wysochanski To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH 02/10] NFS: In nfs_readpage() only increment NFSIOS_READPAGES when read succeeds Date: Thu, 28 Jan 2021 09:55:00 -0500 Message-Id: <1611845708-6752-3-git-send-email-dwysocha@redhat.com> In-Reply-To: <1611845708-6752-1-git-send-email-dwysocha@redhat.com> References: <1611845708-6752-1-git-send-email-dwysocha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org There is a small inconsistency with nfs_readpage() vs nfs_readpages() with regards to NFSIOS_READPAGES. In readpage we unconditionally increment NFSIOS_READPAGES at the top, which means even if the read fails. In readpages, we increment NFSIOS_READPAGES at the bottom based on how many pages were successfully read. Change readpage to be consistent with readpages and so NFSIOS_READPAGES only reflects successful, non-fscache reads. Signed-off-by: Dave Wysochanski --- fs/nfs/read.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/read.c b/fs/nfs/read.c index dd92156e27c5..464077daf62f 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c @@ -319,7 +319,6 @@ int nfs_readpage(struct file *file, struct page *page) dprintk("NFS: nfs_readpage (%p %ld@%lu)\n", page, PAGE_SIZE, page_index(page)); nfs_inc_stats(inode, NFSIOS_VFSREADPAGE); - nfs_add_stats(inode, NFSIOS_READPAGES, 1); /* * Try to flush any pending writes to the file.. @@ -359,6 +358,7 @@ int nfs_readpage(struct file *file, struct page *page) if (!PageUptodate(page) && !ret) ret = xchg(&ctx->error, 0); } + nfs_add_stats(inode, NFSIOS_READPAGES, 1); out: put_nfs_open_context(ctx); return ret; -- 1.8.3.1