]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: flush log on cap writeback if !dirty and unstable locks
authorSage Weil <sage@newdream.net>
Mon, 16 Aug 2010 21:27:34 +0000 (14:27 -0700)
committerSage Weil <sage@newdream.net>
Mon, 16 Aug 2010 21:51:25 +0000 (14:51 -0700)
The problem is if we revoke caps, nothing is dirty, but we do writeback
because we are adjusting max_size.  Then we have to wait for the log to
flush even though the revocation should proceed immediately.  To move
things along, flush the log immediately.

This still isn't ideal.. it would be nice to allow the locking to continue
and adjust max_size in parallel, but that isn't always possible, and will
require some more thought.

src/mds/Locker.cc

index 85d29030bb5c2b6536eff31e33de054fec24232d..98b8ffb89d67442fdd50aff9d8a42f8a7833ae21 100644 (file)
@@ -2250,6 +2250,7 @@ bool Locker::_do_cap_update(CInode *in, Capability *cap,
   if (((dirty & (CEPH_CAP_FILE_EXCL|CEPH_CAP_FILE_WR)) && !in->filelock.is_stable()) ||
       ((dirty & CEPH_CAP_AUTH_EXCL) && !in->authlock.is_stable()) ||
       ((dirty & CEPH_CAP_XATTR_EXCL) && !in->xattrlock.is_stable()) ||
+      (!dirty && (!in->filelock.is_stable() || !in->authlock.is_stable() || !in->xattrlock.is_stable())) ||  // nothing dirty + unstable lock -> probably a revoke?
       (change_max && new_max) ||         // max INCREASE
       (cap->wanted() & ~cap->pending()))
     mds->mdlog->flush();