]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: If we're a slave, clean up xlocks when we export an inode.
authorGreg Farnum <gregory.farnum@dreamhost.com>
Thu, 31 Mar 2011 21:02:48 +0000 (14:02 -0700)
committerSage Weil <sage@newdream.net>
Mon, 18 Apr 2011 17:40:10 +0000 (10:40 -0700)
Because we can do an inode import during a rename that skips the usual
channels, we were getting into an odd state with the xlocks (which we
did as a slave for an inode that we exported away). Clean up the
record of these xlocks for inodes before we get into the request
cleanup (at which point we are labeled as no-longer-auth, and the
standard cleanup routines will break).

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/mds/Server.cc

index 2c3e3795c220c8e3a3e0b7d37c17fd6b0c74670a..cc9e17341b0f156e8b55c787066979cbdab2e77e 100644 (file)
@@ -5674,6 +5674,16 @@ void Server::_commit_slave_rename(MDRequest *mdr, int r,
     }
 
     // drop our pins
+    if (srcdn->is_auth()) {
+      // we exported, clear out any xlocks that we moved to another MDS
+      set<SimpleLock*>::iterator i = mdr->xlocks.begin();
+      while(i != mdr->xlocks.end()) {
+        SimpleLock *lock = *i;
+        lock->put_xlock();
+        mdr->xlocks.erase(i++);
+        mdr->locks.erase(lock);
+      }
+    }
     mdr->cleanup();
 
     mdlog->submit_entry(le, new C_MDS_CommittedSlave(this, mdr));