mds: only client hold xlock in xlockdone can change lock state

If we are in xlockdone, only the client holding that xlock can adjus the
lock state (e.g., relock).  Other clients have to wait until the xlock
cycle unwinds completely.

Fixes: #1417
Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
Sage Weil 2011-08-19 16:15:06 -07:00
parent 1dfdc730f7
commit a35ac29bef

View File

@ -1306,7 +1306,8 @@ bool Locker::xlock_start(SimpleLock *lock, MDRequest *mut)
return true;
}
if (!lock->is_stable() && lock->get_state() != LOCK_XLOCKDONE)
if (!lock->is_stable() && !(lock->get_state() == LOCK_XLOCKDONE &&
lock->get_xlock_by_client() == client))
break;
if (lock->get_state() == LOCK_LOCK || lock->get_state() == LOCK_XLOCKDONE)