mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
QA test updates - fix 044 check, shorten 083 runtime, check for EAGAIN as well as EBUSY in the mtab lock tester program.
This commit is contained in:
@@ -127,12 +127,17 @@ echo -e -n "\n\r*** XFS QA 044 - expect mount failure messages\n\r\n\r" >/dev/co
|
|||||||
|
|
||||||
echo "*** mkfs"
|
echo "*** mkfs"
|
||||||
|
|
||||||
|
# this test only works for version 1 logs currently
|
||||||
lversion=1
|
lversion=1
|
||||||
lsize=16777216
|
lsize=16777216
|
||||||
_scratch_mkfs_xfs -lsize=$lsize,version=$lversion >$tmp.mkfs0 2>&1
|
_scratch_mkfs_xfs -lsize=$lsize,version=$lversion >$tmp.mkfs0 2>&1
|
||||||
[ $? -ne 0 ] && \
|
[ $? -ne 0 ] && \
|
||||||
_notrun "Cannot mkfs for this test using MKFS_OPTIONS specified"
|
_notrun "Cannot mkfs for this test using MKFS_OPTIONS specified"
|
||||||
_filter_mkfs <$tmp.mkfs0 2>/dev/null
|
_filter_mkfs <$tmp.mkfs0 2>$tmp.mkfs1
|
||||||
|
. $tmp.mkfs1
|
||||||
|
[ $lversion -ne 1 ] && \
|
||||||
|
_notrun "Cannot run this test yet using MKFS_OPTIONS specified"
|
||||||
|
|
||||||
_check_mount
|
_check_mount
|
||||||
_check_require_logdev
|
_check_require_logdev
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ echo "*** test out-of-space handling for random write operations"
|
|||||||
|
|
||||||
# args: filesystem size/ag count/number fsstress processes
|
# args: filesystem size/ag count/number fsstress processes
|
||||||
|
|
||||||
workout 100m 6 30
|
workout 100m 6 15
|
||||||
|
|
||||||
echo "*** done"
|
echo "*** done"
|
||||||
status=0
|
status=0
|
||||||
|
|||||||
+8
-4
@@ -59,7 +59,9 @@ setlkw_timeout (int sig) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
lock_mtab (void) {
|
lock_mtab (void) {
|
||||||
|
#if 0 /* nathans: dont limit, we are forcing lots of parallel accesses */
|
||||||
int tries = 3;
|
int tries = 3;
|
||||||
|
#endif
|
||||||
char linktargetfile[PATH_MAX + 20];
|
char linktargetfile[PATH_MAX + 20];
|
||||||
|
|
||||||
if (!signals_have_been_setup) {
|
if (!signals_have_been_setup) {
|
||||||
@@ -120,10 +122,12 @@ lock_mtab (void) {
|
|||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
int errsv = errno;
|
int errsv = errno;
|
||||||
/* Strange... Maybe the file was just deleted? */
|
/* Strange... Maybe the file was just deleted? */
|
||||||
|
#if 0 /* nathans: dont limit, we are forcing lots of parallel accesses */
|
||||||
if (errno == ENOENT && tries-- > 0)
|
if (errno == ENOENT && tries-- > 0)
|
||||||
|
#endif
|
||||||
|
if (errno == ENOENT)
|
||||||
continue;
|
continue;
|
||||||
fprintf(stderr, "can't open lock file %s: %s "
|
fprintf(stderr, "can't open lock file %s: %s\n",
|
||||||
"(use -n flag to override)",
|
|
||||||
mounted_lock, strerror (errsv));
|
mounted_lock, strerror (errsv));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@@ -136,7 +140,7 @@ lock_mtab (void) {
|
|||||||
if (j == 0) {
|
if (j == 0) {
|
||||||
/* We made the link. Now claim the lock. */
|
/* We made the link. Now claim the lock. */
|
||||||
if (fcntl (fd, F_SETLK, &flock) == -1 &&
|
if (fcntl (fd, F_SETLK, &flock) == -1 &&
|
||||||
errno != EBUSY) {
|
errno != EBUSY && errno != EAGAIN) {
|
||||||
int errsv = errno;
|
int errsv = errno;
|
||||||
printf(_("Can't lock lock file %s: %s\n"),
|
printf(_("Can't lock lock file %s: %s\n"),
|
||||||
mounted_lock, strerror (errsv));
|
mounted_lock, strerror (errsv));
|
||||||
@@ -151,7 +155,7 @@ lock_mtab (void) {
|
|||||||
/* 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) {
|
errno != EBUSY && errno != EAGAIN) {
|
||||||
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) ?
|
||||||
|
|||||||
Reference in New Issue
Block a user