mirror of
https://github.com/versity/scoutfs.git
synced 2025-12-23 05:25:18 +00:00
Use T_D0/1 instead of T_M0 here.
Use of T_M0 and variants should be reserved for e.g. scoutfs <subcommand> -p <mountpoint> type of usages. Tests should create individual content files in the assigned subdirectory. Signed-off-by: Auke Kok <auke.kok@versity.com>
This commit is contained in:
@@ -8,19 +8,19 @@ t_require_mounts 2
|
|||||||
echo "=== renameat2 noreplace flag test"
|
echo "=== renameat2 noreplace flag test"
|
||||||
|
|
||||||
# give each mount their own dir (lock group) to minimize create contention
|
# give each mount their own dir (lock group) to minimize create contention
|
||||||
mkdir $T_M0/dir0
|
mkdir $T_D0/dir0
|
||||||
mkdir $T_M1/dir1
|
mkdir $T_D1/dir1
|
||||||
|
|
||||||
echo "=== run two asynchronous calls to renameat2 NOREPLACE"
|
echo "=== run two asynchronous calls to renameat2 NOREPLACE"
|
||||||
for i in $(seq 0 100); do
|
for i in $(seq 0 100); do
|
||||||
# prepare inputs in isolation
|
# prepare inputs in isolation
|
||||||
touch "$T_M0/dir0/old0"
|
touch "$T_D0/dir0/old0"
|
||||||
touch "$T_M1/dir1/old1"
|
touch "$T_D1/dir1/old1"
|
||||||
|
|
||||||
# race doing noreplace renames, both can't succeed
|
# race doing noreplace renames, both can't succeed
|
||||||
dumb_renameat2 -n "$T_M0/dir0/old0" "$T_M0/dir0/sharednew" 2> /dev/null &
|
dumb_renameat2 -n "$T_D0/dir0/old0" "$T_D0/dir0/sharednew" 2> /dev/null &
|
||||||
pid0=$!
|
pid0=$!
|
||||||
dumb_renameat2 -n "$T_M1/dir1/old1" "$T_M1/dir0/sharednew" 2> /dev/null &
|
dumb_renameat2 -n "$T_D1/dir1/old1" "$T_D1/dir0/sharednew" 2> /dev/null &
|
||||||
pid1=$!
|
pid1=$!
|
||||||
|
|
||||||
wait $pid0
|
wait $pid0
|
||||||
@@ -31,7 +31,7 @@ for i in $(seq 0 100); do
|
|||||||
test "$rc0" == 0 -a "$rc1" == 0 && t_fail "both renames succeeded"
|
test "$rc0" == 0 -a "$rc1" == 0 && t_fail "both renames succeeded"
|
||||||
|
|
||||||
# blow away possible files for either race outcome
|
# blow away possible files for either race outcome
|
||||||
rm -f "$T_M0/dir0/old0" "$T_M1/dir1/old1" "$T_M0/dir0/sharednew" "$T_M1/dir1/sharednew"
|
rm -f "$T_D0/dir0/old0" "$T_D1/dir1/old1" "$T_D0/dir0/sharednew" "$T_D1/dir1/sharednew"
|
||||||
done
|
done
|
||||||
|
|
||||||
t_pass
|
t_pass
|
||||||
|
|||||||
Reference in New Issue
Block a user