If we are in XSYN state and want to move to anything else, we must go via
EXCL, but we may not be loner anymore. Weaken the file_excl() assert so we
don't crash.
Reported-by: Fyodor Ustinov <ufm@ufm.su>
Signed-off-by: Sage Weil <sage@newdream.net>
assert(in->is_auth());
assert(lock->is_stable());
- assert(in->get_loner() >= 0 && in->mds_caps_wanted.empty());
+ assert((in->get_loner() >= 0 && in->mds_caps_wanted.empty()) ||
+ (lock->get_state() == LOCK_XSYN)); // must do xsyn -> excl -> <anything else>
switch (lock->get_state()) {
case LOCK_SYNC: lock->set_state(LOCK_SYNC_EXCL); break;