We deadlock if we try to wrlock and xlock the same lock. This was
happening during multi-mds rename when the versionlock was in the xlock
set.
Signed-off-by: Sage Weil <sage@newdream.net>
// augment xlock with a versionlock?
if ((*p)->get_type() == CEPH_LOCK_DN) {
CDentry *dn = (CDentry*)(*p)->get_parent();
+
+ if (xlocks.count(&dn->versionlock))
+ continue; // we're xlocking the versionlock too; don't wrlock it!
+
if (mdr->is_master()) {
// master. wrlock versionlock so we can pipeline dentry updates to journal.
wrlocks.insert(&dn->versionlock);