aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r--fs/ceph/inode.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 0a49ffde5bc..5a9f907b805 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -1394,11 +1394,8 @@ static void ceph_invalidate_work(struct work_struct *work)
1394 spin_lock(&inode->i_lock); 1394 spin_lock(&inode->i_lock);
1395 dout("invalidate_pages %p gen %d revoking %d\n", inode, 1395 dout("invalidate_pages %p gen %d revoking %d\n", inode,
1396 ci->i_rdcache_gen, ci->i_rdcache_revoking); 1396 ci->i_rdcache_gen, ci->i_rdcache_revoking);
1397 if (ci->i_rdcache_gen == 0 || 1397 if (ci->i_rdcache_revoking != ci->i_rdcache_gen) {
1398 ci->i_rdcache_revoking != ci->i_rdcache_gen) {
1399 BUG_ON(ci->i_rdcache_revoking > ci->i_rdcache_gen);
1400 /* nevermind! */ 1398 /* nevermind! */
1401 ci->i_rdcache_revoking = 0;
1402 spin_unlock(&inode->i_lock); 1399 spin_unlock(&inode->i_lock);
1403 goto out; 1400 goto out;
1404 } 1401 }
@@ -1408,15 +1405,16 @@ static void ceph_invalidate_work(struct work_struct *work)
1408 ceph_invalidate_nondirty_pages(inode->i_mapping); 1405 ceph_invalidate_nondirty_pages(inode->i_mapping);
1409 1406
1410 spin_lock(&inode->i_lock); 1407 spin_lock(&inode->i_lock);
1411 if (orig_gen == ci->i_rdcache_gen) { 1408 if (orig_gen == ci->i_rdcache_gen &&
1409 orig_gen == ci->i_rdcache_revoking) {
1412 dout("invalidate_pages %p gen %d successful\n", inode, 1410 dout("invalidate_pages %p gen %d successful\n", inode,
1413 ci->i_rdcache_gen); 1411 ci->i_rdcache_gen);
1414 ci->i_rdcache_gen = 0; 1412 ci->i_rdcache_revoking--;
1415 ci->i_rdcache_revoking = 0;
1416 check = 1; 1413 check = 1;
1417 } else { 1414 } else {
1418 dout("invalidate_pages %p gen %d raced, gen now %d\n", 1415 dout("invalidate_pages %p gen %d raced, now %d revoking %d\n",
1419 inode, orig_gen, ci->i_rdcache_gen); 1416 inode, orig_gen, ci->i_rdcache_gen,
1417 ci->i_rdcache_revoking);
1420 } 1418 }
1421 spin_unlock(&inode->i_lock); 1419 spin_unlock(&inode->i_lock);
1422 1420