]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: be careful obeying REQRDLOCK
authorSage Weil <sage@newdream.net>
Thu, 22 Jul 2010 19:01:11 +0000 (12:01 -0700)
committerSage Weil <sage@newdream.net>
Thu, 22 Jul 2010 19:01:11 +0000 (12:01 -0700)
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]

src/mds/Locker.cc

index 1e4c101d45fd9bcdd699f7e6acdfc5d4dc434053..96c9a55e4762b9475b1d2d3977f5e096b0de8456 100644 (file)
@@ -3614,7 +3614,9 @@ void Locker::handle_file_lock(ScatterLock *lock, MLock *m)
     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!