Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp37733pxb; Wed, 27 Jan 2021 01:10:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxSc422boyD8KOFU96EEfCSNnE/GWsgC9AKcMrsPLVWUJXWGF3vbBUEPQKHxoffLa3zGmYu X-Received: by 2002:a17:906:3a13:: with SMTP id z19mr6401057eje.317.1611738616427; Wed, 27 Jan 2021 01:10:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611738616; cv=none; d=google.com; s=arc-20160816; b=sXe8tesCb52xf7VEklKkYkVGc+TsIiPOKYkM2hmLtKVp2+g8uvUmascOfwhoK+mJxW IsAqCv/Hak6xYwimxyI8wOcEG7imbaoRtL39OPWQq6uu44GFicJwn2N4kEWqywQGY9aL VydD5RmAdi8rcTWPqjoVxcFhNYAAwZdhsmeuPdnhvkGFQ6OTaHBrRuW1NGGvT58D4xGl nPbta9Aq2P61z4/YUk468ZAxt5UvLDB5TJPMd5KfrVm9lGBhluFV0r71tsTGUhoDLfTV CWsVEFxc4i4k2KN29uyuyoMXQY+AEaqxqTOQKv140lzBNEIHt+VzrXp92vkgWGNrJv7v cckQ== 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=poVMeiltbpaQxdShzCGMTf0YZDyq09LKAB9Bylz4V0arjNwjRA0zs3FaIY8DzpxSa7 +N8TKdOuJz7UIWZGW7HmLp6ZQ6JwyEEOwCnmKWkSJLiOPUuaeIvFFgRx8zRljMnniVVQ eqqc/R87aWBDQsbzh9K6juxUTJDlLKfji+aEaqU1OcRda7YUV0sbmuQBhcQxaU92LSB7 XFFqDVafM68+WuX54S3VuKqhDsVTcwIRhLAM1KAoXAn+QRgjckt9inRIPjHuqE0QUN+G JBSH00/ZL/NEpKj/+b1yJ+4DUrSx1gEtM1ylMbcLTaQigA3qsccuHpi6nTOcPiYsKq6p FdFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=E8abhyOw; 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 b12si633457edz.497.2021.01.27.01.09.51; Wed, 27 Jan 2021 01:10:16 -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=E8abhyOw; 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 S231668AbhA0IKn (ORCPT + 99 others); Wed, 27 Jan 2021 03:10:43 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:31880 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234460AbhA0IE6 (ORCPT ); Wed, 27 Jan 2021 03:04:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611734612; 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=E8abhyOwirGCRtr7uF2MeU7Y3SDU/XjEdMhbE+0McMn3RaLzSAlJ7h19fOcc5jM05lO2cI WKCiP6DkUWzSOO8aNHRFCh4tGh8m78t/VqOzoRQsBS0S7xhOBgWip46DnsrkqEuuJXXroP nCA+RH5kNJHV6/WZMxAHqTe4mazAWCM= 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-476-IsM6GmFJOBKINBIkLuTgww-1; Wed, 27 Jan 2021 03:03:30 -0500 X-MC-Unique: IsM6GmFJOBKINBIkLuTgww-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 7582D107ACE3; Wed, 27 Jan 2021 08:03:29 +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 00CDE1F0; Wed, 27 Jan 2021 08:03:28 +0000 (UTC) From: Dave Wysochanski To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH 2/8] NFS: In nfs_readpage() only increment NFSIOS_READPAGES when read succeeds Date: Wed, 27 Jan 2021 03:03:11 -0500 Message-Id: <1611734597-14754-3-git-send-email-dwysocha@redhat.com> In-Reply-To: <1611734597-14754-2-git-send-email-dwysocha@redhat.com> References: <1611734597-14754-2-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