Only do a simple_sync() if we are stable, auth, and not already sync. The
client request can race with other state changes, so be careful. The
client will also retry on any state change, so we can safely ignore if
things don't look quite right.
This fxes crash:
mds/Locker.cc: In function 'bool Locker::simple_sync(SimpleLock*, bool*)':
mds/Locker.cc:2592: FAILED assert(0)
1: (Locker::handle_file_lock(ScatterLock*, MLock*)+0x2a8) [0x57d328]
2: (MDS::_dispatch(Message*)+0x2165) [0x4a11d5]
3: (MDS::ms_dispatch(Message*)+0x6d) [0x4a169d]
4: (SimpleMessenger::dispatch_entry()+0x733) [0x47c903]
5: (SimpleMessenger::DispatchThread::entry()+0x1c) [0x474bac]
6: (Thread::_entry_func(void*)+0xa) [0x48748a]
7: /lib/libpthread.so.0 [0x7f8af92ff73a]
8: (clone()+0x6d) [0x7f8af852569d]
break;
case LOCK_AC_REQRDLOCK:
- if (lock->is_stable()) {
+ if (lock->get_parent()->is_auth() &&
+ lock->is_stable() &&
+ lock->get_state() != LOCK_SYNC) {
dout(7) << "handle_file_lock got rdlock request on " << *lock
<< " on " << *lock->get_parent() << dendl;
assert(in->is_auth()); // replica auth pinned if they're doing this!