mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
Exercise mtab renames on different directory layouts too, and increase #procs. Still no joy. :(
This commit is contained in:
@@ -51,7 +51,19 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
|
|||||||
. ./common.rc
|
. ./common.rc
|
||||||
. ./common.filter
|
. ./common.filter
|
||||||
|
|
||||||
|
addentries()
|
||||||
|
{
|
||||||
|
count=$1
|
||||||
|
pattern="%0$2d"
|
||||||
|
|
||||||
|
while [ $count -gt 0 ]; do
|
||||||
|
touch `printf $pattern $count`
|
||||||
|
count=`expr $count - 1`
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
# real QA test starts here
|
# real QA test starts here
|
||||||
|
rm -f $seq.full
|
||||||
[ "X$TEST_DIR" = "X" ] && exit 1
|
[ "X$TEST_DIR" = "X" ] && exit 1
|
||||||
cd $TEST_DIR
|
cd $TEST_DIR
|
||||||
rm -fr test
|
rm -fr test
|
||||||
@@ -59,17 +71,31 @@ mkdir test || exit 1
|
|||||||
cd $TEST_DIR/test
|
cd $TEST_DIR/test
|
||||||
mount > t_mtab
|
mount > t_mtab
|
||||||
|
|
||||||
$here/src/t_mtab 2 &
|
mtab()
|
||||||
$here/src/t_mtab 2 &
|
{
|
||||||
$here/src/t_mtab 2 &
|
$here/src/t_mtab 50 &
|
||||||
wait
|
$here/src/t_mtab 50 &
|
||||||
|
$here/src/t_mtab 50 &
|
||||||
|
wait
|
||||||
|
|
||||||
$here/src/t_mtab 10000
|
$here/src/t_mtab 10000
|
||||||
|
|
||||||
echo directory entries:
|
echo directory entries:
|
||||||
ls
|
ls | grep mtab
|
||||||
ls -li > $seq.full
|
echo directory entries >> $here/$seq.full
|
||||||
|
ls -li >> $here/$seq.full
|
||||||
|
}
|
||||||
|
|
||||||
|
# directory with only a few entries
|
||||||
|
mtab
|
||||||
|
|
||||||
|
# directory with a hundred more entries, each 4chars wide
|
||||||
|
addentries 100 4
|
||||||
|
mtab
|
||||||
|
|
||||||
|
# directory with a thousand more entries, each 8chars wide
|
||||||
|
addentries 1000 8
|
||||||
|
mtab
|
||||||
|
|
||||||
# success, all done
|
|
||||||
status=0
|
status=0
|
||||||
exit
|
exit
|
||||||
|
|||||||
@@ -1,7 +1,19 @@
|
|||||||
QA output created by 089
|
QA output created by 089
|
||||||
completed 2 iterations
|
completed 50 iterations
|
||||||
completed 2 iterations
|
completed 50 iterations
|
||||||
completed 2 iterations
|
completed 50 iterations
|
||||||
|
completed 10000 iterations
|
||||||
|
directory entries:
|
||||||
|
t_mtab
|
||||||
|
completed 50 iterations
|
||||||
|
completed 50 iterations
|
||||||
|
completed 50 iterations
|
||||||
|
completed 10000 iterations
|
||||||
|
directory entries:
|
||||||
|
t_mtab
|
||||||
|
completed 50 iterations
|
||||||
|
completed 50 iterations
|
||||||
|
completed 50 iterations
|
||||||
completed 10000 iterations
|
completed 10000 iterations
|
||||||
directory entries:
|
directory entries:
|
||||||
t_mtab
|
t_mtab
|
||||||
|
|||||||
+6
-1
@@ -143,11 +143,14 @@ lock_mtab (void) {
|
|||||||
}
|
}
|
||||||
we_created_lockfile = 1;
|
we_created_lockfile = 1;
|
||||||
} else {
|
} else {
|
||||||
|
#if 0 /* nathans: dont limit, we are forcing lots of parallel accesses */
|
||||||
static int tries = 0;
|
static int tries = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Someone else made the link. Wait. */
|
/* Someone else made the link. Wait. */
|
||||||
alarm(LOCK_TIMEOUT);
|
alarm(LOCK_TIMEOUT);
|
||||||
if (fcntl (fd, F_SETLKW, &flock) == -1) {
|
if (fcntl (fd, F_SETLKW, &flock) == -1 &&
|
||||||
|
errno != EBUSY) {
|
||||||
int errsv = errno;
|
int errsv = errno;
|
||||||
fprintf(stderr, "can't lock lock file %s: %s",
|
fprintf(stderr, "can't lock lock file %s: %s",
|
||||||
mounted_lock, (errno == EINTR) ?
|
mounted_lock, (errno == EINTR) ?
|
||||||
@@ -155,6 +158,7 @@ lock_mtab (void) {
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
alarm(0);
|
alarm(0);
|
||||||
|
#if 0 /* nathans: dont limit, we are forcing lots of parallel accesses */
|
||||||
/* Limit the number of iterations - maybe there
|
/* Limit the number of iterations - maybe there
|
||||||
still is some old /etc/mtab~ */
|
still is some old /etc/mtab~ */
|
||||||
if (tries++ > 3) {
|
if (tries++ > 3) {
|
||||||
@@ -166,6 +170,7 @@ lock_mtab (void) {
|
|||||||
}
|
}
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
close (fd);
|
close (fd);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user