提交 6a74c0c9 编写于 作者: C Christoph Hellwig 提交者: Trond Myklebust

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: NWeston Andros Adamson <dros@primarydata.com>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
上级 1a867a08
......@@ -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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册