aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ceph/caps.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index a5b5725931bf..82ffde618af0 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -2278,8 +2278,8 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant,
2278 * try to invalidate (once). (If there are dirty buffers, we 2278 * try to invalidate (once). (If there are dirty buffers, we
2279 * will invalidate _after_ writeback.) 2279 * will invalidate _after_ writeback.)
2280 */ 2280 */
2281 if (((cap->issued & ~newcaps) & (CEPH_CAP_FILE_CACHE| 2281 if (((cap->issued & ~newcaps) & CEPH_CAP_FILE_CACHE) &&
2282 CEPH_CAP_FILE_LAZYIO)) && 2282 (newcaps & CEPH_CAP_FILE_LAZYIO) == 0 &&
2283 !ci->i_wrbuffer_ref) { 2283 !ci->i_wrbuffer_ref) {
2284 if (try_nonblocking_invalidate(inode) == 0) { 2284 if (try_nonblocking_invalidate(inode) == 0) {
2285 revoked_rdcache = 1; 2285 revoked_rdcache = 1;
@@ -2371,16 +2371,22 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant,
2371 2371
2372 /* revocation, grant, or no-op? */ 2372 /* revocation, grant, or no-op? */
2373 if (cap->issued & ~newcaps) { 2373 if (cap->issued & ~newcaps) {
2374 dout("revocation: %s -> %s\n", ceph_cap_string(cap->issued), 2374 int revoking = cap->issued & ~newcaps;
2375 ceph_cap_string(newcaps)); 2375
2376 if ((used & ~newcaps) & CEPH_CAP_FILE_BUFFER) 2376 dout("revocation: %s -> %s (revoking %s)\n",
2377 writeback = 1; /* will delay ack */ 2377 ceph_cap_string(cap->issued),
2378 else if (dirty & ~newcaps) 2378 ceph_cap_string(newcaps),
2379 check_caps = 1; /* initiate writeback in check_caps */ 2379 ceph_cap_string(revoking));
2380 else if (((used & ~newcaps) & (CEPH_CAP_FILE_CACHE| 2380 if (revoking & CEPH_CAP_FILE_BUFFER)
2381 CEPH_CAP_FILE_LAZYIO)) == 0 || 2381 writeback = 1; /* initiate writeback; will delay ack */
2382 revoked_rdcache) 2382 else if (revoking == CEPH_CAP_FILE_CACHE &&
2383 check_caps = 2; /* send revoke ack in check_caps */ 2383 (newcaps & CEPH_CAP_FILE_LAZYIO) == 0 &&
2384 queue_invalidate)
2385 ; /* do nothing yet, invalidation will be queued */
2386 else if (cap == ci->i_auth_cap)
2387 check_caps = 1; /* check auth cap only */
2388 else
2389 check_caps = 2; /* check all caps */
2384 cap->issued = newcaps; 2390 cap->issued = newcaps;
2385 cap->implemented |= newcaps; 2391 cap->implemented |= newcaps;
2386 } else if (cap->issued == newcaps) { 2392 } else if (cap->issued == newcaps) {