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.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
|
||||
rm -f $seq.full
|
||||
[ "X$TEST_DIR" = "X" ] && exit 1
|
||||
cd $TEST_DIR
|
||||
rm -fr test
|
||||
@@ -59,17 +71,31 @@ mkdir test || exit 1
|
||||
cd $TEST_DIR/test
|
||||
mount > t_mtab
|
||||
|
||||
$here/src/t_mtab 2 &
|
||||
$here/src/t_mtab 2 &
|
||||
$here/src/t_mtab 2 &
|
||||
wait
|
||||
mtab()
|
||||
{
|
||||
$here/src/t_mtab 50 &
|
||||
$here/src/t_mtab 50 &
|
||||
$here/src/t_mtab 50 &
|
||||
wait
|
||||
|
||||
$here/src/t_mtab 10000
|
||||
$here/src/t_mtab 10000
|
||||
|
||||
echo directory entries:
|
||||
ls
|
||||
ls -li > $seq.full
|
||||
echo directory entries:
|
||||
ls | grep mtab
|
||||
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
|
||||
exit
|
||||
|
||||
@@ -1,7 +1,19 @@
|
||||
QA output created by 089
|
||||
completed 2 iterations
|
||||
completed 2 iterations
|
||||
completed 2 iterations
|
||||
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
|
||||
directory entries:
|
||||
t_mtab
|
||||
completed 50 iterations
|
||||
completed 50 iterations
|
||||
completed 50 iterations
|
||||
completed 10000 iterations
|
||||
directory entries:
|
||||
t_mtab
|
||||
|
||||
+6
-1
@@ -143,11 +143,14 @@ lock_mtab (void) {
|
||||
}
|
||||
we_created_lockfile = 1;
|
||||
} else {
|
||||
#if 0 /* nathans: dont limit, we are forcing lots of parallel accesses */
|
||||
static int tries = 0;
|
||||
#endif
|
||||
|
||||
/* Someone else made the link. Wait. */
|
||||
alarm(LOCK_TIMEOUT);
|
||||
if (fcntl (fd, F_SETLKW, &flock) == -1) {
|
||||
if (fcntl (fd, F_SETLKW, &flock) == -1 &&
|
||||
errno != EBUSY) {
|
||||
int errsv = errno;
|
||||
fprintf(stderr, "can't lock lock file %s: %s",
|
||||
mounted_lock, (errno == EINTR) ?
|
||||
@@ -155,6 +158,7 @@ lock_mtab (void) {
|
||||
exit(1);
|
||||
}
|
||||
alarm(0);
|
||||
#if 0 /* nathans: dont limit, we are forcing lots of parallel accesses */
|
||||
/* Limit the number of iterations - maybe there
|
||||
still is some old /etc/mtab~ */
|
||||
if (tries++ > 3) {
|
||||
@@ -166,6 +170,7 @@ lock_mtab (void) {
|
||||
}
|
||||
sleep(1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
close (fd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user