Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1998045pxb; Sat, 21 Nov 2020 05:31:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyj1DKgbhR1191xuSRIsKvBvQJwyNqwY/O2MQbOwxrNTSd2sAg9R/j/83eIS5QIhwIv7jTN X-Received: by 2002:a17:906:82d7:: with SMTP id a23mr35941520ejy.505.1605965464686; Sat, 21 Nov 2020 05:31:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605965464; cv=none; d=google.com; s=arc-20160816; b=ZfghUVV2UyAWaf1CLc4rVToOh8mp4UbO4lZJfT1CscuO9fBqWl7u4LlkAE1lV6WwDp yl/WX/O5BaQLYtM3oznh+TFGyXAaxb3ziM+MiOQy9cT2KIO7FMJ7TQTUW8y1skhsthnH 757/ghJhTUeqV1ln8KZBuI0Qhv5UAtqf43c6EuG4C+F3YtLR4SVne/IKcCDC+dvtYxat cxLvpBim3ixYy1O2Kp4bUQ4tIzY1Aqfllu4nKUkxAHVxU+ITyFpbf6KEwbegHmsnMCcV BrTnk9xxGru9Lc6NBTOzlUECshv7kYF0ssAQh+9Ji8SBao+GUWzpVLuhNzA/d6yEyCW+ JIcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=TmUm+FqsWNSGezib7++Wn5qxVEto0VOC87DhDKJ5c38=; b=MiZJtDQJdC43zjaXc6u9h3DV5HBqJ1L84Id5RcaNvbgdAQ+Ky6n8phd11mklmM8a3Z 9wMTwPirV/rLuI6ka6wKXJZD0CI7fcXO65r5PCn6Laa37dWsTWgXkKaDdp++D9Gxw0N/ xUtsXvtQI4ZFgXJqQL7CrG7Ts9qzoyzo+X25G1OF42Lag8Ki0FJyQ2miWsIdxUnAPgXF Ha321SxtKJ7nh8Y7b7XkoeuXHOtY6Htk4HZWH1g8Ap1C+rcNqiuEmkYi+SNumnVkyIzS aB7hUMhug6tORnkUKh+yaBqptACZ2Hwnot96Ix1C8HJz7J03ewjvVEzOvOx6jNr1oPI5 WBYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TZzJoqIJ; 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 c11si4150043edy.463.2020.11.21.05.30.30; Sat, 21 Nov 2020 05:31:04 -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=TZzJoqIJ; 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 S1727418AbgKUN3V (ORCPT + 99 others); Sat, 21 Nov 2020 08:29:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:57297 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727702AbgKUN3T (ORCPT ); Sat, 21 Nov 2020 08:29:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605965358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=TmUm+FqsWNSGezib7++Wn5qxVEto0VOC87DhDKJ5c38=; b=TZzJoqIJ5/5W2MU35dPepxQAidjzFejcjwHba/Lfow3aK0qv8UHqSLswT5UYAWA0+yTWUH cax4CjrBk+JCkj2tMsOjDvwYiN7B/J5JuRgPu9QS9twUIfltRtlV8D0xYx1Zud47qAvGyh EX9BiRysfRifiStXj1Z0aNra3jFpSeU= 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-437-7kPhSD1tP7mATZB1MMSQgA-1; Sat, 21 Nov 2020 08:29:17 -0500 X-MC-Unique: 7kPhSD1tP7mATZB1MMSQgA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E8FF71DDE7; Sat, 21 Nov 2020 13:29:15 +0000 (UTC) Received: from dwysocha.rdu.csb (ovpn-112-41.rdu2.redhat.com [10.10.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 700AA1002C10; Sat, 21 Nov 2020 13:29:15 +0000 (UTC) From: Dave Wysochanski To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org, dhowells@redhat.com Subject: [PATCH v1 02/13] NFS: In nfs_readpage() only increment NFSIOS_READPAGES when read succeeds Date: Sat, 21 Nov 2020 08:29:14 -0500 Message-Id: <1605965354-24538-1-git-send-email-dwysocha@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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 a05fb3904ddf..1153c4e0a155 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c @@ -319,7 +319,6 @@ int nfs_readpage(struct file *filp, 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 *filp, 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