We were already taking rdlocks on the source tree, to make
sure that each slave MDS could traverse to the source dentry. Now,
if there are slave MDSes, we take rdlocks on each destination
ancestor to make sure the slaves can also traverse there.
This fixes an fsstress bug.
Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
xlocks.insert(&srcdn->versionlock);
if (destdn->is_projected())
xlocks.insert(&destdn->versionlock);
+ // also take rdlock on all ancestor dentries for destdn. this ensures that the
+ // destdn can be traversed to by the witnesses.
+ for (int i=0; i<(int)desttrace.size(); i++)
+ xlocks.insert(&desttrace[i]->versionlock);
}
// we need to update srci's ctime. xlock its least contended lock to do that...