From: Sage Weil Date: Thu, 23 Sep 2010 04:10:18 +0000 (-0700) Subject: mds: do not scatter_writebehind on nudge if replicated X-Git-Tag: v0.22~127 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1c09263467a7df45d568b8ac07d59984bcc7c2d1;p=ceph.git mds: do not scatter_writebehind on nudge if replicated This can cause the inode rstat etc to become out of sync with dirfrag accounted_rstat when the scatterlock is not in a gathered state: the local values will get updated but those on other nodes will not, and the inode will drift out of sync with the dirfrags. Other callers to scatter_writebehind() are all in contexts where we have _just_ gathered dirfrag state, or there is no remote dirfrag state to gather. Signed-off-by: Sage Weil --- diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 4203aefc50a..be67688cd72 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -3292,7 +3292,7 @@ void Locker::scatter_nudge(ScatterLock *lock, Context *c, bool forcelockchange) // can we do it now? // (only if we're not replicated.. if we are, we really do need // to nudge the lock state!) - if (!forcelockchange && lock->can_wrlock(-1)) { + if (!forcelockchange && !lock->get_parent()->is_replicated() && lock->can_wrlock(-1)) { dout(10) << "scatter_nudge auth, propagating " << *lock << " on " << *p << dendl; scatter_writebehind(lock); if (c)