mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 15:15:47 +00:00
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>
This commit is contained in:
parent
1a867a0898
commit
6a74c0c940
1 changed files with 1 additions and 1 deletions
|
@ -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 */
|
/* Optimize common case that writes from 0 to end of file */
|
||||||
end = DIV_ROUND_UP(i_size_read(inode), PAGE_CACHE_SIZE);
|
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();
|
rcu_read_lock();
|
||||||
end = page_cache_next_hole(mapping, idx + 1, ULONG_MAX);
|
end = page_cache_next_hole(mapping, idx + 1, ULONG_MAX);
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
|
|
Loading…
Reference in a new issue