From: Sage Weil Date: Mon, 16 Aug 2010 21:27:34 +0000 (-0700) Subject: mds: flush log on cap writeback if !dirty and unstable locks X-Git-Tag: v0.22~275 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2921e1350689627d74869b8a593c170ad5515b54;p=ceph.git mds: flush log on cap writeback if !dirty and unstable locks 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. --- diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 85d29030bb5..98b8ffb89d6 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -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();