local FAILIDX=${3:-$OSTIDX}
local ofacet=ost$((OSTIDX + 1))
- test_mkdir -p -c1 $DIR/$tdir
+ mkdir_on_mdt0 $DIR/$tdir
local mdtidx=$($LFS getstripe -m $DIR/$tdir)
local mfacet=mds$((mdtidx + 1))
echo OSTIDX=$OSTIDX MDTIDX=$mdtidx
reset_enospc
rm -f $DIR/$tdir/$tfile
- test_mkdir $DIR/$tdir
+ mkdir_on_mdt0 $DIR/$tdir
$MCREATE $DIR/$tdir/$tfile || error "mcreate $DIR/$tdir/$tfile failed"
$TRUNCATE $DIR/$tdir/$tfile 80000000 ||
error "truncate $DIR/$tdir/$tfile failed"
local atime_diff=$(do_facet $SINGLEMDS \
lctl get_param -n mdd.*MDT0000*.atime_diff)
rm -rf $DIR/$tdir
- mkdir -p $DIR/$tdir
+ mkdir_on_mdt0 $DIR/$tdir
# test setting directory atime to future
touch -a -d @$TEST_39_ATIME $DIR/$tdir
[[ $MDS1_VERSION -lt $(version_code 2.7.54) ]] &&
skip "Need MDS version at least 2.7.54"
- mkdir -p $DIR/$tdir || error "failed to create $DIR/$tdir"
+ mkdir_on_mdt0 $DIR/$tdir || error "failed to create $DIR/$tdir"
cancel_lru_locks mdc
local nsdir="ldlm.namespaces.*-MDT0000-mdc-*"
[[ $MDS1_VERSION -lt $(version_code 2.7.54) ]] &&
skip "Need MDS version at least 2.7.54"
- mkdir -p $DIR/$tdir || error "failed to create $DIR/$tdir"
+ mkdir_on_mdt0 $DIR/$tdir || error "failed to create $DIR/$tdir"
cancel_lru_locks mdc
local low_wm=$(do_facet mds1 $LCTL get_param -n \
changelog_users $SINGLEMDS | grep -q $cl_user ||
error "User $cl_user not found in changelog_users"
+ mkdir_on_mdt0 $DIR/$tdir
+
# change something
test_mkdir -p $DIR/$tdir/pics/2008/zachy
changelog_clear 0 || error "changelog_clear failed"
[[ $MDS1_VERSION -lt $(version_code 2.3.56) ]] &&
skip "Need MDS version at least 2.3.56"
- mkdir -p $DIR/$tdir || error "creating dir $DIR/$tdir"
+ mkdir_on_mdt0 $DIR/$tdir || error "creating dir $DIR/$tdir"
echo aaa > $DIR/$tdir/$tfile
#define OBD_FAIL_MDS_NEGATIVE_POSITIVE 0x148
local cmd
# mkdir
- cmd="mkdir $DIR/$tdir"
+ cmd="$LFS mkdir -i 0 -c 1 $DIR/$tdir"
verify_jobstats "$cmd" "$SINGLEMDS"
# rmdir
cmd="rmdir $DIR/$tdir"
[ $left -ge 0 ] && wait_update_facet $SINGLEMDS \
"lctl get_param *.*.job_stats | grep -c 'job_id.*mkdir'" \
"0" $left
- cmd="mkdir $DIR/$tdir.expire"
+ cmd="$LFS mkdir -i 0 -c 1 $DIR/$tdir.expire"
verify_jobstats "$cmd" "$SINGLEMDS"
[ $(do_facet $SINGLEMDS lctl get_param *.*.job_stats |
grep -c "job_id.*mkdir") -gt 1 ] && error "old jobstats not expired"
local OSTIDX=0
# create on MDT0000 so the last_id and next_id are correct
- mkdir $DIR/$tdir
+ mkdir_on_mdt0 $DIR/$tdir
local OST=$($LFS df $DIR | awk '/OST:'$OSTIDX'/ { print $1 }')
OST=${OST%_UUID}
local a_fid
local b_fid
- mkdir -p $DIR/$tdir
+ mkdir_on_mdt0 $DIR/$tdir
mkdir $DIR/$tdir/migrate_dir
mkdir $DIR/$tdir/other_dir
touch $DIR/$tdir/migrate_dir/a
test_242() {
remote_mds_nodsh && skip "remote MDS with nodsh"
- mkdir -p $DIR/$tdir
+ mkdir_on_mdt0 $DIR/$tdir
touch $DIR/$tdir/$tfile
#define OBD_FAIL_MDS_READPAGE_PACK 0x105
grep -q subtree ||
skip "Fileset feature is not supported"
- mkdir $DIR/$tdir || error "mkdir $tdir failed"
+ mkdir_on_mdt0 $DIR/$tdir || error "mkdir $tdir failed"
$LFS mkdir -i $((MDSCOUNT - 1)) $DIR/$tdir/remote ||
error "mkdir remote failed"
mkdir $DIR/$tdir/remote/subdir || error "mkdir remote/subdir failed"
changelog_register || error "changelog_register failed"
rm -rf $DIR/$tdir
- mkdir -p $DIR/$tdir
+ mkdir_on_mdt0 $DIR/$tdir
changelog_clear 0 || error "changelog_clear failed"
local dom=$DIR/$tdir/dom_file
local tmp=$DIR/$tdir/tmp_file
- mkdir -p $DIR/$tdir
+ mkdir_on_mdt0 $DIR/$tdir
# basic checks for DoM component creation
$LFS setstripe -E 1024K -E 2048K -L mdt $dom 2>/dev/null &&
local file_count
- mkdir -p $DIR/$tdir
+ mkdir_on_mdt0 $DIR/$tdir
$LFS setdirstripe -i 0 -c 2 $DIR/$tdir/striped_dir ||
error "set striped dir error"
local stripe_count
local stripe_index
- mkdir $DIR/$tdir
+ mkdir_on_mdt0 $DIR/$tdir
mkdir $DIR/$tdir/normal_dir
#Checking when client cache stripe index
[ $MDSCOUNT -lt 2 ] && skip_env "needs >= 2 MDTs"
remote_mds_nodsh && skip "remote MDS with nodsh"
- mkdir -p $DIR/$tdir
+ mkdir_on_mdt0 $DIR/$tdir
#define OBD_FAIL_OUT_ENOSPC 0x1704
do_facet mds2 lctl set_param fail_loc=0x80001704
[ $MDS1_VERSION -lt $(version_code 2.10.54) ] &&
skip "MDS needs to be newer than 2.10.54"
- mkdir -p $DIR/$tdir
+ mkdir_on_mdt0 $DIR/$tdir
# Create some objects on all MDTs to trigger related logs objects
for idx in $(seq $MDSCOUNT); do
$LFS mkdir -c $MDSCOUNT -i $((idx % $MDSCOUNT)) \
fi
do_facet $SINGLEMDS zfs set quota=$(((usedkb+freekb)*1024)) $fsset
trap cleanup_805 EXIT
- mkdir $DIR/$tdir
+ mkdir_on_mdt0 $DIR/$tdir
$LFS setstripe -E 1M -c2 -E 4M -c2 -E -1 -c2 $DIR/$tdir ||
error "Can't set PFL layout"
createmany -m $DIR/$tdir/f- 1000000 && error "ENOSPC wasn't met"
stack_trap "restore_lustre_params < $save; rm -f $save" EXIT
rm -rf $DIR/$tdir || error "rm $tdir failed"
- mkdir -p $DIR/$tdir || error "mkdir $tdir failed"
+ mkdir_on_mdt0 $DIR/$tdir || error "mkdir $tdir failed"
touch $DIR/$tdir/trunc || error "touch $tdir/trunc failed"
$TRUNCATE $DIR/$tdir/trunc 1024 || error "truncate $tdir/trunc failed"
$TRUNCATE $DIR/$tdir/trunc 1048576 ||
local sync_count
- mkdir $DIR/$tdir
+ mkdir_on_mdt0 $DIR/$tdir
sync_all_data
do_facet mds1 "lctl set_param -n mdt.*.sync_count=0"
# do twice in case transaction is committed before unlock, see LU-8200
skip "DNE CoS not supported"
# remote directory create
- op_trigger_cos "mkdir $DIR/$tdir" "$LFS mkdir -i 1 $DIR/$tdir/subdir"
+ op_trigger_cos "$LFS mkdir -i 0 $DIR/$tdir" "$LFS mkdir -i 1 $DIR/$tdir/subdir"
# remote directory unlink
op_trigger_cos "$LFS mkdir -i 1 $DIR/$tdir" "rmdir $DIR/$tdir"
# striped directory create
# test 40: check non-blocking operations
test_40a() {
remote_mds_nodsh && skip "remote MDS with nodsh" && return
+
+ mkdir $DIR2/$tdir
pdo_lru_clear
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
do_nodes $(comma_list $(mdts_nodes)) \
"lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
- touch $DIR2
- mkdir $DIR1/$tfile &
+ mkdir $DIR1/$tdir/$tfile &
PID1=$!; pdo_sched
- touch $DIR2/$tfile-2
+ touch $DIR2/$tdir/$tfile-2
check_pdo_conflict $PID1 || error "create is blocked"
- mkdir $DIR2/$tfile-3
+ mkdir $DIR2/$tdir/$tfile-3
check_pdo_conflict $PID1 || error "mkdir is blocked"
- link $DIR2/$tfile-2 $DIR2/$tfile-4
+ link $DIR2/$tdir/$tfile-2 $DIR2/$tdir/$tfile-4
check_pdo_conflict $PID1 || error "link is blocked"
- mv $DIR2/$tfile-2 $DIR2/$tfile-5
+ mv $DIR2/$tdir/$tfile-2 $DIR2/$tdir/$tfile-5
check_pdo_conflict $PID1 || error "rename is blocked"
- stat $DIR2/$tfile-3 $DIR2/$tfile-4 > /dev/null
+ stat $DIR2/$tdir/$tfile-3 $DIR2/$tdir/$tfile-4 > /dev/null
check_pdo_conflict $PID1 || error "getattr is blocked"
- rm $DIR2/$tfile-4 $DIR2/$tfile-5
- rmdir $DIR2/$tfile-3
+ rm $DIR2/$tdir/$tfile-4 $DIR2/$tdir/$tfile-5
+ rmdir $DIR2/$tdir/$tfile-3
check_pdo_conflict $PID1 || error "unlink is blocked"
# all operations above shouldn't wait the first one
do_nodes $(comma_list $(mdts_nodes)) \
"lctl set_param -n fail_loc=0 2>/dev/null || true"
wait $PID1
- rm -rf $DIR/$tfile*
+ rm -rf $DIR/$tdir
return 0
}
run_test 40a "pdirops: create vs others =============="
test_40b() {
remote_mds_nodsh && skip "remote MDS with nodsh" && return
+
+ mkdir $DIR2/$tdir
pdo_lru_clear
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
do_nodes $(comma_list $(mdts_nodes)) \
"lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
- touch $DIR1/$tfile &
+ touch $DIR1/$tdir/$tfile &
PID1=$!; pdo_sched
# open|create
- touch $DIR2/$tfile-2
+ touch $DIR2/$tdir/$tfile-2
check_pdo_conflict $PID1 || error "create is blocked"
- mkdir $DIR2/$tfile-3
+ mkdir $DIR2/$tdir/$tfile-3
check_pdo_conflict $PID1 || error "mkdir is blocked"
- link $DIR2/$tfile-2 $DIR2/$tfile-4
+ link $DIR2/$tdir/$tfile-2 $DIR2/$tdir/$tfile-4
check_pdo_conflict $PID1 || error "link is blocked"
- mv $DIR2/$tfile-2 $DIR2/$tfile-5
+ mv $DIR2/$tdir/$tfile-2 $DIR2/$tdir/$tfile-5
check_pdo_conflict $PID1 || error "rename is blocked"
- stat $DIR2/$tfile-3 $DIR2/$tfile-4 > /dev/null
+ stat $DIR2/$tdir/$tfile-3 $DIR2/$tdir/$tfile-4 > /dev/null
check_pdo_conflict $PID1 || error "getattr is blocked"
- rm $DIR2/$tfile-4 $DIR2/$tfile-5
- rmdir $DIR2/$tfile-3
+ rm $DIR2/$tdir/$tfile-4 $DIR2/$tdir/$tfile-5
+ rmdir $DIR2/$tdir/$tfile-3
check_pdo_conflict $PID1 || error "unlink is blocked"
# all operations above shouldn't wait the first one
do_nodes $(comma_list $(mdts_nodes)) \
"lctl set_param -n fail_loc=0 2>/dev/null || true"
wait $PID1
- rm -rf $DIR/$tfile*
+ rm -rf $DIR/$tdir
return 0
}
run_test 40b "pdirops: open|create and others =============="
test_40c() {
remote_mds_nodsh && skip "remote MDS with nodsh" && return
+
+ mkdir $DIR2/$tdir
pdo_lru_clear
- touch $DIR1/$tfile
+ touch $DIR1/$tdir/$tfile
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
do_nodes $(comma_list $(mdts_nodes)) \
"lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
- link $DIR1/$tfile $DIR1/$tfile-0 &
+ link $DIR1/$tdir/$tfile $DIR1/$tdir/$tfile-0 &
PID1=$!; pdo_sched
# open|create
- touch $DIR2/$tfile-2
+ touch $DIR2/$tdir/$tfile-2
check_pdo_conflict $PID1 || error "create is blocked"
- mkdir $DIR2/$tfile-3
+ mkdir $DIR2/$tdir/$tfile-3
check_pdo_conflict $PID1 || error "mkdir is blocked"
- link $DIR2/$tfile-2 $DIR2/$tfile-4
+ link $DIR2/$tdir/$tfile-2 $DIR2/$tdir/$tfile-4
check_pdo_conflict $PID1 || error "link is blocked"
- mv $DIR2/$tfile-2 $DIR2/$tfile-5
+ mv $DIR2/$tdir/$tfile-2 $DIR2/$tdir/$tfile-5
check_pdo_conflict $PID1 || error "rename is blocked"
- stat $DIR2/$tfile-3 $DIR2/$tfile-4 > /dev/null
+ stat $DIR2/$tdir/$tfile-3 $DIR2/$tdir/$tfile-4 > /dev/null
check_pdo_conflict $PID1 || error "getattr is blocked"
- rm $DIR2/$tfile-4 $DIR2/$tfile-5
- rmdir $DIR2/$tfile-3
+ rm $DIR2/$tdir/$tfile-4 $DIR2/$tdir/$tfile-5
+ rmdir $DIR2/$tdir/$tfile-3
check_pdo_conflict $PID1 || error "unlink is blocked"
# all operations above shouldn't wait the first one
do_nodes $(comma_list $(mdts_nodes)) \
"lctl set_param -n fail_loc=0 2>/dev/null || true"
wait $PID1
- rm -rf $DIR/$tfile*
+ rm -rf $DIR/$tdir
return 0
}
run_test 40c "pdirops: link and others =============="
test_40d() {
remote_mds_nodsh && skip "remote MDS with nodsh" && return
+
+ mkdir $DIR2/$tdir
pdo_lru_clear
- touch $DIR1/$tfile
+ touch $DIR1/$tdir/$tfile
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
do_nodes $(comma_list $(mdts_nodes)) \
"lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
- rm $DIR1/$tfile &
+ rm $DIR1/$tdir/$tfile &
PID1=$!; pdo_sched
# open|create
- touch $DIR2/$tfile-2
+ touch $DIR2/$tdir/$tfile-2
check_pdo_conflict $PID1 || error "create is blocked"
- mkdir $DIR2/$tfile-3
+ mkdir $DIR2/$tdir/$tfile-3
check_pdo_conflict $PID1 || error "mkdir is blocked"
- link $DIR2/$tfile-2 $DIR2/$tfile-4
+ link $DIR2/$tdir/$tfile-2 $DIR2/$tdir/$tfile-4
check_pdo_conflict $PID1 || error "link is blocked"
- mv $DIR2/$tfile-2 $DIR2/$tfile-5
+ mv $DIR2/$tdir/$tfile-2 $DIR2/$tdir/$tfile-5
check_pdo_conflict $PID1 || error "rename is blocked"
- stat $DIR2/$tfile-3 $DIR2/$tfile-4 > /dev/null
+ stat $DIR2/$tdir/$tfile-3 $DIR2/$tdir/$tfile-4 > /dev/null
check_pdo_conflict $PID1 || error "getattr is blocked"
- rm $DIR2/$tfile-4 $DIR2/$tfile-5
- rmdir $DIR2/$tfile-3
+ rm $DIR2/$tdir/$tfile-4 $DIR2/$tdir/$tfile-5
+ rmdir $DIR2/$tdir/$tfile-3
check_pdo_conflict $PID1 || error "unlink is blocked"
# all operations above shouldn't wait the first one
test_40e() {
remote_mds_nodsh && skip "remote MDS with nodsh" && return
+
+ mkdir $DIR2/$tdir
pdo_lru_clear
- touch $DIR1/$tfile
+ touch $DIR1/$tdir/$tfile
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
do_nodes $(comma_list $(mdts_nodes)) \
"lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
- mv $DIR1/$tfile $DIR1/$tfile-0 &
+ mv $DIR1/$tdir/$tfile $DIR1/$tdir/$tfile-0 &
PID1=$!; pdo_sched
# open|create
- touch $DIR2/$tfile-2
+ touch $DIR2/$tdir/$tfile-2
check_pdo_conflict $PID1 || error "create is blocked"
- mkdir $DIR2/$tfile-3
+ mkdir $DIR2/$tdir/$tfile-3
check_pdo_conflict $PID1 || error "mkdir is blocked"
- link $DIR2/$tfile-2 $DIR2/$tfile-4
+ link $DIR2/$tdir/$tfile-2 $DIR2/$tdir/$tfile-4
check_pdo_conflict $PID1 || error "link is blocked"
- stat $DIR2/$tfile-3 $DIR2/$tfile-4 > /dev/null
+ stat $DIR2/$tdir/$tfile-3 $DIR2/$tdir/$tfile-4 > /dev/null
check_pdo_conflict $PID1 || error "getattr is blocked"
- rm $DIR2/$tfile-4 $DIR2/$tfile-2
- rmdir $DIR2/$tfile-3
+ rm $DIR2/$tdir/$tfile-4 $DIR2/$tdir/$tfile-2
+ rmdir $DIR2/$tdir/$tfile-3
check_pdo_conflict $PID1 || error "unlink is blocked"
# all operations above shouldn't wait the first one
do_nodes $(comma_list $(mdts_nodes)) \
"lctl set_param -n fail_loc=0 2>/dev/null || true"
wait $PID1
- rm -rf $DIR/$tfile*
+ rm -rf $DIR/$tdir
return 0
}
run_test 40e "pdirops: rename and others =============="
run_test 42f "pdirops: mkdir and rename (src) =============="
test_42g() {
+ mkdir_on_mdt0 $DIR1/$tdir
pdo_lru_clear
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
do_nodes $(comma_list $(mdts_nodes)) \
"lctl set_param -n fail_loc=0x80000145 2>/dev/null || true"
- mkdir $DIR1/$tfile &
+ mkdir $DIR1/$tdir/$tfile &
PID1=$! ; pdo_sched
- stat $DIR2/$tfile > /dev/null &
+ stat $DIR2/$tdir/$tfile > /dev/null &
PID2=$! ; pdo_sched
do_nodes $(comma_list $(mdts_nodes)) \
"lctl set_param -n fail_loc=0 2>/dev/null || true"
check_pdo_conflict $PID1 && { wait $PID1; error "getattr isn't blocked"; }
wait $PID2 ; [ $? -eq 0 ] || error "stat must succeed"
- rm -rf $DIR/$tfile*
- return 0
+ rm -rf $DIR/$tdir
}
run_test 42g "pdirops: mkdir vs getattr =============="
[[ $MDS1_VERSION -lt $(version_code 2.13.52) ]] &&
skip "Need MDS version newer than 2.13.52"
+ mkdir $DIR1/$tdir
for i in {1..100}; do
#define OBD_FAIL_ONCE|OBD_FAIL_MDS_CREATE_RACE 0x167
do_nodes $(comma_list $(mdts_nodes)) \
"lctl set_param -n fail_loc=0x80000167 2>/dev/null ||
true"
OK=0
- mkdir $DIR1/$tdir &
+ mkdir $DIR1/$tdir/sub &
PID1=$!
- mkdir $DIR2/$tdir && ((OK++))
+ mkdir $DIR2/$tdir/sub && ((OK++))
wait $PID1 && ((OK++))
(( OK == 1 )) || error "exactly one mkdir should succeed"
- rmdir $DIR1/$tdir || error "rmdir failed"
+ rmdir $DIR1/$tdir/sub || error "rmdir failed"
done
return 0
}
run_test 54 "rename locking"
test_55a() {
- mkdir -p $DIR/d1/d2 $DIR/d3 || error "(1) mkdir failed"
+ mkdir_on_mdt0 $DIR/$tdir
+ mkdir -p $DIR/$tdir/d1/d2 $DIR/$tdir/d3 || error "(1) mkdir failed"
#define OBD_FAIL_MDS_RENAME4 0x156
do_facet mds1 $LCTL set_param fail_loc=0x80000156
- mv -T $DIR/d1/d2 $DIR/d3/d2 &
+ mv -T $DIR/$tdir/d1/d2 $DIR/$tdir/d3/d2 &
PID1=$!
sleep 1
- rm -r $DIR2/d3
+ rm -r $DIR2/$tdir/d3
wait $PID1 && error "(2) mv succeeded"
- rm -rf $DIR/d1
+ rm -rf $DIR/$tdir
}
run_test 55a "rename vs unlink target dir"
test_55b()
{
- mkdir -p $DIR/d1/d2 $DIR/d3 || error "(1) mkdir failed"
+ mkdir_on_mdt0 $DIR/$tdir
+ mkdir -p $DIR/$tdir/d1/d2 $DIR/$tdir/d3 || error "(1) mkdir failed"
#define OBD_FAIL_MDS_RENAME4 0x156
do_facet mds1 $LCTL set_param fail_loc=0x80000156
- mv -T $DIR/d1/d2 $DIR/d3/d2 &
+ mv -T $DIR/$tdir/d1/d2 $DIR/$tdir/d3/d2 &
PID1=$!
sleep 1
- rm -r $DIR2/d1
+ rm -r $DIR2/$tdir/d1
wait $PID1 && error "(2) mv succeeded"
- rm -rf $DIR/d3
+ rm -rf $DIR/$tdir
}
run_test 55b "rename vs unlink source dir"
test_55c()
{
- mkdir -p $DIR/d1/d2 $DIR/d3 || error "(1) mkdir failed"
+ mkdir_on_mdt0 $DIR/$tdir
+ mkdir -p $DIR/$tdir/d1/d2 $DIR/$tdir/d3 || error "(1) mkdir failed"
#define OBD_FAIL_MDS_RENAME4 0x156
do_facet mds1 $LCTL set_param fail_loc=0x156
- mv -T $DIR/d1/d2 $DIR/d3/d2 &
+ mv -T $DIR/$tdir/d1/d2 $DIR/$tdir/d3/d2 &
PID1=$!
sleep 1
# while rename is sleeping, open and remove d3
- $MULTIOP $DIR2/d3 D_c &
+ $MULTIOP $DIR2/$tdir/d3 D_c &
PID2=$!
sleep 1
- rm -rf $DIR2/d3
+ rm -rf $DIR2/$tdir/d3
sleep 5
# while rename is sleeping 2nd time, close d3
wait $PID1 && error "(2) mv succeeded"
- rm -rf $DIR/d1
+ rm -rf $DIR/$tdir
}
run_test 55c "rename vs unlink orphan target dir"
test_55d()
{
- touch $DIR/f1
+ mkdir_on_mdt0 $DIR/$tdir
+
+ touch $DIR/$tdir/f1
#define OBD_FAIL_MDS_RENAME3 0x155
do_facet mds1 $LCTL set_param fail_loc=0x155
- mv $DIR/f1 $DIR/$tdir &
+ mv $DIR/$tdir/f1 $DIR/$tdir/$tdir &
PID1=$!
sleep 2
# while rename is sleeping, create $tdir, but as a directory
- mkdir -p $DIR2/$tdir || error "(1) mkdir failed"
+ mkdir -p $DIR2/$tdir/$tdir || error "(1) mkdir failed"
# link in reverse locking order
- ln $DIR2/f1 $DIR2/$tdir/
+ ln $DIR2/$tdir/f1 $DIR2/$tdir/$tdir/
wait $PID1 && error "(2) mv succeeded"
- rm -rf $DIR/f1
+ rm -rf $DIR/$tdir
}
run_test 55d "rename file vs link"