ceph: don't use truncate_pagecache() to invalidate read cache
truncate_pagecache() drops dirty pages, it's dangerous to use it to invalidate read cache. Besides, we shouldn't start invalidating read cache while there are buffer writers. Because buffer writers may add dirty pages later. Signed-off-by: Yan, Zheng <zyan@redhat.com>
This commit is contained in:
@@ -1728,7 +1728,9 @@ static void ceph_invalidate_work(struct work_struct *work)
|
||||
orig_gen = ci->i_rdcache_gen;
|
||||
spin_unlock(&ci->i_ceph_lock);
|
||||
|
||||
truncate_pagecache(inode, 0);
|
||||
if (invalidate_inode_pages2(inode->i_mapping) < 0) {
|
||||
pr_err("invalidate_pages %p fails\n", inode);
|
||||
}
|
||||
|
||||
spin_lock(&ci->i_ceph_lock);
|
||||
if (orig_gen == ci->i_rdcache_gen &&
|
||||
|
Reference in New Issue
Block a user