From 44f0b28ea7675102460bf48e3bf5a4468d01ba64 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 10 Jun 2010 13:20:33 -0700 Subject: [PATCH] --- yaml --- r: 208831 b: refs/heads/master c: 3b454c4945c756686e91d77eeefac80cb5d21baf h: refs/heads/master i: 208829: 35f592a435c08c425e84196af876b9168f1c573a 208827: 996814b57d23c867a83b77911a27dfbbc450b90a 208823: deb760c05cce9ff9eed374e0bd88d295d1ea8988 208815: 9ca709775a9816105e745e1cb83c59d91c3a2b14 208799: 1acc2f7b04ca7271a533dd5cddd58d3e52577ff9 208767: 79798e218bb6c35ec2f9bb40b52941734c991729 v: v3 --- [refs] | 2 +- trunk/fs/ceph/caps.c | 30 ++++++++++++++++++------------ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index c64f135a2bc6..c1d93cd885b1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 38e8883ee31667d901feb9106f4863af35948c91 +refs/heads/master: 3b454c4945c756686e91d77eeefac80cb5d21baf diff --git a/trunk/fs/ceph/caps.c b/trunk/fs/ceph/caps.c index a5b5725931bf..82ffde618af0 100644 --- a/trunk/fs/ceph/caps.c +++ b/trunk/fs/ceph/caps.c @@ -2278,8 +2278,8 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant, * try to invalidate (once). (If there are dirty buffers, we * will invalidate _after_ writeback.) */ - if (((cap->issued & ~newcaps) & (CEPH_CAP_FILE_CACHE| - CEPH_CAP_FILE_LAZYIO)) && + if (((cap->issued & ~newcaps) & CEPH_CAP_FILE_CACHE) && + (newcaps & CEPH_CAP_FILE_LAZYIO) == 0 && !ci->i_wrbuffer_ref) { if (try_nonblocking_invalidate(inode) == 0) { revoked_rdcache = 1; @@ -2371,16 +2371,22 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant, /* revocation, grant, or no-op? */ if (cap->issued & ~newcaps) { - dout("revocation: %s -> %s\n", ceph_cap_string(cap->issued), - ceph_cap_string(newcaps)); - if ((used & ~newcaps) & CEPH_CAP_FILE_BUFFER) - writeback = 1; /* will delay ack */ - else if (dirty & ~newcaps) - check_caps = 1; /* initiate writeback in check_caps */ - else if (((used & ~newcaps) & (CEPH_CAP_FILE_CACHE| - CEPH_CAP_FILE_LAZYIO)) == 0 || - revoked_rdcache) - check_caps = 2; /* send revoke ack in check_caps */ + int revoking = cap->issued & ~newcaps; + + dout("revocation: %s -> %s (revoking %s)\n", + ceph_cap_string(cap->issued), + ceph_cap_string(newcaps), + ceph_cap_string(revoking)); + if (revoking & CEPH_CAP_FILE_BUFFER) + writeback = 1; /* initiate writeback; will delay ack */ + else if (revoking == CEPH_CAP_FILE_CACHE && + (newcaps & CEPH_CAP_FILE_LAZYIO) == 0 && + queue_invalidate) + ; /* do nothing yet, invalidation will be queued */ + else if (cap == ci->i_auth_cap) + check_caps = 1; /* check auth cap only */ + else + check_caps = 2; /* check all caps */ cap->issued = newcaps; cap->implemented |= newcaps; } else if (cap->issued == newcaps) {