test_2000() {
local td=$DIR2/$tdir
local td2=$DIR/$tdir/$tdir-2
stack_trap "umount $MOUNT2"
mount_client $MOUNT2 || error "mount_client on $MOUNT2 failed"
test_mkdir -c1 -i0 $DIR2/$tdir || error "mkdir $td failed"
mkdir $DIR/$tdir/$tdir-2 || error "mkdir $td2 failed"
touch $DIR/$tdir/a
touch $DIR/$tdir/$tdir-2/b
$LFS path2fid $DIR/$tdir
$LFS path2fid $DIR/$tdir/$tdir-2
stat $DIR/$tdir/a $DIR/$tdir/$tdir-2/b \
$DIR2/$tdir/a $DIR2/$tdir/$tdir-2/b >&/dev/null
#define OBD_FAIL_MDS_RENAME 0x153
do_facet mds1 $LCTL set_param fail_loc=0x153
mrename $DIR1/$tdir/a $DIR1/$tdir/$tdir-2/b &
local pid1=$!
sleep 0.3
mrename $DIR2/$tdir/$tdir-2/b $DIR2/$tdir/a &
local pid2=$!
do_facet mds1 $LCTL set_param fail_loc=0
wait $PID1 $PID2
}
run_test 2000 "rename test"