mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
generic/530: revert commit f8f5774722
Commit f8f5774722 ("generic/530: fix shutdown failure of generic/530 in
overlay") improperly clears an overlayfs test failure by shutting down
the filesystem after all the tempfiles are closed, which totally defeats
the purpose of both generic/530 and xfs/501. Revert this commit so we
can fix it properly.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
committed by
Eryu Guan
parent
cfbd28d6c4
commit
3fac0b7c31
@@ -24,6 +24,7 @@ static int min_fd = -1;
|
||||
static int max_fd = -1;
|
||||
static unsigned int nr_opened = 0;
|
||||
static float start_time;
|
||||
static int shutdown_fs = 0;
|
||||
|
||||
void clock_time(float *time)
|
||||
{
|
||||
@@ -68,6 +69,22 @@ void die(void)
|
||||
end_time - start_time);
|
||||
fflush(stdout);
|
||||
|
||||
if (shutdown_fs) {
|
||||
/*
|
||||
* Flush the log so that we have to process the
|
||||
* unlinked inodes the next time we mount.
|
||||
*/
|
||||
int flag = XFS_FSOP_GOING_FLAGS_LOGFLUSH;
|
||||
int ret;
|
||||
|
||||
ret = ioctl(min_fd, XFS_IOC_GOINGDOWN, &flag);
|
||||
if (ret) {
|
||||
perror("shutdown");
|
||||
exit(2);
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
clock_time(&start_time);
|
||||
for (fd = min_fd; fd <= max_fd; fd++)
|
||||
close(fd);
|
||||
@@ -143,6 +160,8 @@ int main(int argc, char *argv[])
|
||||
if (ret)
|
||||
perror(argv[1]);
|
||||
}
|
||||
if (argc > 2 && !strcmp(argv[2], "shutdown"))
|
||||
shutdown_fs = 1;
|
||||
|
||||
clock_time(&start_time);
|
||||
while (1)
|
||||
|
||||
+1
-3
@@ -49,9 +49,7 @@ ulimit -n $max_files
|
||||
|
||||
# Open a lot of unlinked files
|
||||
echo create >> $seqres.full
|
||||
$here/src/t_open_tmpfiles $SCRATCH_MNT >> $seqres.full
|
||||
_scratch_shutdown -f
|
||||
|
||||
$here/src/t_open_tmpfiles $SCRATCH_MNT shutdown >> $seqres.full
|
||||
|
||||
# Unmount to prove that we can clean it all
|
||||
echo umount >> $seqres.full
|
||||
|
||||
+1
-3
@@ -54,9 +54,7 @@ ulimit -n $max_files
|
||||
|
||||
# Open a lot of unlinked files
|
||||
echo create >> $seqres.full
|
||||
$here/src/t_open_tmpfiles $SCRATCH_MNT >> $seqres.full
|
||||
_scratch_shutdown -f
|
||||
|
||||
$here/src/t_open_tmpfiles $SCRATCH_MNT shutdown >> $seqres.full
|
||||
|
||||
# Unmount to prove that we can clean it all
|
||||
echo umount >> $seqres.full
|
||||
|
||||
Reference in New Issue
Block a user