Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a74c0c9 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Trond Myklebust
Browse files

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: default avatarWeston Andros Adamson <dros@primarydata.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 1a867a08
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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();