All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Wysochanski <dwysocha@redhat.com>
To: Trond Myklebust <trondmy@hammerspace.com>,
	Anna Schumaker <anna.schumaker@netapp.com>
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	[thread overview]
Message-ID: <1611845708-6752-3-git-send-email-dwysocha@redhat.com> (raw)
In-Reply-To: <1611845708-6752-1-git-send-email-dwysocha@redhat.com>

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 <dwysocha@redhat.com>
---
 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


  parent reply	other threads:[~2021-01-28 14:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28 14:54 [PATCH 00/10] Convert NFS fscache read paths to netfs API Dave Wysochanski
2021-01-28 14:54 ` [PATCH 01/10] NFS: Clean up nfs_readpage() and nfs_readpages() Dave Wysochanski
2021-01-28 14:55 ` Dave Wysochanski [this message]
2021-01-28 14:55 ` [PATCH 03/10] NFS: Refactor nfs_readpage() and nfs_readpage_async() to use nfs_readdesc Dave Wysochanski
2021-01-28 14:55 ` [PATCH 04/10] NFS: Call readpage_async_filler() from nfs_readpage_async() Dave Wysochanski
2021-01-28 14:55 ` [PATCH 05/10] NFS: Add nfs_pageio_complete_read() and remove nfs_readpage_async() Dave Wysochanski
2021-01-28 14:55 ` [PATCH 06/10] NFS: Allow internal use of read structs and functions Dave Wysochanski
2021-02-05 13:47   ` David Wysochanski
2021-02-05 16:24     ` Anna Schumaker
2021-01-28 14:55 ` [PATCH 07/10] NFS: Convert to the netfs API and nfs_readpage to use netfs_readpage Dave Wysochanski
2021-01-28 14:55 ` [PATCH 08/10] NFS: Convert readpages to readahead and use netfs_readahead for fscache Dave Wysochanski
2021-01-28 14:55 ` [PATCH 09/10] NFS: Update releasepage to handle new fscache kiocb IO API Dave Wysochanski
2021-01-28 14:55 ` [PATCH 10/10] NFS: update various invalidation code paths for new " Dave Wysochanski
2021-02-01  2:15 ` [PATCH 00/10] Convert NFS fscache read paths to netfs API David Wysochanski
2021-02-01 14:30   ` Anna Schumaker
2021-02-02 12:19     ` David Wysochanski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1611845708-6752-3-git-send-email-dwysocha@redhat.com \
    --to=dwysocha@redhat.com \
    --cc=anna.schumaker@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.