summaryrefslogtreecommitdiffstats
path: root/fs/ceph/inode.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2016-05-18 20:58:26 +0800
committerIlya Dryomov <idryomov@gmail.com>2016-05-26 01:15:42 +0200
commit9abd4db713704aac146395e079224ddd716e9b95 (patch)
treebf7ddd4b76b0b20b45e905c6854d1b74551c06f6 /fs/ceph/inode.c
parentb109eec6f4332bd517e2f41e207037c4b9065094 (diff)
downloadop-kernel-dev-9abd4db713704aac146395e079224ddd716e9b95.zip
op-kernel-dev-9abd4db713704aac146395e079224ddd716e9b95.tar.gz
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>
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r--fs/ceph/inode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 89d0815..07495ba 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -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 &&
OpenPOWER on IntegriCloud