summaryrefslogtreecommitdiffstats
path: root/fs/nfs/blocklayout
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-11-24 16:47:02 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-11-24 17:00:41 -0500
commit6a74c0c9402b85647793da70edc9d6b097d54472 (patch)
treeb44a19cb5bbf9f899d28f086ebb7c2604a017a2b /fs/nfs/blocklayout
parent1a867a0898b2e366a1eb5b7fe21413a2b2b1629f (diff)
downloadop-kernel-dev-6a74c0c9402b85647793da70edc9d6b097d54472.zip
op-kernel-dev-6a74c0c9402b85647793da70edc9d6b097d54472.tar.gz
pnfs/blocklayout: fix end calculation in pnfs_num_cont_bytes
Use the number of pages in the pagecache mapping instead of the number of pnfs requests which is only slightly related. Reported-by: Weston Andros Adamson <dros@primarydata.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/blocklayout')
-rw-r--r--fs/nfs/blocklayout/blocklayout.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c
index 4f46f7a..77fec6a 100644
--- a/fs/nfs/blocklayout/blocklayout.c
+++ b/fs/nfs/blocklayout/blocklayout.c
@@ -812,7 +812,7 @@ static u64 pnfs_num_cont_bytes(struct inode *inode, pgoff_t idx)
/* Optimize common case that writes from 0 to end of file */
end = DIV_ROUND_UP(i_size_read(inode), PAGE_CACHE_SIZE);
- if (end != NFS_I(inode)->npages) {
+ if (end != inode->i_mapping->nrpages) {
rcu_read_lock();
end = page_cache_next_hole(mapping, idx + 1, ULONG_MAX);
rcu_read_unlock();
OpenPOWER on IntegriCloud