linux-nfs.vger.kernel.org archive mirror
 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, linux-cachefs@redhat.com
Subject: [RFC PATCH v1 02/13] NFS: In nfs_readpage() only increment NFSIOS_READPAGES when read succeeds
Date: Wed, 15 Jul 2020 11:10:38 -0400	[thread overview]
Message-ID: <1594825849-24991-3-git-send-email-dwysocha@redhat.com> (raw)
In-Reply-To: <1594825849-24991-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 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


  parent reply	other threads:[~2020-07-15 15:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15 15:10 [RFC PATCH v1 0/13] Convert NFS client to new fscache-iter API Dave Wysochanski
2020-07-15 15:10 ` [RFC PATCH v1 01/13] NFS: Clean up nfs_readpage() and nfs_readpages() Dave Wysochanski
2020-07-15 15:10 ` Dave Wysochanski [this message]
2020-07-15 15:10 ` [RFC PATCH v1 03/13] NFS: Refactor nfs_readpage() and nfs_readpage_async() to use nfs_readdesc Dave Wysochanski
2020-07-15 15:10 ` [RFC PATCH v1 04/13] NFS: Call readpage_async_filler() from nfs_readpage_async() Dave Wysochanski
2020-07-15 15:10 ` [RFC PATCH v1 05/13] NFS: Add nfs_pageio_complete_read() and remove nfs_readpage_async() Dave Wysochanski
2020-07-15 15:10 ` [RFC PATCH v1 06/13] NFS: Rename readpage_async_filler() to nfs_pageio_add_page_read() Dave Wysochanski
2020-07-15 15:10 ` [RFC PATCH v1 07/13] NFS: Convert fscache_acquire_cookie and fscache_relinquish_cookie Dave Wysochanski
2020-07-15 15:10 ` [RFC PATCH v1 08/13] NFS: Allow nfs_async_read_completion_ops to be used by other NFS code Dave Wysochanski
2020-07-15 15:10 ` [RFC PATCH v1 09/13] NFS: Convert nfs_readpage() and readpages() to new fscache API Dave Wysochanski
2020-07-15 15:10 ` [RFC PATCH v1 10/13] NFS: Allow NFS use of new fscache API in build Dave Wysochanski
2020-07-15 15:10 ` [RFC PATCH v1 11/13] NFS: Only use and unuse an fscache cookie a single time based on NFS_INO_FSCACHE Dave Wysochanski
2020-07-15 15:10 ` [RFC PATCH v1 12/13] NFS: Convert fscache invalidation and update aux_data and i_size Dave Wysochanski
2020-07-15 15:10 ` [RFC PATCH v1 13/13] NFS: Call nfs_fscache_invalidate() when write extends the size of the file Dave Wysochanski
2020-07-17 14:25 ` [RFC PATCH v1 0/13] Convert NFS client to new fscache-iter API J. Bruce Fields
2020-07-17 15:19 ` [Linux-cachefs] " David Howells
2020-07-17 16:18   ` J. Bruce Fields

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=1594825849-24991-3-git-send-email-dwysocha@redhat.com \
    --to=dwysocha@redhat.com \
    --cc=anna.schumaker@netapp.com \
    --cc=linux-cachefs@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).