diff options
author | Dave Wysochanski <dwysocha@redhat.com> | 2021-01-28 09:55:00 -0500 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2021-02-01 13:32:48 -0500 |
commit | 6ddfd213f4ea22ac955bcd82100c57cd294494d2 (patch) | |
tree | d9ffe25a2201e72126473f9905b0e4d9651a7829 | |
parent | 49dee70052b89498cc0fc61e0e193cefeee40989 (diff) |
NFS: In nfs_readpage() only increment NFSIOS_READPAGES when read succeeds
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>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
-rw-r--r-- | fs/nfs/read.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |