fstests: concurrent test execution
cover fstests: concurrent test execution
Hi folks,
This patchset introduces the ability to run fstests concurrently instead of serially as the current check script does. A git branch containing this patchset can be pulled from here:
https://git.kernel.org/pub/scm/linux/kernel/git/dgc/xfstests-dev.git check-parallel
The motivation for this is the ever growing runtime of fstests as more tests are added, along with the extremely low resource usage of individual tests. This means that a typical machine running fstests is under-utilised and a single auto group test set execution takes hours.
Yes, I know that I could scale out testing by running lots of little VMs at once, and I already do that. The problem is that I don't get back a complete auto test run result for hours. Want to check that a one-line fix has not caused any regressions? That's, at minimum, an overnight wait for the test farm to crunch through a dozen configs.
On my 64p/128GB RAM VM, 'check -g auto -s xfs -x dump' typically takes around 230-240 minutes to run. With this patchset applied, it runs the same set of tests in 8-10 minutes. I can run ~25 complete auto group test sets with check-parallel in the same time it takes check to run one.
IOWs, I can have the most common config complete a full regression test run as fast as I can turn around a new kernel with a new change to test. I have CPU, memory and IO to burn in my test machines, but what I lack is instant feedback for the change I just made. check-parallel is fast enough that it gives me pretty much instant feedback....
Most of this patchset is preparing infrastructure for concurrent test execution and fixing bugs in tests that I've found whilst getting concurrent execution working reliably. The infrastructure changes center around:
- getting rid of killall - there's nothing quite like one test killing the processes of 15 other tests at the same time...
- cleaning up background process instantiation and reaping, which is a lot more important when an interrupt needs to kill hundreds of processes instead of just a couple.
- isolating error reporting (e.g. dmesg filtering) so that one test failure doesn't trigger lots of other false failure detections
- sanitising the use of loopback devices
- avoiding the use of fixed device names - multiple tests need to use dm-flakey, dm-error, etc devices at the same time, so each test needs a unique device name
- marking tests that are unreliable when outside perturbations occur. These include tests that expect to find delalloc extents, write specific offset patterns in memory then sync them to create specific layouts, etc. e.g. If another test runs sync(1), then those write patterns no longer produce the expected output.
- taming tests that weren't designed for high CPU count machines
- replacing udevadm settle calls because udev is -never- idle when there are tens to hundreds of block devices and filesystems being rapidly set up and torn down.
- converting sync(1) and sync(2) to syncfs(2) to avoid ihaving hundreds of concurrent superblock list traversals lock-stepping with multiple mount/unmounts every second.
There are lots of little other things, but those are the main test and test infrastructure changes. Some of these are big - the fsstress execution rework touches 105 files, but it now means that every single fsstress execution in fstests is controlled by 4 helper functions:
_run_fsstress() - run fsstress synchronously
_run_fsstress_bg - run fsstress in background
_wait_for_fsstress - wait for background fsstress
_kill_fsstress - kill+wait for background fsstress
The test infrastructure also automatically handles cleanup of fsstress processes when the test is interrupted, so tests using fsstress don't need a custom _cleanup() function just to call _kill_fsstress(). This is something that should have been done a long time ago, but now it is critical for being able to manage multiple independent concurrent fsstress invocations sanely.
There are some tests that just can't be run reliably in a concurrent environment - if there is outside interference in, say, page cache flushing then the tests fail. These tests have been added to the "unreliable_in_parallel" test group with a comment explaining why they are unreliable. The check-parallel script automatically excludes this test group.
The only remaining set of tests that are somewhat flakey are the tests that exercise quotas. Quota tests randomly fail for various reasons. Sometimes they don't detect EDQUOT conditions. Sometimes repquota emits weird "device not found" errors. Sometimes grace periods don't start, sometimes they don't time out, or time out and then don't trigger EDQUOT. I don't know why these weird things are happening yet, and until I properly integrate test group selection into check-parallel I can't really isolate the quota tests to focus on them alone.
There are several patches that speed up test runtime. There were several tests that were taking 12-15 minutes to run each, and these made up >95% of the entire check-parallel runtime. In general, these tests have been made to run with more concurrency to speed them up. the result is that the longest individual test runtime has dropped to around 7 minutes, and the elapsed runtime for check-parallel has dropped to 8-10 minutes.
Hence there are 39 patches that are doing prep work on tests and infrastructure to make tests run reliabily in concurrent test contexts. The last patch is the check-parallel runner script that runs the tests concurrently.
The check-parallel script is still very rudimentary. I hard coded the tests it runs (generic+xfs auto tests) and the concurrency so that I could run explicit sets of tests with './check --exact-order <list>'. It is pointed at a mounted directory, and it creates all the infrastructure it needs to run the tests within that directory.
This enabled me to break up the tests across a set of identical runner process contexts. Each runner does:
- create runner directory
- create test and scratch image files
- create loopback devices for test and scratch devices
- sets up results directories
- execute check in it's own private mount namespace so it can't see any of the mounts that other runners are using.
- tears down loopback devices
- reports test failures.
If you run with the same directory over and over again, then it reuses the same runner infrastructure and test and scratch image files. The results directories are not overwritten as they are date-stamped, hence using the same mount point automatically creates a result archive for later data mining.
A typical target directory (/mnt/xfs) looks like:
/mnt/xfs/runner-0/.../mnt/xfs/runner-1/...
..../mnt/xfs/runner-63/...
And each runner directory:
log
results-2024-11-19-11:22:25/...
results-2024-11-19-12:36:28/...
.....
results-2024-11-27-13:32:42/...
scratch/
scratch.img
test/
test.img
The log file is the check output for that runner and should look familiar:
SECTION -- xfs FSTYP -- xfs (debug) PLATFORM -- Linux/x86_64 test1 6.12.0-dgc+ #297 SMP PREEMPT_DYNAMIC Wed Nov 27 08:13:06 AEDT 2024 MKFS_OPTIONS -- -f -m rmapbt=1 /dev/loop10
MOUNT_OPTIONS -- -o context=system_u:object_r:root_t:s0 /dev/loop10 /mnt/xfs/runner-10/scratch
generic/387 309s generic/551 49s generic/289 2s xfs/274 3s generic/677 3s generic/143 5s generic/304 1s generic/390 4s generic/427 4s xfs/103 1s generic/252 3s xfs/045 1s generic/374 2s generic/002 1s generic/534 1s generic/039 1s
generic/595 [not run] No encryption support for xfs
xfs/122 [not run] Could not compile test program (see end of /mnt/xfs/runner-10/results-2024-11-27-13:32:42/xfs/xfs/122.full)
xfs/556 [not run] xfs_scrub not found
Ran: generic/387 generic/551 generic/289 xfs/274 generic/677 generic/143 generic/304 generic/390 generic/427 xfs/103 generic/252 xfs/045 generic/374 generic/002 generic/534 generic/039 generic/595 xfs/122 xfs/556 Not run: generic/595 xfs/122 xfs/556
Passed all 19 tests
SECTION -- xfs
=========================
Ran: generic/387 generic/551 generic/289 xfs/274 generic/677 generic/143 generic/304 generic/390 generic/427 xfs/103 generic/252 xfs/045 generic/374 generic/002 generic/534 generic/039 generic/595 xfs/122 xfs/556 Not run: generic/595 xfs/122 xfs/556
Passed all 19 tests
Doing something with all the log files from a run can be done with "/mnt/xfs/*/log". e.g. grep, vi, etc.
The results directory contains the same check.{full,log,time} and test results directories as per a normal check invocation, so there's little difference in checking/analysing results with a parallel execution run.
Because the tests run in private mount namespaces, it's easy to see what check-parallel is running at any point in time using 'pstree -N mnt'. Here's a run that is hung on an unmount not completing:
$ pstree -N mnt
[4026531841]
bash
bash───pstree
[0]
sudo───sudo───check-parallel─┬─check-parallel───nsexec───check───311───fsync-tester
├─check-parallel───nsexec───check───467───open_by_handle
├─check-parallel───nsexec───check───338
├─check-parallel───nsexec───check───421
├─check-parallel───nsexec───check───441
├─check-parallel───nsexec───check───232
├─check-parallel───nsexec───check───477───open_by_handle
├─check-parallel───nsexec───check───420
├─check-parallel───nsexec───check───426───open_by_handle
├─check-parallel───nsexec───check───756───open_by_handle
├─check-parallel───nsexec───check───231
├─check-parallel───nsexec───check───475───475.fsstress───475.fsstress───{475.fsstress}
├─check-parallel───nsexec───check───388───388.fsstress───388.fsstress───{388.fsstress}
├─check-parallel───nsexec───check───259───sync
├─check-parallel───nsexec───check───622───sync
├─check-parallel───nsexec───check───318───sync
├─check-parallel───nsexec───check───753───umount
├─check-parallel───nsexec───check───086
├─check-parallel───nsexec───check───648───648.fsstress───648.fsstress───{648.fsstress}
├─check-parallel───nsexec───check───391
├─check-parallel───nsexec───check───315───sync
└─check-parallel───nsexec───check───183───bulkstat_unlinkAll the other processes are in sync or dropping caches and stuck waiting for the superblock s_umount lock that the unmount holds. Finding where it is stuck:
$ pgrep [u]mount 1081885 $ sudo cat /proc/1081885/stack [<0>] xfs_ail_push_all_sync+0x9c/0xf0 [<0>] xfs_unmount_flush_inodes+0x41/0x70 [<0>] xfs_unmountfs+0x59/0x190 [<0>] xfs_fs_put_super+0x3b/0x90 [<0>] generic_shutdown_super+0x77/0x160 [<0>] kill_block_super+0x1b/0x40 [<0>] xfs_kill_sb+0x12/0x30 [<0>] deactivate_locked_super+0x38/0x100 [<0>] deactivate_super+0x41/0x50 [<0>] cleanup_mnt+0x9f/0x160 [<0>] __cleanup_mnt+0x12/0x20 [<0>] task_work_run+0x89/0xb0 [<0>] resume_user_mode_work+0x4f/0x60 [<0>] syscall_exit_to_user_mode+0x76/0xb0 [<0>] do_syscall_64+0x74/0x130 [<0>] entry_SYSCALL_64_after_hwframe+0x76/0x7e $
Yup, known bug - a shutdown vs XFS_ISTALE inode cluster freeing issue that leaves pinned, stale inodes in the AIL.
The point I'm making here is that running tests concurrently doesn't change anything material in how you'd go about discovering and diagnosing failures. The only difference is in what that initial failure might look like. e.g. Failures that result in dmesg output will cause a huge number of tests to all fail with "check dmesg for failure output" reports. Hence there is a bit of sifting to find which test triggered the dmesg output, but failure detection still works just fine.
The check-parallel script is really only at proof-of-concept stage. It is sufficient to run tests in parallel, but that's about it. most of the work so far has gone into making the generic and XFS tests run reliably in parallel. I have not run any other tests, and haven't done full conversions of other test directories or C code in src/. e.g. the sync -> syncfs was only done for the common dir and the generic and xfs tests dirs
I do not plan to do these conversions for ext4/btrfs/overlay/etc any time soon as these conversions are mostly about improving execution time, not test correctness. Hence they are not a priority for me - the priority is further developing the concurrent execution environment. i.e. check-parallel.
To that end, I need to factor all the test selection and exclusion code out of check, and do the same with the actual test list runner loop. That way I can reuse all the existing code from within the check-parallel context rather than having to call check to do all of that work itself. I would like to get check-parallel to the point where it is mostly just s/check/check-parallel/ on the command line to move from serial to concurrent test execution.
I also want to try to integrate the config section stuff into check-parallel. This is more a case of defining what devices the config needs to create (i.e. as loop devices) rather than what devices it should be using. I think I can do this just by defining a different set of environment variables (e.g. NEED_SCRATCHDEV, NEED_LOGDEV, etc) and triggering the loop device creation from these variables.
In a way, the fact that check-parallel bootstraps it's own runtime environment almost makes it entirely zero-config. As it stands right now, you should be able to pull this patchset, create your base test directory (make sure you have at least 100GB of free disk space), run './check-parallel <test_dir> -x dump' and it Should Just Work.
At this point, the test infrastructure problems are largely solved. My focus is now on further development of the check-parallel script and integrating it tightly into the existing check infrastructure rather than open-coding test lists and configuration information. This will probably take a bit of time, so I'd like to get the bug fixes, improvements and infrastructure changes underway so I'm not left carrying a huge patchset for months....
----------------------------------------------------------------
Dave Chinner (40):
xfs/448: get rid of assert-on-failure
fstests: cleanup fsstress process management
fuzzy: don't use killall
fstests: per-test dmflakey instances
fstests: per-test dmerror instances
fstests: per-test dmhuge instances
fstests: per-test dmthin instances
fstests: per-test dmdust instances
fstests: per-test dmdelay instances
fstests: fix DM device creation/removal vs udev races
fstests: use syncfs rather than sync
fstests: clean up mount and unmount operations
fstests: clean up loop device instantiation
fstests: xfs/227 is really slow
fstests: mark tests that are unreliable when run in parallel
fstests: use udevadm wait in preference to settle xfs/442: rescale load so it's not exponential xfs/176: fix broken setup code
xfs/177: remove unused slab object count location checks
fstests: remove uses of killall where possible generic/127: reduce runtime
quota: system project quota files need to be shared
dmesg: reduce noise from other tests
fstests: stop using /tmp directly
fstests: scale some tests for high CPU count sanity generic/310: cleanup killing background processes
filter: handle mount errors from CONFIG_BLK_DEV_WRITE_MOUNTED=y
filters: add a filter that accepts EIO instead of other errors generic/085: general cleanup for reliability and debugging
fstests: don't use directory stacks
fstests: clean up a couple of dm-flakey tests
fstests: clean up termination of various tests
vfstests: some tests require the testdir to be shared xfs/629: single extent files should be within tolerance xfs/076: fix broken mkfs filtering
fstests: capture some failures to seqres.full
fstests: always use fail-at-unmount semantics for XFS generic/062: don't leave debug files in $here on failure
fstests: quota grace periods unreliable under load
fstests: check-parallel
check | 12 - check-parallel | 205 ++++++++++++++++++ common/btrfs | 4 common/config | 36 ++- common/dmdelay | 24 +- common/dmdust | 14 - common/dmerror | 74 +++--- common/dmflakey | 60 ++--- common/dmhugedisk | 21 + common/dmlogwrites | 4 common/dmthin | 12 - common/encrypt | 2 common/filter | 17 + common/fuzzy | 37 +-- common/log | 2 common/metadump | 32 +- common/overlay | 10 common/populate | 8 common/preamble | 1 common/quota | 37 --- common/rc | 166 +++++++++++--- common/repair | 2 common/report | 2 common/verity | 2 common/xfs | 2 doc/group-names.txt | 1 doc/requirement-checking.txt | 6 ltp/fsstress.c | 28 ++ src/aio-dio-regress/aio-last-ref-held-by-io.c | 5 src/dmerror | 6 tests/btrfs/004 | 11 tests/btrfs/007 | 3 tests/btrfs/012 | 4 tests/btrfs/028 | 6 tests/btrfs/049 | 4 tests/btrfs/057 | 4 tests/btrfs/060 | 14 - tests/btrfs/061 | 13 - tests/btrfs/062 | 13 - tests/btrfs/063 | 13 - tests/btrfs/064 | 13 - tests/btrfs/065 | 14 - tests/btrfs/066 | 14 - tests/btrfs/067 | 14 - tests/btrfs/068 | 14 - tests/btrfs/069 | 13 - tests/btrfs/070 | 13 - tests/btrfs/071 | 13 - tests/btrfs/072 | 14 - tests/btrfs/073 | 13 - tests/btrfs/074 | 13 - tests/btrfs/078 | 12 - tests/btrfs/100 | 4 tests/btrfs/101 | 4 tests/btrfs/136 | 6 tests/btrfs/160 | 3 tests/btrfs/192 | 12 - tests/btrfs/195 | 2 tests/btrfs/212 | 16 - tests/btrfs/232 | 4 tests/btrfs/252 | 5 tests/btrfs/261 | 2 tests/btrfs/284 | 4 tests/btrfs/286 | 2 tests/btrfs/291 | 5 tests/btrfs/320 | 6 tests/btrfs/332 | 4 tests/ext4/004 | 4 tests/ext4/057 | 14 - tests/ext4/058 | 3 tests/ext4/307 | 4 tests/generic/013 | 22 - tests/generic/015 | 2 tests/generic/019 | 13 - tests/generic/029 | 2 tests/generic/030 | 2 tests/generic/032 | 2 tests/generic/034 | 2 tests/generic/039 | 2 tests/generic/040 | 2 tests/generic/041 | 2 tests/generic/042 | 4 tests/generic/048 | 2 tests/generic/049 | 4 tests/generic/050 | 3 tests/generic/051 | 24 -- tests/generic/054 | 2 tests/generic/055 | 6 tests/generic/057 | 2 tests/generic/059 | 2 tests/generic/062 | 2 tests/generic/065 | 2 tests/generic/066 | 5 tests/generic/067 | 17 - tests/generic/068 | 7 tests/generic/070 | 12 - tests/generic/073 | 2 tests/generic/076 | 10 tests/generic/076.out | 1 tests/generic/081 | 8 tests/generic/083 | 13 - tests/generic/083.out | 1 tests/generic/084 | 12 - tests/generic/085 | 21 + tests/generic/090 | 4 tests/generic/092 | 2 tests/generic/098 | 4 tests/generic/099 | 8 tests/generic/101 | 2 tests/generic/104 | 2 tests/generic/106 | 2 tests/generic/107 | 2 tests/generic/108 | 9 tests/generic/109 | 5 tests/generic/117 | 4 tests/generic/127 | 67 +++-- tests/generic/127.out | 6 tests/generic/135 | 24 -- tests/generic/150 | 2 tests/generic/151 | 2 tests/generic/152 | 2 tests/generic/157 | 3 tests/generic/158 | 3 tests/generic/159 | 2 tests/generic/160 | 2 tests/generic/162 | 4 tests/generic/163 | 4 tests/generic/164 | 4 tests/generic/165 | 4 tests/generic/166 | 6 tests/generic/167 | 4 tests/generic/168 | 7 tests/generic/170 | 7 tests/generic/171 | 6 tests/generic/172 | 6 tests/generic/173 | 6 tests/generic/174 | 6 tests/generic/204 | 8 tests/generic/232 | 5 tests/generic/232.out | 1 tests/generic/247 | 2 tests/generic/250 | 2 tests/generic/251 | 5 tests/generic/252 | 5 tests/generic/265 | 2 tests/generic/266 | 2 tests/generic/267 | 2 tests/generic/268 | 2 tests/generic/269 | 8 tests/generic/270 | 10 tests/generic/271 | 2 tests/generic/272 | 2 tests/generic/273 | 2 tests/generic/274 | 6 tests/generic/275 | 6 tests/generic/276 | 2 tests/generic/278 | 2 tests/generic/279 | 2 tests/generic/281 | 2 tests/generic/282 | 2 tests/generic/283 | 2 tests/generic/306 | 2 tests/generic/310 | 24 +- tests/generic/315 | 2 tests/generic/317 | 2 tests/generic/318 | 2 tests/generic/321 | 4 tests/generic/323 | 7 tests/generic/325 | 2 tests/generic/328 | 4 tests/generic/329 | 5 tests/generic/330 | 2 tests/generic/331 | 7 tests/generic/332 | 4 tests/generic/333 | 6 tests/generic/334 | 6 tests/generic/335 | 2 tests/generic/336 | 9 tests/generic/341 | 2 tests/generic/342 | 2 tests/generic/343 | 2 tests/generic/347 | 2 tests/generic/348 | 2 tests/generic/353 | 2 tests/generic/361 | 8 tests/generic/373 | 4 tests/generic/374 | 4 tests/generic/376 | 2 tests/generic/382 | 2 tests/generic/387 | 2 tests/generic/388 | 24 -- tests/generic/390 | 11 tests/generic/391 | 2 tests/generic/395 | 2 tests/generic/409 | 11 tests/generic/410 | 11 tests/generic/411 | 11 tests/generic/416 | 2 tests/generic/422 | 4 tests/generic/425 | 2 tests/generic/441 | 2 tests/generic/459 | 8 tests/generic/461 | 17 - tests/generic/464 | 10 tests/generic/474 | 4 tests/generic/475 | 17 - tests/generic/476 | 15 - tests/generic/479 | 2 tests/generic/480 | 2 tests/generic/482 | 12 - tests/generic/483 | 2 tests/generic/484 | 3 tests/generic/489 | 2 tests/generic/502 | 2 tests/generic/505 | 2 tests/generic/506 | 2 tests/generic/507 | 2 tests/generic/508 | 2 tests/generic/510 | 2 tests/generic/520 | 2 tests/generic/526 | 2 tests/generic/527 | 2 tests/generic/530 | 2 tests/generic/531 | 8 tests/generic/535 | 2 tests/generic/546 | 2 tests/generic/547 | 5 tests/generic/556 | 2 tests/generic/560 | 7 tests/generic/561 | 25 +- tests/generic/563 | 24 +- tests/generic/564 | 12 - tests/generic/579 | 8 tests/generic/585 | 4 tests/generic/589 | 11 tests/generic/590 | 9 tests/generic/599 | 2 tests/generic/601 | 7 tests/generic/603 | 14 - tests/generic/604 | 2 tests/generic/610 | 2 tests/generic/620 | 1 tests/generic/628 | 4 tests/generic/629 | 4 tests/generic/631 | 2 tests/generic/632 | 2 tests/generic/640 | 2 tests/generic/642 | 10 tests/generic/648 | 25 -- tests/generic/650 | 19 - tests/generic/670 | 2 tests/generic/671 | 2 tests/generic/672 | 2 tests/generic/673 | 2 tests/generic/674 | 2 tests/generic/675 | 2 tests/generic/677 | 2 tests/generic/683 | 2 tests/generic/684 | 2 tests/generic/685 | 2 tests/generic/686 | 2 tests/generic/687 | 2 tests/generic/688 | 2 tests/generic/690 | 2 tests/generic/691 | 6 tests/generic/694 | 2 tests/generic/695 | 2 tests/generic/698 | 4 tests/generic/699 | 8 tests/generic/703 | 2 tests/generic/704 | 2 tests/generic/707 | 7 tests/generic/716 | 2 tests/generic/717 | 2 tests/generic/718 | 2 tests/generic/719 | 2 tests/generic/721 | 2 tests/generic/722 | 15 - tests/generic/725 | 2 tests/generic/726 | 2 tests/generic/727 | 2 tests/generic/730 | 2 tests/generic/731 | 2 tests/generic/732 | 4 tests/generic/735 | 2 tests/generic/738 | 2 tests/generic/741 | 2 tests/generic/743 | 4 tests/generic/744 | 10 tests/generic/745 | 4 tests/generic/746 | 18 - tests/generic/747 | 4 tests/generic/749 | 4 tests/generic/750 | 10 tests/generic/751 | 1 tests/generic/753 | 17 - tests/overlay/019 | 48 ++-- tests/overlay/021 | 8 tests/overlay/058 | 12 - tests/xfs/006 | 7 tests/xfs/011 | 11 tests/xfs/013 | 22 - tests/xfs/014 | 11 tests/xfs/016 | 4 tests/xfs/017 | 13 - tests/xfs/017.out | 1 tests/xfs/032 | 2 tests/xfs/049 | 39 ++- tests/xfs/050 | 5 tests/xfs/051 | 10 tests/xfs/052 | 2 tests/xfs/057 | 9 tests/xfs/070 | 9 tests/xfs/073 | 36 +-- tests/xfs/074 | 23 +- tests/xfs/076 | 8 tests/xfs/077 | 2 tests/xfs/078 | 20 - tests/xfs/079 | 17 - tests/xfs/104 | 14 - tests/xfs/110 | 2 tests/xfs/118 | 4 tests/xfs/119 | 2 tests/xfs/128 | 2 tests/xfs/133 | 2 tests/xfs/134 | 2 tests/xfs/137 | 2 tests/xfs/141 | 13 - tests/xfs/148 | 29 +- tests/xfs/149 | 8 tests/xfs/154 | 1 tests/xfs/158 | 4 tests/xfs/161 | 2 tests/xfs/167 | 17 - tests/xfs/168 | 8 tests/xfs/176 | 10 tests/xfs/177 | 15 - tests/xfs/186 | 4 tests/xfs/195 | 2 tests/xfs/201 | 4 tests/xfs/212 | 2 tests/xfs/216 | 23 +- tests/xfs/217 | 24 +- tests/xfs/227 | 59 +++-- tests/xfs/231 | 4 tests/xfs/232 | 10 tests/xfs/234 | 2 tests/xfs/236 | 2 tests/xfs/237 | 13 - tests/xfs/239 | 2 tests/xfs/240 | 7 tests/xfs/241 | 2 tests/xfs/243 | 11 tests/xfs/246 | 2 tests/xfs/250 | 19 + tests/xfs/259 | 13 - tests/xfs/264 | 4 tests/xfs/265 | 2 tests/xfs/270 | 2 tests/xfs/272 | 2 tests/xfs/274 | 2 tests/xfs/276 | 2 tests/xfs/289 | 4 tests/xfs/291 | 4 tests/xfs/297 | 12 - tests/xfs/300 | 8 tests/xfs/305 | 8 tests/xfs/309 | 2 tests/xfs/312 | 2 tests/xfs/313 | 2 tests/xfs/314 | 2 tests/xfs/315 | 4 tests/xfs/316 | 2 tests/xfs/317 | 2 tests/xfs/318 | 4 tests/xfs/319 | 2 tests/xfs/320 | 2 tests/xfs/321 | 2 tests/xfs/322 | 2 tests/xfs/323 | 2 tests/xfs/324 | 2 tests/xfs/325 | 4 tests/xfs/326 | 4 tests/xfs/327 | 2 tests/xfs/420 | 2 tests/xfs/421 | 2 tests/xfs/423 | 2 tests/xfs/438 | 2 tests/xfs/440 | 8 tests/xfs/442 | 15 - tests/xfs/448 | 6 tests/xfs/495 | 2 tests/xfs/501 | 2 tests/xfs/502 | 2 tests/xfs/507 | 2 tests/xfs/511 | 2 tests/xfs/513 | 48 +--- tests/xfs/519 | 2 tests/xfs/520 | 2 tests/xfs/521 | 8 tests/xfs/527 | 5 tests/xfs/528 | 10 tests/xfs/530 | 11 tests/xfs/538 | 4 tests/xfs/541 | 2 tests/xfs/544 | 2 tests/xfs/553 | 4 tests/xfs/558 | 7 tests/xfs/601 | 2 tests/xfs/606 | 14 - tests/xfs/607 | 6 tests/xfs/609 | 20 - tests/xfs/610 | 20 - tests/xfs/613 | 44 +-- tests/xfs/613.out | 1 tests/xfs/617 | 2 tests/xfs/629 | 6 tests/xfs/630 | 2 tests/xfs/631 | 9 tests/xfs/790 | 2 tests/xfs/791 | 2 tests/xfs/792 | 2 tests/xfs/802 | 7 423 files changed, 1827 insertions(+), 1629 deletions(-)
PATCH 1/40 xfs/448: get rid of assert-on-failure
From: Dave Chinner <[email protected]>
The bug this problem exercises has been fixed for quite some time, but the test does not run on XFS debug kernels that have fatal asserts enable. There is no reason for this now that the test does not assert fail on most kernels regularly tested, so kill the check and enable the test to run on all XFS configs.
--- tests/xfs/448 | 6 ------ 1 file changed, 6 deletions(-)
tests/xfs/448 +0 -6
@@ -13,10 +13,6 @@ # up the directory tree by running xfs_scrub will crash the # kernel in __xfs_dir3_data_check. # -# Notice: -# we should have non fatal asserts configured, because assert -# failures triggered by the intentional corrupt would crash system. -# . ./common/preamble _begin_fstest auto quick fuzzers
@@ -26,8 +22,6 @@ _begin_fstest auto quick fuzzers _require_scratch_nocheck _require_xfs_io_command "scrub" -# Corrupt XFS on purpose, and skip if assert failures would crash system. -_require_no_xfs_bug_on_assert rm -f "$seqres.full"
Signature · 1 line
2.45.2
PATCH 2/40 fstests: cleanup fsstress process management
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Lots of tests run fsstress in the background and then have to kill it and/or provide special cleanup functions to kill the background fsstress processes. They typically use $KILLALL_PROG for this.
Use of killall is problematic for running multiple tests in parallel in that one test can kill other tests' processes. However, because fsstress itself forks and runs children, there are very few avenues for shell scripts to ensure all the fsstress processes actually die.
With bash, it is especially nasty, because sending SIGTERM will result in bash outputting error messages ("Killed: ..." that will cause golden output mismatches and hence test failures. Hence we also need to be able to tell the main fstress process to die without triggering these messages.
To avoid the process tracking problems, we change to use pkill rather than killall (more options for process selection) and we stop using the $here/ltp/fsstress binary. Instead, we copy the $here/ltp/fsstress to $TEST_DIR/$seq.fsstress so that the test has a unique fsstress binary name. This allows the pkill filter to select just the fsstress processes the test has run. The fsstress binary name is held in _FSSTRESS_NAME, and the program to run is _FSSTRESS_PROG.
We also track the primary fsstress process ID, and store that in _FSSTRESS_PID. We do this so that we have a PID to wait against so that we don't return before the fsstress processes are dead. To this end, we add a SIGPIPE handler to the primary process so that it dying doesn't trigger bash 'killed' message output. We can send 'pkill -PIPE $_FSSTRESS_NAME' to all the fsstress processes and the primary process will then enter the "wait for children to die" processing loop before it exits. In this way, we can wait for the primary fsstress process and when it exits we know that all it's children have also finished and gone away. This makes killing fsstress invocations reliable and noise free.
This is accomplished by the helpers added to common/rc:
_run_fsstress
_run_fsstress_bg
_wait_for_fsstress
_kill_fstress
This also means that all fsstress invocations now obey FSSTRESS_AVOID environment restrictions, many of which didn't.
We add a call to _kill_fstress into the generic _cleanup() function. This means that tests using fsstress don't need to add a special local _cleanup function just to call _kill_fsstress() so that background fsstress processes are killed when the user interrupts the tests with ctrl-c.
Further, killall in the _cleanup() function is often used to attempt to expedite killing of foreground execution fsstress processes. This doesn't actually work because of the way bash processes interupt signals. That is, it waits for the currently executing process to finish execution, then runs the trap function. Hence a foreground fsstress won't ever be interrupted by ctrl-c. By implementing _run_fsstress() as a background process and a wait call, the wait() call is interrupted by the signal and the cleanup trap is run immediately. Hence the fsstress processes are killed immediately and the test exits cleanly almost immediately.
The result of all this is common, clean handling of fsstress execution and termination. There are a few exceptions for special cases, but the vast majority of tests that run fsstress use the above four wrapper functions exclusively.
--- common/fuzzy | 28 ++++++++++---------- common/preamble | 1 + common/rc | 59 +++++++++++++++++++++++++++++++++++++++++++ ltp/fsstress.c | 16 +++++++++--- tests/btrfs/004 | 11 ++++---- tests/btrfs/007 | 3 ++- tests/btrfs/012 | 4 +-- tests/btrfs/028 | 6 ++--- tests/btrfs/049 | 4 +-- tests/btrfs/057 | 4 +-- tests/btrfs/060 | 14 +++------- tests/btrfs/061 | 13 +++------- tests/btrfs/062 | 13 +++------- tests/btrfs/063 | 13 +++------- tests/btrfs/064 | 13 +++------- tests/btrfs/065 | 14 +++------- tests/btrfs/066 | 14 +++------- tests/btrfs/067 | 14 +++------- tests/btrfs/068 | 14 +++------- tests/btrfs/069 | 13 +++------- tests/btrfs/070 | 13 +++------- tests/btrfs/071 | 13 +++------- tests/btrfs/072 | 14 +++------- tests/btrfs/073 | 13 +++------- tests/btrfs/074 | 13 +++------- tests/btrfs/078 | 12 ++------- tests/btrfs/100 | 4 +-- tests/btrfs/101 | 4 +-- tests/btrfs/136 | 6 ++--- tests/btrfs/192 | 11 ++++---- tests/btrfs/195 | 2 +- tests/btrfs/212 | 14 +++++----- tests/btrfs/232 | 4 +-- tests/btrfs/252 | 5 ++-- tests/btrfs/261 | 2 +- tests/btrfs/284 | 4 +-- tests/btrfs/286 | 2 +- tests/btrfs/320 | 6 ++--- tests/btrfs/332 | 4 +-- tests/ext4/004 | 4 +-- tests/ext4/057 | 14 +++------- tests/ext4/058 | 3 +-- tests/ext4/307 | 4 +-- tests/generic/013 | 22 ++++------------ tests/generic/019 | 13 +++++----- tests/generic/051 | 20 +++------------ tests/generic/055 | 6 ++--- tests/generic/068 | 7 +++-- tests/generic/070 | 12 ++------- tests/generic/076 | 10 +++----- tests/generic/076.out | 1 - tests/generic/083 | 13 ++-------- tests/generic/083.out | 1 - tests/generic/117 | 4 +-- tests/generic/232 | 5 ++-- tests/generic/232.out | 1 - tests/generic/269 | 8 +++--- tests/generic/270 | 9 ++++--- tests/generic/388 | 24 ++---------------- tests/generic/390 | 11 +++----- tests/generic/409 | 9 ++++--- tests/generic/410 | 9 ++++--- tests/generic/411 | 9 ++++--- tests/generic/461 | 15 ++--------- tests/generic/475 | 17 ++++--------- tests/generic/476 | 15 +---------- tests/generic/482 | 12 ++++----- tests/generic/547 | 5 ++-- tests/generic/560 | 7 +++-- tests/generic/561 | 17 ++++--------- tests/generic/579 | 6 ++--- tests/generic/585 | 4 +-- tests/generic/589 | 7 ++--- tests/generic/642 | 10 +------- tests/generic/648 | 19 ++++---------- tests/generic/650 | 15 ++++++----- tests/generic/750 | 10 +++----- tests/generic/753 | 17 ++++--------- tests/overlay/019 | 48 ++++++++++++++++++++++++----------- tests/overlay/021 | 8 +++--- tests/xfs/006 | 7 ++--- tests/xfs/011 | 10 +++----- tests/xfs/013 | 16 ++---------- tests/xfs/017 | 13 ++-------- tests/xfs/017.out | 1 - tests/xfs/032 | 2 +- tests/xfs/049 | 4 +-- tests/xfs/051 | 14 ++-------- tests/xfs/057 | 8 +++--- tests/xfs/077 | 2 +- tests/xfs/079 | 14 ++-------- tests/xfs/104 | 14 +++------- tests/xfs/137 | 2 +- tests/xfs/141 | 12 +-------- tests/xfs/158 | 4 +-- tests/xfs/167 | 14 +++------- tests/xfs/168 | 8 +++--- tests/xfs/264 | 4 +-- tests/xfs/270 | 2 +- tests/xfs/297 | 8 +++--- tests/xfs/305 | 8 +++--- tests/xfs/442 | 10 +------- tests/xfs/538 | 4 +-- tests/xfs/609 | 20 +++------------ tests/xfs/610 | 20 +++------------ 105 files changed, 414 insertions(+), 675 deletions(-)
common/fuzzy +13 -15
@@ -12,13 +12,13 @@ _scratch_fuzz_modify() { echo "+++ stressing filesystem" mkdir -p $SCRATCH_MNT/data [ "$FSTYP" == "xfs" ] && _xfs_force_bdev data $SCRATCH_MNT/data - $FSSTRESS_PROG "${fsstress_args[@]}" -d $SCRATCH_MNT/data + _run_fsstress "${fsstress_args[@]}" -d $SCRATCH_MNT/data if [ "$FSTYP" = "xfs" ]; then if _xfs_has_feature "$SCRATCH_MNT" realtime; then mkdir -p $SCRATCH_MNT/rt _xfs_force_bdev realtime $SCRATCH_MNT/rt - $FSSTRESS_PROG "${fsstress_args[@]}" -d $SCRATCH_MNT/rt + _run_fsstress "${fsstress_args[@]}" -d $SCRATCH_MNT/rt else echo "+++ xfs realtime not configured" fi
@@ -965,7 +965,7 @@ __stress_scrub_fsx_loop() { res=$? echo "$mode fsx exits with $res at $(date)" >> $seqres.full if [ "$res" -ne 0 ] && [ "$res" -ne 124 ]; then - # Stop if fsstress returns error. Mask off + # Stop if fsx returns error. Mask off # the magic code 124 because that is how the # timeout(1) program communicates that we ran # out of time.
@@ -1096,7 +1096,7 @@ __stress_scrub_fsstress_loop() { # As of March 2022, 2 million fsstress ops should be enough to keep # any filesystem busy for a couple of hours. - local args=$(_scale_fsstress_args -p 4 -d $SCRATCH_MNT -n 2000000 "${focus[@]}" $FSSTRESS_AVOID) + local args=$(_scale_fsstress_args -p 4 -d $SCRATCH_MNT -n 2000000 "${focus[@]}") echo "Running $FSSTRESS_PROG $args" >> $seqres.full if [ -n "$remount_period" ]; then
@@ -1107,17 +1107,13 @@ __stress_scrub_fsstress_loop() { # anything. test "$mode" = "rw" && __stress_scrub_clean_scratch && continue - timeout -s TERM "$remount_period" $FSSTRESS_PROG \ - $args $rw_arg >> $seqres.full + _run_fsstress_bg $args $rw_arg >> $seqres.full + sleep $remount_period + _kill_fsstress res=$? echo "$mode fsstress exits with $res at $(date)" >> $seqres.full - if [ "$res" -ne 0 ] && [ "$res" -ne 124 ]; then - # Stop if fsstress returns error. Mask off - # the magic code 124 because that is how the - # timeout(1) program communicates that we ran - # out of time. - break; - fi + [ "$res" -ne 0 ] && break; + if [ "$mode" = "rw" ]; then mode="ro" rw_arg="-R"
@@ -1139,7 +1135,7 @@ __stress_scrub_fsstress_loop() { while __stress_scrub_running "$end" "$runningfile"; do # Need to recheck running conditions if we cleared anything __stress_scrub_clean_scratch && continue - $FSSTRESS_PROG $args >> $seqres.full + _run_fsstress $args >> $seqres.full echo "fsstress exits with $? at $(date)" >> $seqres.full done rm -f "$runningfile"
@@ -1181,7 +1177,8 @@ _scratch_xfs_stress_scrub_cleanup() { # Send SIGINT so that bash won't print a 'Terminated' message that # distorts the golden output. echo "Killing stressor processes at $(date)" >> $seqres.full - $KILLALL_PROG -INT xfs_io fsstress fsx xfs_scrub >> $seqres.full 2>&1 + _kill_fsstress + $KILLALL_PROG -INT xfs_io fsx xfs_scrub >> $seqres.full 2>&1 # Tests are not allowed to exit with the scratch fs frozen. If we # started a fs freeze/thaw background loop, wait for that loop to exit
@@ -1394,6 +1391,7 @@ _scratch_xfs_stress_scrub() { "__stress_scrub_${exerciser}_loop" "$end" "$runningfile" \ "$remount_period" "$stress_tgt" & + _FSSTRESS_PID=$! if [ -n "$freeze" ]; then __stress_scrub_freeze_loop "$end" "$runningfile" &
common/preamble +1 -0
@@ -7,6 +7,7 @@ # Standard cleanup function. Individual tests can override this. _cleanup() { + _kill_fsstress cd / rm -r -f $tmp.* }
common/rc +59 -0
65 lines not on this page · raw message
ltp/fsstress.c +13 -3
@@ -444,6 +444,7 @@ void sg_handler(int signum) {switch (signum) {case SIGTERM : +case SIGPIPE : should_stop =1 ;break ;case SIGBUS :
@@ -469,6 +470,9 @@ keep_looping(int i, int loops) {int ret; +if (should_stop) +return false; +if (deadline.tv_nsec) {struct timespec now;
@@ -732,14 +736,17 @@ int main(int argc, char **argv)perror ("sigaction failed" );exit (1 ); } +if (sigaction (SIGPIPE , &action,0 )) { +perror ("sigaction failed" ); +exit (1 ); + }for (i =0 ; i < nproc; i++) {if (fork () ==0 ) {sigemptyset (&action.sa_mask); - action.sa_handler =SIG_DFL ; -if (sigaction (SIGTERM , &action,0 )) -return 1 ; action.sa_handler = sg_handler; +if (sigaction (SIGTERM , &action,0 )) +return 1 ;if (sigaction (SIGBUS , &action,0 ))return 1 ;#ifdef HAVE_SYS_PRCTL_H
@@ -1196,6 +1203,9 @@ keep_running(opnum_t opno, opnum_t operations) {int ret; +if (should_stop) +return false; +if (deadline.tv_nsec) {struct timespec now;
tests/btrfs/004 +5 -6
@@ -17,6 +17,7 @@ noise_pid=0 # Override the default cleanup function. _cleanup() { + _kill_fsstress rm $tmp.running wait rm -f $tmp.*
@@ -159,8 +160,7 @@ workout() _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 _scratch_mount # -w ensures that the only ops are ones which cause write I/O - run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p $procs -n 2000 \ - $FSSTRESS_AVOID + _run_fsstress -d $SCRATCH_MNT -w -p $procs -n 2000 _btrfs subvolume snapshot $SCRATCH_MNT \ $SCRATCH_MNT/$snap_name
@@ -170,15 +170,14 @@ workout() # make some noise but ensure we're not touching existing data # extents. - run_check $FSSTRESS_PROG -d $SCRATCH_MNT -p $procs -n 4000 \ + _run_fsstress -d $SCRATCH_MNT -p $procs -n 4000 \ -z -f chown=3 -f link=1 -f mkdir=2 -f mknod=2 \ -f rename=2 -f setxattr=1 -f symlink=2 clean_dir="$SCRATCH_MNT/next" mkdir $clean_dir # now make more files to get a higher tree - run_check $FSSTRESS_PROG -d $clean_dir -w -p $procs -n 2000 \ - $FSSTRESS_AVOID + _run_fsstress -d $clean_dir -w -p $procs -n 2000 run_check _scratch_unmount _scratch_mount "-o atime"
@@ -186,7 +185,7 @@ workout() # make background noise while backrefs are being walked while [ -f "$tmp.running" ]; do echo background fsstress >>$seqres.full - run_check $FSSTRESS_PROG -d $SCRATCH_MNT/bgnoise -n 999 + _run_fsstress -d $SCRATCH_MNT/bgnoise -n 999 echo background rm >>$seqres.full rm -rf $SCRATCH_MNT/bgnoise/ done &
tests/btrfs/007 +2 -1
@@ -18,6 +18,7 @@ _begin_fstest auto quick rw metadata send seek # Override the default cleanup function. _cleanup() { + _kill_fsstress cd / rm -f $tmp.* rm -fr $send_files_dir
@@ -45,7 +46,7 @@ workout() _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 _scratch_mount "-o noatime" - run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n $ops $FSSTRESS_AVOID -x \ + _run_fsstress -d $SCRATCH_MNT -n $ops -x \ "$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base" _btrfs subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr
tests/btrfs/012 +2 -2
@@ -45,7 +45,7 @@ mount -t ext4 $SCRATCH_DEV $SCRATCH_MNT echo "populating the initial ext fs:" >> $seqres.full mkdir "$SCRATCH_MNT/$BASENAME" -$FSSTRESS_PROG -w -d "$SCRATCH_MNT/$BASENAME" -n 20 -p 500 >> $seqres.full +_run_fsstress -w -d "$SCRATCH_MNT/$BASENAME" -n 20 -p 500 # Create the checksum to verify later. $FSSUM_PROG -A -f -w $tmp.original "$SCRATCH_MNT/$BASENAME"
@@ -74,7 +74,7 @@ umount $SCRATCH_MNT/mnt echo "Generating new data on the converted btrfs" >> $seqres.full mkdir -p $SCRATCH_MNT/new -$FSSTRESS_PROG -w -d "$SCRATCH_MNT/new" -n 20 -p 500 >> $seqres.full +_run_fsstress -w -d "$SCRATCH_MNT/new" -n 20 -p 500 _scratch_unmount
tests/btrfs/028 +2 -4
@@ -32,8 +32,7 @@ args=`_scale_fsstress_args -z \ -f fsync=10 -n 100000 -p 2 \ -d $SCRATCH_MNT/stress_dir` echo "Run fsstress $args" >>$seqres.full -$FSSTRESS_PROG $args >>$seqres.full & -fsstress_pid=$! +_run_fsstress_bg $args echo "Start balance" >>$seqres.full _btrfs_stress_balance -d $SCRATCH_MNT >/dev/null 2>&1 &
@@ -41,8 +40,7 @@ balance_pid=$! # 30s is enough to trigger bug sleep $((30*$TIME_FACTOR)) -kill $fsstress_pid &> /dev/null -wait $fsstress_pid &> /dev/null +_kill_fsstress _btrfs_kill_stress_balance_pid $balance_pid # The qgroups accounting will be checked by 'btrfs check' (fsck) after the
tests/btrfs/049 +2 -2
@@ -39,7 +39,7 @@ args=`_scale_fsstress_args -z \ -f write=10 -f creat=10 \ -n 1000 -p 2 -d $SCRATCH_MNT/stress_dir` echo "Run fsstress $args" >>$seqres.full -$FSSTRESS_PROG $args >>$seqres.full +_run_fsstress $args >>$seqres.full # Start and pause balance to ensure it will be restored on remount echo "Start balance" >>$seqres.full
@@ -68,7 +68,7 @@ $BTRFS_UTIL_PROG balance resume "$SCRATCH_MNT" &>/dev/null [ $? -eq 0 ] || _fail "Couldn't resume balance after device add" # Add more files so that new balance won't fish immediately -$FSSTRESS_PROG $args >/dev/null 2>&1 +_run_fsstress $args # Now pause->resume balance. This ensures balance paused is properly set in # the kernel and won't trigger an assertion failure.
tests/btrfs/057 +2 -2
@@ -19,12 +19,12 @@ _scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full 2>&1 _scratch_mount # -w ensures that the only ops are ones which cause write I/O -run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p 5 -n 1000 $FSSTRESS_AVOID +_run_fsstress -d $SCRATCH_MNT -w -p 5 -n 1000 _btrfs subvolume snapshot $SCRATCH_MNT \ $SCRATCH_MNT/snap1 -run_check $FSSTRESS_PROG -d $SCRATCH_MNT/snap1 -w -p 5 -n 1000 $FSSTRESS_AVOID +_run_fsstress -d $SCRATCH_MNT/snap1 -w -p 5 -n 1000 _btrfs quota enable $SCRATCH_MNT _btrfs quota rescan -w $SCRATCH_MNT
tests/btrfs/060 +4 -10
@@ -21,10 +21,7 @@ _cleanup() if [ ! -z "$balance_pid" ]; then _btrfs_kill_stress_balance_pid $balance_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter
@@ -51,10 +48,9 @@ run_test() fi _scratch_mount >>$seqres.full 2>&1 - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start balance worker: " >>$seqres.full _btrfs_stress_balance $SCRATCH_MNT >/dev/null 2>&1 &
@@ -67,9 +63,7 @@ run_test() echo "$subvol_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid - + _wait_for_fsstress _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt unset subvol_pid _btrfs_kill_stress_balance_pid $balance_pid
tests/btrfs/061 +4 -9
@@ -20,10 +20,7 @@ _cleanup() if [ ! -z "$scrub_pid" ]; then _btrfs_kill_stress_scrub_pid $scrub_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter
@@ -47,10 +44,9 @@ run_test() fi _scratch_mount >>$seqres.full 2>&1 - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start balance worker: " >>$seqres.full _btrfs_stress_balance $SCRATCH_MNT >/dev/null 2>&1 &
@@ -63,8 +59,7 @@ run_test() echo "$scrub_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid + _wait_for_fsstress _btrfs_kill_stress_balance_pid $balance_pid unset balance_pid _btrfs_kill_stress_scrub_pid $scrub_pid
tests/btrfs/062 +4 -9
@@ -20,10 +20,7 @@ _cleanup() if [ ! -z "$defrag_pid" ]; then _btrfs_kill_stress_defrag_pid $defrag_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter
@@ -48,10 +45,9 @@ run_test() fi _scratch_mount >>$seqres.full 2>&1 - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start balance worker: " >>$seqres.full _btrfs_stress_balance $SCRATCH_MNT >/dev/null 2>&1 &
@@ -64,8 +60,7 @@ run_test() echo "$defrag_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid + _wait_for_fsstress _btrfs_kill_stress_balance_pid $balance_pid unset balance_pid _btrfs_kill_stress_defrag_pid $defrag_pid
tests/btrfs/063 +4 -9
@@ -20,10 +20,7 @@ _cleanup() if [ ! -z "$remount_pid" ]; then _btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter
@@ -47,10 +44,9 @@ run_test() fi _scratch_mount >>$seqres.full 2>&1 - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start balance worker: " >>$seqres.full _btrfs_stress_balance $SCRATCH_MNT >/dev/null 2>&1 &
@@ -63,8 +59,7 @@ run_test() echo "$remount_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid + _wait_for_fsstress _btrfs_kill_stress_balance_pid $balance_pid unset balance_pid _btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT
tests/btrfs/064 +4 -9
@@ -22,10 +22,7 @@ _cleanup() if [ ! -z "$replace_pid" ]; then _btrfs_kill_stress_replace_pid $replace_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter
@@ -57,10 +54,9 @@ run_test() _scratch_mount >>$seqres.full 2>&1 SCRATCH_DEV_POOL=$saved_scratch_dev_pool - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args # Start both balance and replace in the background. # Either balance or replace shall run, the other fails.
@@ -75,8 +71,7 @@ run_test() echo "$replace_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid + _wait_for_fsstress _btrfs_kill_stress_balance_pid $balance_pid unset balance_pid _btrfs_kill_stress_replace_pid $replace_pid
tests/btrfs/065 +4 -10
@@ -21,10 +21,7 @@ _cleanup() if [ ! -z "$replace_pid" ]; then _btrfs_kill_stress_replace_pid $replace_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter
@@ -59,10 +56,9 @@ run_test() _scratch_mount >>$seqres.full 2>&1 SCRATCH_DEV_POOL=$saved_scratch_dev_pool - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start subvolume worker: " >>$seqres.full _btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$ $subvol_mnt $stop_file >/dev/null 2>&1 &
@@ -75,9 +71,7 @@ run_test() echo "$replace_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid - + _wait_for_fsstress _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt unset subvol_pid _btrfs_kill_stress_replace_pid $replace_pid
tests/btrfs/066 +4 -10
@@ -21,10 +21,7 @@ _cleanup() if [ ! -z "$scrub_pid" ]; then _btrfs_kill_stress_scrub_pid $scrub_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter
@@ -51,10 +48,9 @@ run_test() fi _scratch_mount >>$seqres.full 2>&1 - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start subvolume worker: " >>$seqres.full _btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$ $subvol_mnt $stop_file >/dev/null 2>&1 &
@@ -67,9 +63,7 @@ run_test() echo "$scrub_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid - + _wait_for_fsstress _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt unset subvol_pid _btrfs_kill_stress_scrub_pid $scrub_pid
tests/btrfs/067 +4 -10
@@ -21,10 +21,7 @@ _cleanup() if [ ! -z "$defrag_pid" ]; then _btrfs_kill_stress_defrag_pid $defrag_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter
@@ -52,10 +49,9 @@ run_test() fi _scratch_mount >>$seqres.full 2>&1 - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start subvolume worker: " >>$seqres.full _btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$ $subvol_mnt $stop_file >/dev/null 2>&1 &
@@ -68,9 +64,7 @@ run_test() echo "$defrag_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid - + _wait_for_fsstress _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt unset subvol_pid _btrfs_kill_stress_defrag_pid $defrag_pid
tests/btrfs/068 +4 -10
@@ -22,10 +22,7 @@ _cleanup() if [ ! -z "$remount_pid" ]; then _btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter
@@ -52,10 +49,9 @@ run_test() fi _scratch_mount >>$seqres.full 2>&1 - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start subvolume worker: " >>$seqres.full _btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$ $subvol_mnt $stop_file >/dev/null 2>&1 &
@@ -68,9 +64,7 @@ run_test() echo "$remount_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid - + _wait_for_fsstress _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt unset subvol_pid _btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT
tests/btrfs/069 +4 -9
@@ -20,10 +20,7 @@ _cleanup() if [ ! -z "$scrub_pid" ]; then _btrfs_kill_stress_scrub_pid $scrub_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter
@@ -55,10 +52,9 @@ run_test() _scratch_mount >>$seqres.full 2>&1 SCRATCH_DEV_POOL=$saved_scratch_dev_pool - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start replace worker: " >>$seqres.full _btrfs_stress_replace $SCRATCH_MNT >>$seqres.full 2>&1 &
@@ -71,8 +67,7 @@ run_test() echo "$scrub_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid + _wait_for_fsstress _btrfs_kill_stress_scrub_pid $scrub_pid unset scrub_pid _btrfs_kill_stress_replace_pid $replace_pid
tests/btrfs/070 +4 -9
@@ -20,10 +20,7 @@ _cleanup() if [ ! -z "$defrag_pid" ]; then _btrfs_kill_stress_defrag_pid $defrag_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter
@@ -56,10 +53,9 @@ run_test() _scratch_mount >>$seqres.full 2>&1 SCRATCH_DEV_POOL=$saved_scratch_dev_pool - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start replace worker: " >>$seqres.full _btrfs_stress_replace $SCRATCH_MNT >>$seqres.full 2>&1 &
@@ -72,8 +68,7 @@ run_test() echo "$defrag_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid + _wait_for_fsstress _btrfs_kill_stress_replace_pid $replace_pid unset replace_pid _btrfs_kill_stress_defrag_pid $defrag_pid
tests/btrfs/071 +4 -9
@@ -20,10 +20,7 @@ _cleanup() if [ ! -z "$remount_pid" ]; then _btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter
@@ -55,10 +52,9 @@ run_test() _scratch_mount >>$seqres.full 2>&1 SCRATCH_DEV_POOL=$saved_scratch_dev_pool - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start replace worker: " >>$seqres.full _btrfs_stress_replace $SCRATCH_MNT >>$seqres.full 2>&1 &
@@ -71,8 +67,7 @@ run_test() echo "$remount_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid + _wait_for_fsstress _btrfs_kill_stress_replace_pid $replace_pid unset replace_pid _btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT
tests/btrfs/072 +4 -10
@@ -20,10 +20,7 @@ _cleanup() if [ ! -z "$scrub_pid" ]; then _btrfs_kill_stress_scrub_pid $scrub_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter
@@ -48,10 +45,9 @@ run_test() fi _scratch_mount >>$seqres.full 2>&1 - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start scrub worker: " >>$seqres.full _btrfs_stress_scrub $SCRATCH_MNT >/dev/null 2>&1 &
@@ -64,9 +60,7 @@ run_test() echo "$defrag_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid - + _wait_for_fsstress _btrfs_kill_stress_defrag_pid $defrag_pid unset defrag_pid _btrfs_kill_stress_scrub_pid $scrub_pid
tests/btrfs/073 +4 -9
@@ -20,10 +20,7 @@ _cleanup() if [ ! -z "$scrub_pid" ]; then _btrfs_kill_stress_scrub_pid $scrub_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter
@@ -47,10 +44,9 @@ run_test() fi _scratch_mount >>$seqres.full 2>&1 - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start scrub worker: " >>$seqres.full _btrfs_stress_scrub $SCRATCH_MNT >/dev/null 2>&1 &
@@ -63,8 +59,7 @@ run_test() echo "$remount_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid + _wait_for_fsstress _btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT unset remount_pid _btrfs_kill_stress_scrub_pid $scrub_pid
tests/btrfs/074 +4 -9
@@ -20,10 +20,7 @@ _cleanup() if [ ! -z "$defrag_pid" ]; then _btrfs_kill_stress_defrag_pid $defrag_pid fi - if [ ! -z "$fsstress_pid" ]; then - kill $fsstress_pid &> /dev/null - wait $fsstress_pid &> /dev/null - fi + _kill_fsstress } . ./common/filter
@@ -48,10 +45,9 @@ run_test() fi _scratch_mount >>$seqres.full 2>&1 - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` + args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! + _run_fsstress_bg $args echo -n "Start defrag worker: " >>$seqres.full _btrfs_stress_defrag $SCRATCH_MNT $with_compress >/dev/null 2>&1 &
@@ -64,8 +60,7 @@ run_test() echo "$remount_pid" >>$seqres.full echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full - wait $fsstress_pid - unset fsstress_pid + _wait_for_fsstress _btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT unset remount_pid _btrfs_kill_stress_defrag_pid $defrag_pid
tests/btrfs/078 +2 -10
@@ -16,14 +16,6 @@ . ./common/preamble _begin_fstest auto snapshot -tmp=`mktemp -d` - -# Override the default cleanup function. -_cleanup() -{ - rm -fr $tmp -} - . ./common/filter _require_scratch
@@ -39,8 +31,8 @@ workout() snapshot_cmd="$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT" snapshot_cmd="$snapshot_cmd $SCRATCH_MNT/snap_\`date +'%H_%M_%S_%N'\`" - run_check $FSSTRESS_PROG -p $procs \ - -x "$snapshot_cmd" -X $num_snapshots -d $SCRATCH_MNT -n $ops + _run_fsstress -p $procs -x "$snapshot_cmd" -X $num_snapshots \ + -d $SCRATCH_MNT -n $ops } ops=8000
tests/btrfs/100 +2 -2
@@ -13,6 +13,7 @@ _begin_fstest auto replace volume eio # Override the default cleanup function. _cleanup() { + _kill_fsstress _dmerror_cleanup rm -f $tmp.* }
@@ -39,8 +40,7 @@ error_devid=`$BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT |\ snapshot_cmd="$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT" snapshot_cmd="$snapshot_cmd $SCRATCH_MNT/snap_\`date +'%H_%M_%S_%N'\`" -run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n 200 -p 8 $FSSTRESS_AVOID -x \ - "$snapshot_cmd" -X 50 +_run_fsstress -d $SCRATCH_MNT -n 200 -p 8 -x "$snapshot_cmd" -X 50 # now load the error into the DMERROR_DEV _dmerror_load_error_table
tests/btrfs/101 +2 -2
@@ -13,6 +13,7 @@ _begin_fstest auto replace volume eio # Override the default cleanup function. _cleanup() { + _kill_fsstress _dmerror_cleanup rm -f $tmp.* }
@@ -40,8 +41,7 @@ error_devid=`$BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT |\ snapshot_cmd="$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT" snapshot_cmd="$snapshot_cmd $SCRATCH_MNT/snap_\`date +'%H_%M_%S_%N'\`" -run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n 200 -p 8 $FSSTRESS_AVOID -x \ - "$snapshot_cmd" -X 50 +_run_fsstress -d $SCRATCH_MNT -n 200 -p 8 -x "$snapshot_cmd" -X 50 # now load the error into the DMERROR_DEV _dmerror_load_error_table
tests/btrfs/136 +2 -4
@@ -34,11 +34,9 @@ BTRFS_MD5SUM="$tmp.btrfs" populate_data(){ data_path=$1 mkdir -p $data_path - args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $data_path` + args=`_scale_fsstress_args -p 20 -n 100 -d $data_path` echo "Run fsstress $args" >>$seqres.full - $FSSTRESS_PROG $args >>$seqres.full & - fsstress_pid=$! - wait $fsstress_pid + _run_fsstress $args } # Create & populate an ext3 filesystem
tests/btrfs/192 +5 -6
@@ -13,12 +13,12 @@ _begin_fstest auto replay snapshot stress recoveryloop # Override the default cleanup function. _cleanup() { - cd / + _kill_fsstress kill -q $pid1 &> /dev/null kill -q $pid2 &> /dev/null - "$KILLALL_PROG" -q $FSSTRESS_PROG &> /dev/null wait _log_writes_cleanup &> /dev/null + cd / rm -f $tmp.* }
@@ -46,8 +46,7 @@ nr_cpus=$("$here/src/feature" -o) if [ $nr_cpus -gt 8 ]; then nr_cpus=8 fi -fsstress_args=$(_scale_fsstress_args -w -d $SCRATCH_MNT -n 99999 -p $nr_cpus \ - $FSSTRESS_AVOID) +fsstress_args=$(_scale_fsstress_args -w -d $SCRATCH_MNT -n 99999 -p $nr_cpus ) _log_writes_init $SCRATCH_DEV # Discard the whole devices so when some tree pointer is wrong, it won't point
@@ -135,10 +134,10 @@ pid1=$! delete_workload & pid2=$! -"$FSSTRESS_PROG" $fsstress_args >> $seqres.full & +_run_fsstress_bg $fsstress_args sleep $runtime -"$KILLALL_PROG" -q "$FSSTRESS_PROG" &> /dev/null +_kill_fsstress kill $pid1 &> /dev/null kill $pid2 &> /dev/null wait
tests/btrfs/195 +1 -1
@@ -49,7 +49,7 @@ run_testcase() { _scratch_mount # Create random filesystem with 20k write ops - $FSSTRESS_PROG -d $SCRATCH_MNT -w -n 10000 $FSSTRESS_AVOID >>$seqres.full 2>&1 + _run_fsstress -d $SCRATCH_MNT -w -n 10000 _run_btrfs_balance_start -f -dconvert=$dst_type $SCRATCH_MNT >> $seqres.full [ $? -eq 0 ] || echo "$1: Failed convert"
tests/btrfs/212 +7 -7
@@ -13,13 +13,13 @@ _begin_fstest auto balance dangerous # Override the default cleanup function. _cleanup() { - cd / - rm -f $tmp.* + _kill_fsstress kill $balance_pid &> /dev/null kill $cancel_pid &> /dev/null - "$KILLALL_PROG" -q $FSSTRESS_PROG &> /dev/null - $BTRFS_UTIL_PROG balance cancel $SCRATCH_MNT &> /dev/null wait + $BTRFS_UTIL_PROG balance cancel $SCRATCH_MNT &> /dev/null + cd / + rm -f $tmp.* } . ./common/filter
@@ -49,7 +49,7 @@ cancel_workload() done } -$FSSTRESS_PROG -d $SCRATCH_MNT -w -n 100000 >> $seqres.full 2>/dev/null & +_run_fsstress_bg -d $SCRATCH_MNT -w -n 100000 balance_workload & balance_pid=$!
@@ -58,11 +58,11 @@ cancel_pid=$! sleep $runtime +_kill_fsstress kill $balance_pid kill $cancel_pid -"$KILLALL_PROG" -q $FSSTRESS_PROG &> /dev/null -$BTRFS_UTIL_PROG balance cancel $SCRATCH_MNT &> /dev/null wait +$BTRFS_UTIL_PROG balance cancel $SCRATCH_MNT &> /dev/null echo "Silence is golden" # success, all done
tests/btrfs/232 +2 -2
@@ -23,8 +23,8 @@ writer() trap "wait; exit" SIGTERM while true; do - args=`_scale_fsstress_args -p 20 -n 1000 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` - $FSSTRESS_PROG $args >> $seqres.full + args=`_scale_fsstress_args -p 20 -n 1000 -d $SCRATCH_MNT/stressdir` + _run_fsstress $args done }
tests/btrfs/252 +3 -2
@@ -24,6 +24,7 @@ _begin_fstest auto send balance stress _cleanup() { + _kill_fsstress if [ ! -z $balance_pid ]; then kill $balance_pid &> /dev/null wait $balance_pid
@@ -79,10 +80,10 @@ snapshot_cmd="$snapshot_cmd \"$snapshots_dir/snap_\`date +'%s%N'\`\"" # it's pointless to have them. # echo "Running fsstress..." >> $seqres.full -$FSSTRESS_PROG $FSSTRESS_AVOID -d "$data_subvol" -p 1 -w \ +_run_fsstress -d "$data_subvol" -p 1 -w \ -f subvol_create=0 -f subvol_delete=0 -f snapshot=0 \ -x "$snapshot_cmd" -X $num_snapshots \ - -n $total_fsstress_ops >> $seqres.full + -n $total_fsstress_ops snapshots=(`IFS=$'\n' ls -1 "$snapshots_dir"`)
tests/btrfs/261 +1 -1
@@ -35,7 +35,7 @@ prepare_fs() # Then use fsstress to generate some extra contents. # Disable setattr related operations, as it may set NODATACOW which will # not allow us to use btrfs checksum to verify the content. - $FSSTRESS_PROG -f setattr=0 -d $SCRATCH_MNT -w -n 3000 >> $seqres.full + _run_fsstress -f setattr=0 -d $SCRATCH_MNT -w -n 3000 sync # Save the fssum of this fs
tests/btrfs/284 +2 -2
@@ -49,8 +49,8 @@ run_send_test() # Use a single process so that in case of failure it's easier to # reproduce by using the same seed (logged in $seqres.full). - run_check $FSSTRESS_PROG -d $SCRATCH_MNT -p 1 -n $((LOAD_FACTOR * 200)) \ - -w $FSSTRESS_AVOID -x "$snapshot_cmd" + _run_fsstress -d $SCRATCH_MNT -p 1 -n $((LOAD_FACTOR * 200)) \ + -w -x "$snapshot_cmd" $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap2 \ >> $seqres.full
tests/btrfs/286 +1 -1
@@ -31,7 +31,7 @@ workload() # Use nodatasum mount option, so all data won't have checksum. _scratch_mount -o nodatasum - $FSSTRESS_PROG -p 10 -n 200 -d $SCRATCH_MNT >> $seqres.full + _run_fsstress -p 10 -n 200 -d $SCRATCH_MNT sync # Generate fssum for later verification, here we only care
tests/btrfs/320 +2 -4
@@ -28,8 +28,7 @@ _basic_test() $BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep $subvolid >> \ $seqres.full 2>&1 [ $? -eq 0 ] || _fail "couldn't find our subvols quota group" - run_check $FSSTRESS_PROG -d $SCRATCH_MNT/a -w -p 1 -n 2000 \ - $FSSTRESS_AVOID + _run_fsstress -d $SCRATCH_MNT/a -w -p 1 -n 2000 _btrfs subvolume snapshot $SCRATCH_MNT/a \ $SCRATCH_MNT/b
@@ -55,8 +54,7 @@ _rescan_test() _btrfs subvolume create $SCRATCH_MNT/a _btrfs quota enable $SCRATCH_MNT/a subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT a) - run_check $FSSTRESS_PROG -d $SCRATCH_MNT/a -w -p 1 -n 2000 \ - $FSSTRESS_AVOID + _run_fsstress -d $SCRATCH_MNT/a -w -p 1 -n 2000 sync output=$($BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep "0/$subvolid") echo "qgroup values before rescan: $output" >> $seqres.full
tests/btrfs/332 +2 -2
@@ -32,7 +32,7 @@ d1=$SCRATCH_MNT/d1 d2=$SCRATCH_MNT/d2 mkdir $d1 mkdir $d2 -run_check $FSSTRESS_PROG -d $d1 -w -n 2000 $FSSTRESS_AVOID +_run_fsstress -d $d1 -w -n 2000 fssum_pre=$($FSSUM_PROG -A $SCRATCH_MNT) # enable squotas
@@ -45,7 +45,7 @@ fssum_post=$($FSSUM_PROG -A $SCRATCH_MNT) || echo "fssum $fssum_pre does not match $fssum_post after enabling squota" # do some more stuff -run_check $FSSTRESS_PROG -d $d2 -w -n 2000 $FSSTRESS_AVOID +_run_fsstress -d $d2 -w -n 2000 fssum_pre=$($FSSUM_PROG -A $SCRATCH_MNT) _scratch_unmount _check_btrfs_filesystem $SCRATCH_DEV
tests/ext4/004 +2 -2
@@ -12,6 +12,7 @@ _begin_fstest auto dump # Override the default cleanup function. _cleanup() { + _kill_fsstress cd / rm -f $tmp.* # remove the generated data, which is much and meaningless.
@@ -29,8 +30,7 @@ workout() echo "Run fsstress" >> $seqres.full args=`_scale_fsstress_args -z -f creat=5 -f write=20 -f mkdir=5 -n 100 -p 15 -d $dump_dir` echo "fsstress $args" >> $seqres.full - - $FSSTRESS_PROG $args >> $seqres.full 2>&1 + _run_fsstress $args echo "start Dump/Restore" >> $seqres.full cd $TEST_DIR
tests/ext4/057 +3 -11
@@ -8,15 +8,6 @@ . ./common/preamble _begin_fstest auto ioctl -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -r -f $tmp.* - kill -9 $fsstress_pid 2>/dev/null; - wait > /dev/null 2>&1 -} - # Import common functions. . ./common/filter
@@ -41,8 +32,7 @@ _scratch_mount # Begin fsstress while modifying UUID fsstress_args=$(_scale_fsstress_args -d $SCRATCH_MNT -p 15 -n 999999) -$FSSTRESS_PROG $fsstress_args >> $seqres.full & -fsstress_pid=$! +_run_fsstress_bg $fsstress_args for n in $(seq 1 20); do new_uuid=$($UUIDGEN_PROG)
@@ -57,6 +47,8 @@ for n in $(seq 1 20); do fi done +_kill_fsstress + # success, all done echo "Silence is golden" status=0
tests/ext4/058 +1 -2
@@ -13,7 +13,6 @@ . ./common/preamble _begin_fstest auto quick - _supported_fs ext4 _fixed_by_kernel_commit a08f789d2ab5 \ "ext4: fix bug_on ext4_mb_use_inode_pa"
@@ -23,7 +22,7 @@ _require_scratch _scratch_mkfs -g 256 >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount -$FSSTRESS_PROG -d $SCRATCH_MNT/stress -n 1000 >> $seqres.full 2>&1 +_run_fsstress -d $SCRATCH_MNT/stress -n 1000 echo "Silence is golden"
tests/ext4/307 +2 -2
@@ -19,9 +19,9 @@ _workout() echo "" echo "Run fsstress" out=$SCRATCH_MNT/fsstress.$$ - args=`_scale_fsstress_args -p4 -n999 -f setattr=1 $FSSTRESS_AVOID -d $out` + args=`_scale_fsstress_args -p4 -n999 -f setattr=1 -d $out` echo "fsstress $args" >> $seqres.full - $FSSTRESS_PROG $args >> $seqres.full + _run_fsstress $args find $out -type f > $out.list cat $out.list | xargs md5sum > $out.md5sum usage=`du -sch $out | tail -n1 | gawk '{ print $1 }'`
tests/generic/013 +5 -17
@@ -9,18 +9,6 @@ . ./common/preamble _begin_fstest other ioctl udf auto quick -status=0 # success is the default! - -# Override the default cleanup function. -_cleanup() -{ - cd / - # we might get here with a RO FS - _test_cycle_mount - # now remove fsstress directory. - rm -rf $TEST_DIR/fsstress.$$.* -} - # Import common functions. . ./common/filter
@@ -30,7 +18,7 @@ _do_test() _param="$2" _count="$3" - out=$TEST_DIR/fsstress.$$.$_n + out=$TEST_DIR/fsstress.$seq.$_n rm -rf $out if ! mkdir $out then
@@ -44,9 +32,8 @@ _do_test() echo "fsstress.$_n : $_param" echo "-----------------------------------------------" # -m limits number of users/groups so check doesn't fail (malloc) later - dbgoutfile=$seqres.full - if ! $FSSTRESS_PROG $_param $FSSTRESS_AVOID -v -m 8 -n $_count -d $out >>$dbgoutfile 2>&1 - then + _run_fsstress $_param -v -m 8 -n $_count -d $out + if [ $? -ne 0 ]; then echo " fsstress (count=$_count) returned $? - see $seqres.full" echo "--------------------------------------" >>$seqres.full echo "$_n - output from fsstress:" >>$seqres.full
@@ -62,6 +49,7 @@ _do_test() _require_test echo "brevity is wit..." +status=0 count=1000 procs=20
@@ -80,7 +68,7 @@ _do_test 2 "-p $procs -r" $count _do_test 3 "-p 4 -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 -f rename=30 -f stat=30 -f unlink=30 -f truncate=20" $count -# if all ok by here then probably don't need $seqres.full +rm -rf $TEST_DIR/fsstress.$seq.* exit
tests/generic/019 +6 -7
@@ -22,7 +22,9 @@ _require_fail_make_request # Override the default cleanup function. _cleanup() { - kill $fs_pid $fio_pid &> /dev/null + _kill_fsstress + kill $fio_pid &> /dev/null + wait _disallow_fail_make_request cd / rm -r -f $tmp.*
@@ -85,13 +87,12 @@ FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0 -f setattr=1" _workout() { out=$SCRATCH_MNT/fsstress.$$ - args=`_scale_fsstress_args -p 1 -n999999999 -f setattr=0 $FSSTRESS_AVOID -d $out` + args=`_scale_fsstress_args -p 1 -n999999999 -f setattr=0 -d $out` echo "" echo "Start fsstress.." echo "" echo "fsstress $args" >> $seqres.full - $FSSTRESS_PROG $args >> $seqres.full 2>&1 & - fs_pid=$! + _run_fsstress_bg $args echo "Start fio.." cat $fio_config >> $seqres.full $FIO_PROG $fio_config >> $seqres.full 2>&1 &
@@ -107,10 +108,8 @@ _workout() >> $seqres.full 2>&1 && \ _fail "failed: still able to perform integrity fsync on $SCRATCH_MNT" - kill $fs_pid &> /dev/null - wait $fs_pid + _kill_fsstress wait $fio_pid - unset fs_pid unset fio_pid # We expect that broken FS still can be umounted
tests/generic/051 +4 -16
@@ -14,18 +14,8 @@ _begin_fstest shutdown auto stress log metadata repair # Import common functions. . ./common/filter -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount 2>/dev/null - rm -f $tmp.* -} - - _require_scratch _require_scratch_shutdown -_require_command "$KILLALL_PROG" killall _scratch_mkfs > $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV
@@ -37,25 +27,23 @@ PROCS=$((2 * LOAD_FACTOR)) load_dir=$SCRATCH_MNT/test # let this run for a while -$FSSTRESS_PROG $FSSTRESS_AVOID -n10000000 -p $PROCS -d $load_dir >> $seqres.full 2>&1 & +_run_fsstress_bg -n 10000000 -p $PROCS -d $load_dir sleep $SLEEP_TIME -$KILLALL_PROG -q $FSSTRESS_PROG -wait +_kill_fsstress sync _scratch_unmount # now mount again, run the load again, this time with a shutdown. _scratch_mount $XFS_FSR_PROG -v $load_dir >> $seqres.full 2>&1 -$FSSTRESS_PROG -n10000000 -p $PROCS -d $load_dir >> $seqres.full 2>&1 & +_run_fsstress_bg -n10000000 -p $PROCS -d $load_dir sleep $SLEEP_TIME sync # now shutdown and unmount sleep 5 _scratch_shutdown -$KILLALL_PROG -q $FSSTRESS_PROG -wait +_kill_fsstress # for some reason fsstress processes manage to live on beyond the wait? sleep 5
tests/generic/055 +3 -3
@@ -23,9 +23,9 @@ _do_meta() param="-p 4 -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 \ -f rename=30 -f stat=30 -f unlink=30 -f truncate=20" _echofull "calling fsstress $param -m8 -n $count" - FSSTRESS_ARGS=`_scale_fsstress_args $param $FSSTRESS_AVOID -m 8 -n $count -d $out` - if ! $FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full 2>&1 - then + FSSTRESS_ARGS=`_scale_fsstress_args $param -m 8 -n $count -d $out` + _run_fsstress $FSSTRESS_ARGS + if [ $? -ne 0 ]; then _echofull "fsstress failed" fi }
tests/generic/068 +3 -4
@@ -19,8 +19,7 @@ _cleanup() { # Make sure $SCRATCH_MNT is unfreezed xfs_freeze -u $SCRATCH_MNT 2>/dev/null - [ -n "$pid" ] && kill -9 $pid 2>/dev/null - wait $pid + _kill_fsstress cd / rm -f $tmp.* }
@@ -54,8 +53,8 @@ touch $tmp.running do # We do both read & write IO - not only is this more realistic, # but it also potentially tests atime updates - FSSTRESS_ARGS=`_scale_fsstress_args -d $STRESS_DIR -p $procs -n $nops $FSSTRESS_AVOID` - $FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full + FSSTRESS_ARGS=`_scale_fsstress_args -d $STRESS_DIR -p $procs -n $nops` + _run_fsstress $FSSTRESS_ARGS >>$seqres.full done rm -r $STRESS_DIR/*
tests/generic/070 +2 -10
@@ -9,19 +9,10 @@ . ./common/preamble _begin_fstest attr udf auto quick stress -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -rf $TEST_DIR/fsstress - rm -f $tmp.* -} - # Import common functions. . ./common/filter . ./common/attr - _require_test _require_attrs
@@ -34,7 +25,8 @@ FSSTRESS_ARGS=`_scale_fsstress_args \ -f attr_set=100 \ -f attr_remove=100 \ -p 1 -n 10000 -S c` -$FSSTRESS_PROG $FSSTRESS_ARGS >$seqres.full 2>&1 +_run_fsstress $FSSTRESS_ARGS +rm -rf $TEST_DIR/fsstress status=$? exit
tests/generic/076 +4 -6
@@ -21,16 +21,14 @@ _lets_get_pidst() # Override the default cleanup function. _cleanup() { - echo "*** unmount" - _scratch_unmount 2>/dev/null _lets_get_pidst + cd / + rm -f $tmp.* } -_register_cleanup "_cleanup; rm -f $tmp.*" # Import common functions. . ./common/filter - _require_scratch _require_local_device $SCRATCH_DEV
@@ -48,9 +46,9 @@ echo "*** test concurrent block/fs access" cat $SCRATCH_DEV >/dev/null & pid=$! -FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -p 2 -n 2000 $FSSTRESS_AVOID` +FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -p 2 -n 2000` echo "run fsstress with args: $FSSTRESS_ARGS" >>$seqres.full -$FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full +_run_fsstress $FSSTRESS_ARGS _lets_get_pidst echo "*** done"
tests/generic/076.out +0 -1
@@ -2,4 +2,3 @@ QA output created by 076 *** init fs *** test concurrent block/fs access *** done -*** unmount
tests/generic/083 +2 -11
@@ -18,18 +18,9 @@ . ./common/preamble _begin_fstest rw auto enospc stress -# Override the default cleanup function. -_cleanup() -{ - echo "*** unmount" - _scratch_unmount 2>/dev/null - rm -f $tmp.* -} - # Import common functions. . ./common/filter - _require_scratch _require_no_large_scratch_dev
@@ -52,8 +43,8 @@ workout() _scratch_mount # -w ensures that the only ops are ones which cause write I/O - FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs -n $nops $FSSTRESS_AVOID` - $FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full + FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs -n $nops` + _run_fsstress $FSSTRESS_ARGS >>$seqres.full } echo "*** test out-of-space handling for random write operations"
tests/generic/083.out +0 -1
@@ -1,4 +1,3 @@ QA output created by 083 *** test out-of-space handling for random write operations *** done -*** unmount
tests/generic/117 +1 -3
@@ -63,9 +63,7 @@ echo Running fsstress in serial: i=0 while [ $i -lt $ITERATIONS ]; do echo fsstress iteration: $i | tee -a $seqres.full - $FSSTRESS_PROG \ - -d $SCRATCH_MNT/fsstress \ - $fss_ops -S c >>$seqres.full 2>&1 + _run_fsstress -d $SCRATCH_MNT/fsstress $fss_ops -S c let i=$i+1 done
tests/generic/232 +2 -3
@@ -30,13 +30,12 @@ _fsstress() out=$SCRATCH_MNT/fsstress.$$ count=2000 - args=`_scale_fsstress_args -d $out -n $count -p 7 $FSSTRESS_AVOID` + args=`_scale_fsstress_args -d $out -n $count -p 7` echo "fsstress $args" >> $seqres.full - if ! $FSSTRESS_PROG $args | tee -a $seqres.full | _filter_num + if ! _run_fsstress $args then echo " fsstress $args returned $?" - cat $tmp.out | tee -a $seqres.full status=1 fi }
tests/generic/232.out +0 -1
@@ -2,6 +2,5 @@ QA output created by 232 Testing fsstress -seed = S Comparing user usage Comparing group usage
tests/generic/269 +3 -5
@@ -21,10 +21,9 @@ _workout() num_iterations=10 enospc_time=2 out=$SCRATCH_MNT/fsstress.$$ - args=`_scale_fsstress_args -p128 -n999999999 -f setattr=1 $FSSTRESS_AVOID -d $out` + args=`_scale_fsstress_args -p128 -n999999999 -f setattr=1 -d $out` echo "fsstress $args" >> $seqres.full - $FSSTRESS_PROG $args &>> $seqres.full & - pid=$! + _run_fsstress_bg $args echo "Run dd writers in parallel" for ((i=0; i < num_iterations; i++)) do
@@ -34,8 +33,7 @@ _workout() sleep $enospc_time done echo "Killing fsstress process..." >> $seqres.full - kill $pid >> $seqres.full 2>&1 - wait $pid + _kill_fsstress } _require_scratch
tests/generic/270 +5 -4
@@ -28,8 +28,8 @@ _workout() args=`_scale_fsstress_args -p128 -n999999999 -f setattr=1 $FSSTRESS_AVOID -d $out` echo "fsstress $args" >> $seqres.full # Grant chown capability - cp $FSSTRESS_PROG $tmp.fsstress.bin - $SETCAP_PROG cap_chown=epi $tmp.fsstress.bin + cp $FSSTRESS_PROG $_FSSTRESS_PROG + $SETCAP_PROG cap_chown=epi $_FSSTRESS_PROG # io_uring accounts memory it needs under the rlimit memlocked option, # which can be quite low on some setups (especially 64K pagesize). root
@@ -37,7 +37,8 @@ _workout() # io_uring_queue_init fail on ENOMEM, set max locked memory to unlimited # temporarily. ulimit -l unlimited - (su $qa_user -c "$tmp.fsstress.bin $args" &) > /dev/null 2>&1 + su $qa_user -c "$_FSSTRESS_PROG $args" > /dev/null 2>&1 & + _FSSTRESS_PID=$! echo "Run dd writers in parallel" for ((i=0; i < num_iterations; i++))
@@ -49,7 +50,7 @@ _workout() sleep $enospc_time done - $KILLALL_PROG -w $tmp.fsstress.bin + _kill_fsstress } _require_quota
tests/generic/388 +2 -22
@@ -17,23 +17,9 @@ . ./common/preamble _begin_fstest shutdown auto log metadata recoveryloop -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - _scratch_unmount > /dev/null 2>&1 -} - -# Import common functions. - -# Modify as appropriate. - _require_scratch _require_local_device $SCRATCH_DEV _require_scratch_shutdown -_require_command "$KILLALL_PROG" "killall" echo "Silence is golden."
@@ -42,20 +28,14 @@ _require_metadata_journaling $SCRATCH_DEV _scratch_mount while _soak_loop_running $((50 * TIME_FACTOR)); do - ($FSSTRESS_PROG $FSSTRESS_AVOID -d $SCRATCH_MNT -n 999999 -p 4 >> $seqres.full &) \ - > /dev/null 2>&1 + _run_fsstress_bg -d $SCRATCH_MNT -n 999999 -p 4 # purposely include 0 second sleeps to test shutdown immediately after # recovery sleep $((RANDOM % 3)) _scratch_shutdown - ps -e | grep fsstress > /dev/null 2>&1 - while [ $? -eq 0 ]; do - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait > /dev/null 2>&1 - ps -e | grep fsstress > /dev/null 2>&1 - done + _kill_fsstress # Toggle between rw and ro mounts for recovery. Quit if any mount # attempt fails so we don't shutdown the host fs.
tests/generic/390 +4 -7
@@ -18,8 +18,7 @@ _cleanup() [ -n "$freeze_pids" ] && kill -9 $freeze_pids 2>/dev/null wait $freeze_pids xfs_freeze -u $SCRATCH_MNT 2>/dev/null - [ -n "$fsstress_pid" ] && kill -9 $fsstress_pid 2>/dev/null - wait $fsstress_pid + _kill_fsstress rm -f $tmp.* }
@@ -49,9 +48,8 @@ fi nops=1000 stress_dir="$SCRATCH_MNT/fsstress_test_dir" mkdir "$stress_dir" -fsstress_args=`_scale_fsstress_args -d $stress_dir -p $procs -n $nops $FSSTRESS_AVOID` -$FSSTRESS_PROG $fsstress_args >>$seqres.full 2>&1 & -fsstress_pid=$! +fsstress_args=`_scale_fsstress_args -d $stress_dir -p $procs -n $nops` +_run_fsstress_bg $fsstress_args # Start multi-threads freeze/unfreeze for ((i=0; i<$procs; i++)); do
@@ -62,9 +60,8 @@ for ((i=0; i<$procs; i++)); do freeze_pids="$! $freeze_pids" done -wait $fsstress_pid +_wait_for_fsstress result=$? -unset fsstress_pid wait $freeze_pids unset freeze_pids
tests/generic/409 +5 -4
@@ -25,11 +25,12 @@ _begin_fstest auto quick mount # Override the default cleanup function. _cleanup() { - cd / - rm -f $tmp.* + _kill_fsstress _clear_mount_stack # make sure there's no bug cause dentry isn't be freed rm -rf $MNTHEAD + cd / + rm -f $tmp.* } # Import common functions.
@@ -43,7 +44,7 @@ fs_stress() { local target=$1 - $FSSTRESS_PROG -z -n 50 -p 3 \ + _run_fsstress -z -n 50 -p 3 \ -f creat=5 \ -f mkdir=5 \ -f link=2 \
@@ -56,7 +57,7 @@ fs_stress() -f chown=1 \ -f getdents=1 \ -f fiemap=1 \ - -d $target >>$seqres.full + -d $target sync }
tests/generic/410 +5 -4
@@ -33,11 +33,12 @@ _begin_fstest auto quick mount # Override the default cleanup function. _cleanup() { - cd / - rm -f $tmp.* + _kill_fsstress _clear_mount_stack # make sure there's no bug cause dentry isn't be freed rm -rf $MNTHEAD + cd / + rm -f $tmp.* } # Import common functions.
@@ -51,7 +52,7 @@ fs_stress() { local target=$1 - $FSSTRESS_PROG -z -n 50 -p 3 \ + _run_fsstress -z -n 50 -p 3 \ -f creat=5 \ -f mkdir=5 \ -f link=2 \
@@ -64,7 +65,7 @@ fs_stress() -f chown=1 \ -f getdents=1 \ -f fiemap=1 \ - -d $target >>$seqres.full + -d $target sync }
tests/generic/411 +5 -4
@@ -14,11 +14,12 @@ _begin_fstest auto quick mount # Override the default cleanup function. _cleanup() { - cd / - rm -f $tmp.* + _kill_fsstress _clear_mount_stack # make sure there's no bug cause dentry isn't be freed rm -rf $MNTHEAD + cd / + rm -f $tmp.* } # Import common functions.
@@ -32,7 +33,7 @@ fs_stress() { local target=$1 - $FSSTRESS_PROG -z -n 500 -p 5 \ + _run_fsstress -z -n 500 -p 5 \ -f creat=5 \ -f mkdir=5 \ -f dwrite=1 \
@@ -47,7 +48,7 @@ fs_stress() -f chown=1 \ -f getdents=1 \ -f fiemap=1 \ - -d $target >>$seqres.full + -d $target sync }
tests/generic/461 +2 -13
@@ -14,18 +14,8 @@ _begin_fstest auto shutdown stress # Import common functions. . ./common/filter -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount 2>/dev/null - rm -f $tmp.* -} - - _require_scratch_nocheck _require_scratch_shutdown -_require_command "$KILLALL_PROG" killall _scratch_mkfs > $seqres.full 2>&1 _scratch_mount
@@ -35,15 +25,14 @@ PROCS=$((4 * LOAD_FACTOR)) load_dir=$SCRATCH_MNT/test -$FSSTRESS_PROG $FSSTRESS_AVOID -n10000000 -p $PROCS -d $load_dir >> $seqres.full 2>&1 & +_run_fsstress_bg -n10000000 -p $PROCS -d $load_dir sleep $SLEEP_TIME sync # now shutdown and unmount sleep 5 _scratch_shutdown -$KILLALL_PROG -q $FSSTRESS_PROG -wait +_kill_fsstress # for some reason fsstress processes manage to live on beyond the wait? sleep 5
tests/generic/475 +5 -12
@@ -17,11 +17,11 @@ _begin_fstest shutdown auto log metadata eio recoveryloop smoketest # Override the default cleanup function. _cleanup() { - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 + _kill_fsstress _dmerror_unmount _dmerror_cleanup + cd / + rm -f $tmp.* } # Import common functions.
@@ -31,7 +31,6 @@ _cleanup() _require_scratch _require_dm_target error -_require_command "$KILLALL_PROG" "killall" echo "Silence is golden."
@@ -41,8 +40,7 @@ _dmerror_init _dmerror_mount while _soak_loop_running $((50 * TIME_FACTOR)); do - ($FSSTRESS_PROG $FSSTRESS_AVOID -d $SCRATCH_MNT -n 999999 -p $((LOAD_FACTOR * 4)) >> $seqres.full &) \ - > /dev/null 2>&1 + _run_fsstress_bg -d $SCRATCH_MNT -n 999999 -p $((LOAD_FACTOR * 4)) # purposely include 0 second sleeps to test shutdown immediately after # recovery
@@ -55,12 +53,7 @@ while _soak_loop_running $((50 * TIME_FACTOR)); do # error table helper *without* 'lockfs'. _dmerror_load_error_table - ps -e | grep fsstress > /dev/null 2>&1 - while [ $? -eq 0 ]; do - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait > /dev/null 2>&1 - ps -e | grep fsstress > /dev/null 2>&1 - done + _kill_fsstress # Mount again to replay log after loading working table, so we have a # consistent XFS after test.
tests/generic/476 +1 -14
@@ -10,20 +10,7 @@ . ./common/preamble _begin_fstest auto rw long_rw stress soak smoketest -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 -} - -# Import common functions. - -# Modify as appropriate. - _require_scratch -_require_command "$KILLALL_PROG" "killall" echo "Silence is golden."
@@ -35,7 +22,7 @@ nr_ops=$((25000 * nr_cpus * TIME_FACTOR)) fsstress_args=(-w -d $SCRATCH_MNT -n $nr_ops -p $nr_cpus) test -n "$SOAK_DURATION" && fsstress_args+=(--duration="$SOAK_DURATION") -$FSSTRESS_PROG $FSSTRESS_AVOID "${fsstress_args[@]}" >> $seqres.full +_run_fsstress_bg "${fsstress_args[@]}" # success, all done status=0
tests/generic/482 +5 -7
@@ -18,10 +18,10 @@ _begin_fstest auto metadata replay thin recoveryloop # failure leaves the corpse intact for post-mortem failure analysis. _cleanup() { - cd / - $KILLALL_PROG -KILL -q $FSSTRESS_PROG &> /dev/null + _kill_fsstress _log_writes_cleanup &> /dev/null _dmthin_cleanup + cd / rm -f $tmp.* }
@@ -29,7 +29,7 @@ _cleanup() #_cleanup() #{ # cd / -# $KILLALL_PROG -KILL -q $FSSTRESS_PROG &> /dev/null +# [ -n "$fsstress_pid" ] && kill $fsstress_pid # if [ $status -eq 0 ]; then # _log_writes_cleanup &> /dev/null # _dmthin_cleanup
@@ -48,7 +48,6 @@ _cleanup() # Modify as appropriate. _require_no_logdev -_require_command "$KILLALL_PROG" killall # Use thin device as replay device, which requires $SCRATCH_DEV _require_scratch_nocheck # and we need extra device as log device
@@ -60,8 +59,7 @@ nr_cpus=$("$here/src/feature" -o) if [ $nr_cpus -gt 8 ]; then nr_cpus=8 fi -fsstress_args=$(_scale_fsstress_args -w -d $SCRATCH_MNT -n 512 -p $nr_cpus \ - $FSSTRESS_AVOID) +fsstress_args=$(_scale_fsstress_args -w -d $SCRATCH_MNT -n 512 -p $nr_cpus) size=$(_small_fs_size_mb 200) # 200m phys/virt size devsize=$((1024*1024*size / 512))
@@ -77,7 +75,7 @@ _log_writes_mkfs >> $seqres.full 2>&1 _log_writes_mark mkfs _log_writes_mount -run_check $FSSTRESS_PROG $fsstress_args +_run_fsstress $fsstress_args _log_writes_unmount _log_writes_remove
tests/generic/547 +3 -2
@@ -14,6 +14,7 @@ _begin_fstest auto quick log # Override the default cleanup function. _cleanup() { + _kill_fsstress _cleanup_flakey cd / rm -f $tmp.*
@@ -38,10 +39,10 @@ _init_flakey _mount_flakey mkdir $SCRATCH_MNT/test -args=`_scale_fsstress_args -p 4 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/test` +args=`_scale_fsstress_args -p 4 -n 100 -d $SCRATCH_MNT/test` args="$args -f mknod=0 -f symlink=0" echo "Running fsstress with arguments: $args" >>$seqres.full -$FSSTRESS_PROG $args >>$seqres.full +_run_fsstress $args # Fsync every file and directory. find $SCRATCH_MNT/test \( -type f -o -type d \) -exec $XFS_IO_PROG -c fsync {} \;
tests/generic/560 +3 -4
@@ -30,8 +30,8 @@ function iterate_dedup_verify() find $dest -type f -exec md5sum {} \; \ > $md5file$index # Make some noise - $FSSTRESS_PROG $fsstress_opts -d $noisedir \ - -n 200 -p $((5 * LOAD_FACTOR)) >/dev/null 2>&1 + _run_fsstress $fsstress_opts -d $noisedir \ + -n 200 -p $((5 * LOAD_FACTOR)) # Too many output, so only save error output $DUPEREMOVE_PROG -dr --dedupe-options=same $dupdir \ >/dev/null 2>$seqres.full
@@ -51,8 +51,7 @@ md5file=${tmp}.md5sum fsstress_opts="-w -r" # Create some files to be original data -$FSSTRESS_PROG $fsstress_opts -d $srcdir \ - -n 500 -p $((5 * LOAD_FACTOR)) >/dev/null 2>&1 +_run_fsstress $fsstress_opts -d $srcdir -n 500 -p $((5 * LOAD_FACTOR)) # Calculate how many test cycles will be run src_size=`du -ks $srcdir | awk '{print $1}'`
tests/generic/561 +5 -12
@@ -13,9 +13,9 @@ _begin_fstest auto stress dedupe # Override the default cleanup function. _cleanup() { + end_test cd / rm -f $tmp.* - end_test } # Import common functions.
@@ -23,28 +23,20 @@ _cleanup() . ./common/reflink _require_scratch_duperemove -_require_command "$KILLALL_PROG" killall _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 function end_test() { - local f=1 + _kill_fsstress # stop duperemove running if [ -e $dupe_run ]; then rm -f $dupe_run - $KILLALL_PROG -q $DUPEREMOVE_PROG > /dev/null 2>&1 + kill $dedup_pids wait $dedup_pids fi - - # Make sure all fsstress get killed - while [ $f -ne 0 ]; do - $KILLALL_PROG -q $FSSTRESS_PROG > /dev/null 2>&1 - sleep 1 - f=`ps -eLf | grep $FSSTRESS_PROG | grep -v "grep" | wc -l` - done } sleep_time=$((50 * TIME_FACTOR))
@@ -53,7 +45,8 @@ sleep_time=$((50 * TIME_FACTOR)) testdir="$SCRATCH_MNT/dir" mkdir $testdir fsstress_opts="-r -n 1000 -p $((5 * LOAD_FACTOR))" -$FSSTRESS_PROG $fsstress_opts -d $testdir -l 0 >> $seqres.full 2>&1 & +_run_fsstress_bg $fsstress_opts -d $testdir -l 0 + dedup_pids="" dupe_run=$TEST_DIR/${seq}-running # Start several dedupe processes on same directory
tests/generic/579 +2 -4
@@ -16,7 +16,7 @@ _begin_fstest auto stress verity _cleanup() { # Stop all subprocesses. - $KILLALL_PROG -q $FSSTRESS_PROG + _kill_fsstress touch $tmp.done wait
@@ -29,7 +29,6 @@ _cleanup() . ./common/verity _require_scratch_verity -_require_command "$KILLALL_PROG" killall _disable_fsverity_signatures _scratch_mkfs_verity &>> $seqres.full
@@ -92,8 +91,7 @@ done ) & # Start the fsstress processes. -$FSSTRESS_PROG $FSSTRESS_AVOID -p $nproc_stress -l 0 -d $SCRATCH_MNT/stressdir \ - >> $seqres.full 2>&1 & +_run_fsstress_bg -p $nproc_stress -l 0 -d $SCRATCH_MNT/stressdir # Run for a while. sleep $runtime
tests/generic/585 +2 -2
@@ -23,10 +23,10 @@ _scratch_mount >> $seqres.full 2>&1 # start a create and rename(rename_whiteout) workload. These processes # occur simultaneously may cause the deadlock between AGI and AGF with # RENAME_WHITEOUT. -$FSSTRESS_PROG -z -n 150 -p 100 \ +_run_fsstress -z -n 150 -p 100 \ -f mknod=5 \ -f rwhiteout=5 \ - -d $SCRATCH_MNT/fsstress >> $seqres.full 2>&1 + -d $SCRATCH_MNT/fsstress echo Silence is golden
tests/generic/589 +4 -3
@@ -28,11 +28,12 @@ _begin_fstest auto mount # Override the default cleanup function. _cleanup() { - cd / - rm -f $tmp.* + _kill_fsstress _clear_mount_stack # make sure there's no bug cause dentry isn't be freed rm -rf $MNTHEAD + cd / + rm -f $tmp.* } # Import common functions.
@@ -46,7 +47,7 @@ fs_stress() { local target=$1 - $FSSTRESS_PROG -n 50 -p 3 -d $target >>$seqres.full + _run_fsstress -n 50 -p 3 -d $target sync }
tests/generic/642 +1 -9
@@ -10,17 +10,9 @@ . ./common/preamble _begin_fstest auto soak attr long_rw stress smoketest -_cleanup() -{ - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - cd / - rm -f $tmp.* -} - # Modify as appropriate. _require_scratch -_require_command "$KILLALL_PROG" "killall" echo "Silence is golden."
@@ -50,7 +42,7 @@ args+=('-f' "setfattr=20") args+=('-f' "attr_set=60") # sets larger xattrs test -n "$SOAK_DURATION" && args+=(--duration="$SOAK_DURATION") -$FSSTRESS_PROG "${args[@]}" $FSSTRESS_AVOID -d $SCRATCH_MNT -n $nr_ops -p $nr_cpus >> $seqres.full +_run_fsstress "${args[@]}" -d $SCRATCH_MNT -n $nr_ops -p $nr_cpus # success, all done status=0
tests/generic/648 +5 -14
@@ -16,16 +16,15 @@ _begin_fstest shutdown auto log metadata eio recoveryloop _cleanup() { - cd / - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait + _kill_fsstress if [ -n "$loopmnt" ]; then $UMOUNT_PROG $loopmnt 2>/dev/null rm -r -f $loopmnt fi - rm -f $tmp.* _dmerror_unmount _dmerror_cleanup + cd / + rm -f $tmp.* } # Import common functions.
@@ -37,7 +36,6 @@ _cleanup() _require_scratch_reflink _require_cp_reflink _require_dm_target error -_require_command "$KILLALL_PROG" "killall" _require_loop echo "Silence is golden."
@@ -71,8 +69,6 @@ snap_loop_fs() { rm -f "$snap_aliveflag" } -fsstress=($FSSTRESS_PROG $FSSTRESS_AVOID -d "$loopmnt" -n 999999 -p "$((LOAD_FACTOR * 4))") - while _soak_loop_running $((25 * TIME_FACTOR)); do touch $scratch_aliveflag snap_loop_fs >> $seqres.full 2>&1 &
@@ -84,7 +80,7 @@ while _soak_loop_running $((25 * TIME_FACTOR)); do break fi - ("${fsstress[@]}" >> $seqres.full &) > /dev/null 2>&1 + _run_fsstress_bg -d "$loopmnt" -n 999999 -p "$((LOAD_FACTOR * 4))" # purposely include 0 second sleeps to test shutdown immediately after # recovery
@@ -98,12 +94,7 @@ while _soak_loop_running $((25 * TIME_FACTOR)); do # error table helper *without* 'lockfs'. _dmerror_load_error_table - ps -e | grep fsstress > /dev/null 2>&1 - while [ $? -eq 0 ]; do - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait > /dev/null 2>&1 - ps -e | grep fsstress > /dev/null 2>&1 - done + _kill_fsstress for ((j = 0; j < 10; j++)); do test -e "$snap_aliveflag" || break sleep 1
tests/generic/650 +9 -6
@@ -16,14 +16,14 @@ _begin_fstest auto rw stress soak # Override the default cleanup function. _cleanup() { - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 + _kill_fsstress wait # for exercise_cpu_hotplug subprocess for i in "$sysfs_cpu_dir/"cpu*/online; do echo 1 > "$i" 2>/dev/null done test -n "$stress_dir" && rm -r -f "$stress_dir" + cd / + rm -f $tmp.* } exercise_cpu_hotplug()
@@ -39,7 +39,6 @@ exercise_cpu_hotplug() } _require_test -_require_command "$KILLALL_PROG" "killall" sysfs_cpu_dir="/sys/devices/system/cpu"
@@ -71,13 +70,17 @@ test "$nr_cpus" -gt 1024 && nr_cpus="$nr_hotplug_cpus" fsstress_args+=(-p $nr_cpus) if [ -n "$SOAK_DURATION" ]; then test "$SOAK_DURATION" -lt 10 && SOAK_DURATION=10 - fsstress_args+=(--duration="$((SOAK_DURATION / 10))") +else + # run for 30s per iteration max + SOAK_DURATION=300 fi +fsstress_args+=(--duration="$((SOAK_DURATION / 10))") nr_ops=$((2500 * TIME_FACTOR)) fsstress_args+=(-n $nr_ops) for ((i = 0; i < 10; i++)); do - $FSSTRESS_PROG $FSSTRESS_AVOID -w "${fsstress_args[@]}" >> $seqres.full + _run_fsstress_bg -w "${fsstress_args[@]}" + _wait_for_fsstress _test_cycle_mount done
tests/generic/750 +4 -6
@@ -11,13 +11,12 @@ _begin_fstest auto rw long_rw stress soak smoketest _cleanup() { - cd / + _kill_fsstress rm -f $runfile - rm -f $tmp.* kill -9 $trigger_compaction_pid > /dev/null 2>&1 - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait > /dev/null 2>&1 + rm -f $tmp.* + cd / } # Import common functions.
@@ -26,7 +25,6 @@ _cleanup() _require_scratch _require_vm_compaction -_require_command "$KILLALL_PROG" "killall" # We still deadlock with this test on v6.10-rc2, we need more work. # but the below makes things better.
@@ -52,7 +50,7 @@ while [ -e $runfile ]; do done & trigger_compaction_pid=$! -$FSSTRESS_PROG $FSSTRESS_AVOID "${fsstress_args[@]}" >> $seqres.full +_run_fsstress "${fsstress_args[@]}" rm -f $runfile wait > /dev/null 2>&1
tests/generic/753 +5 -12
@@ -16,11 +16,11 @@ _begin_fstest shutdown auto log metadata eio recoveryloop attr # Override the default cleanup function. _cleanup() { - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 + _kill_fsstress _dmerror_unmount _dmerror_cleanup + cd / + rm -f $tmp.* } # Import common functions.
@@ -30,7 +30,6 @@ _cleanup() _require_scratch _require_dm_target error -_require_command "$KILLALL_PROG" "killall" echo "Silence is golden."
@@ -59,8 +58,7 @@ args+=('-f' "setfattr=20") args+=('-f' "attr_set=60") # sets larger xattrs while _soak_loop_running $((50 * TIME_FACTOR)); do - ($FSSTRESS_PROG "${args[@]}" $FSSTRESS_AVOID -d $SCRATCH_MNT -n 999999 -p $((LOAD_FACTOR * 4)) >> $seqres.full &) \ - > /dev/null 2>&1 + _run_fsstress_bg "${args[@]}" -d $SCRATCH_MNT -n 999999 -p $((LOAD_FACTOR * 4)) # purposely include 0 second sleeps to test shutdown immediately after # recovery
@@ -73,12 +71,7 @@ while _soak_loop_running $((50 * TIME_FACTOR)); do # error table helper *without* 'lockfs'. _dmerror_load_error_table - ps -e | grep fsstress > /dev/null 2>&1 - while [ $? -eq 0 ]; do - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait > /dev/null 2>&1 - ps -e | grep fsstress > /dev/null 2>&1 - done + _kill_fsstress # Mount again to replay log after loading working table, so we have a # consistent XFS after test.
tests/overlay/019 +33 -15
68 lines not on this page · raw message
tests/overlay/021 +4 -4
@@ -33,8 +33,8 @@ d_low=$lowerdir/$testdir mkdir -p $d_low # Create 4K empty files in 4 directories -echo $FSSTRESS_PROG -d $d_low -p 4 -z -f creat=1 -n 1024 -v >> $seqres.full -$FSSTRESS_PROG -d $d_low -p 4 -z -f creat=1 -n 1024 -v >> $seqres.full 2>&1 +echo fsstress -d $d_low -p 4 -z -f creat=1 -n 1024 -v >> $seqres.full +_run_fsstress -d $d_low -p 4 -z -f creat=1 -n 1024 -v echo "--------------------------------------" >> $seqres.full echo "Created 1K files in lower directory. " >> $seqres.full
@@ -91,9 +91,9 @@ echo "Go team truncate!! " >> $seqres.full # Give team 'touch' a 1 second head start. # Team 'truncate' players should catch up after few copy up bombs. sleep 1 -$FSSTRESS_PROG -d $d_top -p 4 -z -f creat=1 -n 1024 -v >> $seqres.full & +_run_fsstress -d $d_top -p 4 -z -f creat=1 -n 1024 -v -wait %1 %2 %3 %4 %5 +wait %1 %2 %3 %4 echo "Silence is golden" status=0
tests/xfs/006 +4 -3
@@ -13,9 +13,10 @@ _begin_fstest auto quick mount eio # Override the default cleanup function. _cleanup() { + _kill_fsstress + _dmerror_cleanup cd / rm -f $tmp.* - _dmerror_cleanup } # Import common functions.
@@ -45,7 +46,7 @@ fi # start a metadata-intensive workload, but no data allocation operation. # Because uncompleted new space allocation I/Os may cause XFS to shutdown # after loading error table. -$FSSTRESS_PROG -z -n 5000 -p 10 \ +_run_fsstress -z -n 5000 -p 10 \ -f creat=10 \ -f resvsp=1 \ -f truncate=1 \
@@ -57,7 +58,7 @@ $FSSTRESS_PROG -z -n 5000 -p 10 \ -f unlink=1 \ -f symlink=1 \ -f rename=1 \ - -d $SCRATCH_MNT/fsstress >> $seqres.full 2>&1 + -d $SCRATCH_MNT/fsstress # Loading error table without "--nolockfs" option. Because "--nolockfs" # won't freeze fs, then some running I/Os may cause XFS to shutdown
tests/xfs/011 +3 -7
@@ -26,8 +26,7 @@ _cleanup() { # Make sure $SCRATCH_MNT is unfreezed xfs_freeze -u $SCRATCH_MNT 2>/dev/null - $KILLALL_PROG -9 fsstress 2>/dev/null - wait + _kill_fsstress cd / rm -f $tmp.* }
@@ -102,8 +101,7 @@ _scratch_mount _check_scratch_log_state -$FSSTRESS_PROG -d $SCRATCH_MNT/fsstress -n 9999999 -p 2 -S t \ - >> $seqres.full 2>&1 & +_run_fsstress_bg -d $SCRATCH_MNT/fsstress -n 9999999 -p 2 -S t iters=5 while [ $iters -gt 0 ]; do
@@ -112,9 +110,7 @@ while [ $iters -gt 0 ]; do iters=$((iters - 1)) done -$KILLALL_PROG $FSSTRESS_PROG -wait - +_kill_fsstress _scratch_unmount status=0
tests/xfs/013 +2 -14
@@ -16,16 +16,6 @@ _begin_fstest auto metadata stress # Import common functions. . ./common/filter -# Override the default cleanup function. -_cleanup() -{ - $KILLALL_PROG -9 fsstress 2>/dev/null - wait - cd / - _scratch_unmount 2>/dev/null - rm -f $tmp.* -} - filter_enospc() { sed -e '/^.*No space left on device.*/d' }
@@ -103,8 +93,7 @@ _create $SCRATCH_MNT/dir1 $COUNT _cleaner $SCRATCH_MNT $LOOPS $MINDIRS & # start a background stress workload on the fs -$FSSTRESS_PROG -d $SCRATCH_MNT/fsstress -n 9999999 -p 2 -S t \ - >> $seqres.full 2>&1 & +_run_fsstress_bg -d $SCRATCH_MNT/fsstress -n 9999999 -p 2 -S t # Each cycle clones the current directory and makes a random file replacement # pass on the new directory. The directory is copied to the next using hard
@@ -127,8 +116,7 @@ do _rand_replace $SCRATCH_MNT/dir$((i+1)) $COUNT done -$KILLALL_PROG fsstress -wait +_kill_fsstress # clean out the competing fsstress allocations, then everything else rm -rf $SCRATCH_MNT/fsstress
tests/xfs/017 +2 -11
@@ -9,15 +9,6 @@ . ./common/preamble _begin_fstest mount auto quick stress -_register_cleanup "_cleanup; rm -f $tmp.*" - -# Override the default cleanup function. -_cleanup() -{ - echo "*** unmount" - _scratch_unmount 2>/dev/null -} - # Import common functions. . ./common/filter
@@ -41,8 +32,8 @@ echo "*** test" for l in 0 1 2 3 4 do echo " *** test $l" - FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -n 1000 $FSSTRESS_AVOID` - $FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full + FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -n 1000` + _run_fsstress $FSSTRESS_ARGS _try_scratch_mount -o remount,ro \ || _fail "remount ro failed"
tests/xfs/017.out +0 -1
@@ -7,4 +7,3 @@ QA output created by 017 *** test 3 *** test 4 *** done -*** unmount
tests/xfs/032 +1 -1
@@ -50,7 +50,7 @@ while [ $SECTORSIZE -le $PAGESIZE ]; do fi _scratch_mount # light population of the fs - $FSSTRESS_PROG -n 100 -d $SCRATCH_MNT >> $seqres.full 2>&1 + _run_fsstress -n 100 -d $SCRATCH_MNT _scratch_unmount # Test "duplicate" copy at first, if $XFS_COPY_PROG won't do it.
tests/xfs/049 +2 -2
@@ -68,7 +68,7 @@ mount -t xfs -o loop $SCRATCH_MNT/test.xfs $SCRATCH_MNT/test >> $seqres.full 2>& || _fail "!!! failed to loop mount xfs" _log "stress" -$FSSTRESS_PROG -d $SCRATCH_MNT/test -n 1000 $FSSTRESS_AVOID >> $seqres.full 2>&1 \ +_run_fsstress -d $SCRATCH_MNT/test -n 1000 \ || _fail "!!! stress failed" _log "clean"
@@ -88,7 +88,7 @@ mount -t ext2 -o loop $SCRATCH_MNT/test/test.ext2 $SCRATCH_MNT/test2 >> $seqres. || _fail "!!! failed to loop mount xfs" _log "stress ext2 on xfs via loop" -$FSSTRESS_PROG -d $SCRATCH_MNT/test2 -n 1000 $FSSTRESS_AVOID >> $seqres.full 2>&1 \ +_run_fsstress -d $SCRATCH_MNT/test2 -n 1000 \ || _fail "!!! stress ext2 failed" _log "clean"
tests/xfs/051 +2 -12
@@ -11,15 +11,6 @@ . ./common/preamble _begin_fstest shutdown auto log metadata -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1 - _scratch_unmount > /dev/null 2>&1 -} - # Import common functions. . ./common/dmflakey
@@ -37,11 +28,10 @@ _scratch_mount # Start a workload and shutdown the fs. The subsequent mount will require log # recovery. -$FSSTRESS_PROG -n 9999 -p 2 -w -d $SCRATCH_MNT &>> $seqres.full & +_run_fsstress_bg -n 9999 -p 2 -w -d $SCRATCH_MNT sleep 5 _scratch_shutdown -f -$KILLALL_PROG -q $FSSTRESS_PROG -wait +_kill_fsstress _scratch_unmount # Initialize a dm-flakey device that will pass I/Os for 5s and fail thereafter.
tests/xfs/057 +4 -4
@@ -26,12 +26,12 @@ _begin_fstest auto log recoveryloop # Override the default cleanup function. _cleanup() { - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 [ -e /sys/fs/xfs/$sdev/errortag/log_item_pin ] && echo 0 > /sys/fs/xfs/$sdev/errortag/log_item_pin + _kill_fsstress wait > /dev/null 2>&1 + cd / + rm -f $tmp.* } # Import common functions.
@@ -53,7 +53,7 @@ _scratch_mkfs_sized $((1024 * 1024 * 500)) >> $seqres.full 2>&1 _scratch_mount # populate the fs with some data and cycle the mount to reset the log head/tail -$FSSTRESS_PROG -d $SCRATCH_MNT -z -fcreat=1 -p 4 -n 100000 >> $seqres.full +_run_fsstress -d $SCRATCH_MNT -z -fcreat=1 -p 4 -n 100000 _scratch_cycle_mount || _fail "cycle mount failed" # Pin the tail and start a file removal workload. File removal tends to
tests/xfs/077 +1 -1
@@ -54,7 +54,7 @@ ORIG_UUID=`_scratch_xfs_db -c "uuid" | awk '{print $NF}'` _scratch_mount # Put some stuff on the fs -$FSSTRESS_PROG -d $SCRATCH_MNT -n 100 -p 4 >> $seqres.full 2>&1 +_run_fsstress -d $SCRATCH_MNT -n 100 -p 4 _scratch_unmount # Can xfs_db change it?
tests/xfs/079 +2 -12
@@ -17,19 +17,9 @@ . ./common/preamble _begin_fstest shutdown auto log quick -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait > /dev/null 2>&1 -} - # Import common functions. . ./common/log - # Modify as appropriate. _require_scratch _require_v2log
@@ -43,10 +33,10 @@ _scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount "-o logbsize=32k" # Run a workload to dirty the log, wait a bit and shutdown the fs. -$FSSTRESS_PROG -d $SCRATCH_MNT -p 4 -n 99999999 >> $seqres.full 2>&1 & +_run_fsstress_bg -d $SCRATCH_MNT -p 4 -n 99999999 sleep 10 _scratch_shutdown -f -wait +_wait_for_fsstress # Remount with a different log buffer size. Going from 32k to 64k increases the # log record extended header count, as the log record header can only handle 32k
tests/xfs/104 +4 -10
@@ -40,9 +40,8 @@ _stress_scratch() procs=3 nops=1000 # -w ensures that the only ops are ones which cause write I/O - FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs \ - -n $nops $FSSTRESS_AVOID` - $FSSTRESS_PROG $FSSTRESS_ARGS >> $seqres.full 2>&1 & + args=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs -n $nops` + _run_fsstress_bg $args } _require_scratch
@@ -73,14 +72,11 @@ for i in `seq 125 -1 90`; do break done -# # Grow the filesystem while actively stressing it... -# Kick off more stress threads on each iteration, grow; repeat. -# while [ $size -le $endsize ]; do echo "*** stressing filesystem" echo "*** stressing a ${sizeb} block filesystem" >> $seqres.full - _stress_scratch + _stress_scratch sleep 1 size=`expr $size + $incsize` sizeb=`expr $size / $dbsize` # in data blocks
@@ -92,10 +88,8 @@ while [ $size -le $endsize ]; do [ `expr $size % $modsize` -eq 0 ] && wait # every 4th iteration echo AGCOUNT=$agcount | tee -a $seqres.full echo && echo >> $seqres.full + _wait_for_fsstress done -wait # stop for any remaining stress processes - -_scratch_unmount status=0 exit
tests/xfs/137 +1 -1
@@ -29,7 +29,7 @@ _scratch_xfs_db -x -c "logformat -c 3" >> $seqres.full 2>&1 # do some work on the fs to update metadata LSNs _scratch_mount -$FSSTRESS_PROG -d $SCRATCH_MNT -n 999 -p 4 -w >> $seqres.full 2>&1 +_run_fsstress -d $SCRATCH_MNT -n 999 -p 4 -w _scratch_unmount # Reformat to the current cycle and try to mount. This fails in most cases
tests/xfs/141 +1 -11
@@ -14,19 +14,9 @@ . ./common/preamble _begin_fstest auto log metadata -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait > /dev/null 2>&1 -} - # Import common functions. . ./common/inject - # Modify as appropriate. _require_xfs_io_error_injection "log_bad_crc" _require_scratch
@@ -49,7 +39,7 @@ while [ $nr_times -gt 0 ]; do # Run fsstress until the filesystem shuts down. It will shut down # automatically when error injection triggers. - $FSSTRESS_PROG -d $SCRATCH_MNT -p 4 -n 999999 >> $seqres.full 2>&1 + _run_fsstress -d $SCRATCH_MNT -p 4 -n 999999 # Verify that we can remount the fs. Log recovery should handle the torn # write.
tests/xfs/158 +2 -2
@@ -31,7 +31,7 @@ _scratch_mkfs -m crc=1,inobtcount=0 >> $seqres.full _scratch_mount mkdir $SCRATCH_MNT/stress -$FSSTRESS_PROG -d $SCRATCH_MNT/stress -n 1000 >> $seqres.full +_run_fsstress -d $SCRATCH_MNT/stress -n 1000 echo moo > $SCRATCH_MNT/urk _scratch_unmount
@@ -56,7 +56,7 @@ _check_scratch_xfs_features NEEDSREPAIR INOBTCNT echo "Filesystem should be usable again" _scratch_mount -$FSSTRESS_PROG -d $SCRATCH_MNT/stress -n 1000 >> $seqres.full +_run_fsstress -d $SCRATCH_MNT/stress -n 1000 _scratch_unmount _check_scratch_fs _check_scratch_xfs_features INOBTCNT
tests/xfs/167 +4 -10
@@ -9,20 +9,12 @@ . ./common/preamble _begin_fstest rw metadata auto stress prealloc -# Override the default cleanup function. -_cleanup() -{ - $KILLALL_PROG -r -q -TERM fsstress 2> /dev/null - wait # ensures all fsstress processes died -} - workout() { procs=100 nops=15000 - FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -p $procs -n $nops \ - $FSSTRESS_AVOID` - $FSSTRESS_PROG $FSSTRESS_ARGS >> $seqres.full & + FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -p $procs -n $nops` + _run_fsstress_bg $FSSTRESS_ARGS sleep 2 }
@@ -52,6 +44,8 @@ rm -f $TEST_FILE workout $TEST_PROG $LOOPS $TEST_FILE +_kill_fsstress + echo " *** test done" status=0
tests/xfs/168 +4 -4
@@ -38,9 +38,8 @@ stress_scratch() local procs=3 local nops=1000 # -w ensures that the only ops are ones which cause write I/O - local FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w \ - -p $procs -n $nops $FSSTRESS_AVOID` - $FSSTRESS_PROG $FSSTRESS_ARGS >> $seqres.full 2>&1 + local args=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs -n $nops` + _run_fsstress_bg $args } _require_scratch_xfs_shrink
@@ -73,7 +72,7 @@ while [ $totalcount -gt 0 ]; do decsize=`expr 41 \* 1048576 + 1 + $RANDOM \* $RANDOM % 1048576` while [ $size -gt $endsize ]; do - stress_scratch & + stress_scratch sleep 1 decb=`expr $decsize / $dbsize` # in data blocks
@@ -95,6 +94,7 @@ while [ $totalcount -gt 0 ]; do . $tmp.growfs size=`expr $dblocks \* $dbsize` + _kill_fsstress _scratch_unmount _scratch_xfs_repair -n >> $seqres.full 2>&1 || \ _fail "xfs_repair failed with shrinking $sizeb"
tests/xfs/264 +2 -2
@@ -55,7 +55,7 @@ do_test() # start a metadata-intensive workload, but no data allocation operation. # Because uncompleted new space allocation I/Os may cause XFS to shutdown # after loading error table. - $FSSTRESS_PROG -z -n 5000 -p 10 \ + _run_fsstress -z -n 5000 -p 10 \ -f creat=10 \ -f resvsp=1 \ -f truncate=1 \
@@ -67,7 +67,7 @@ do_test() -f unlink=1 \ -f symlink=1 \ -f rename=1 \ - -d $SCRATCH_MNT/fsstress >> $seqres.full 2>&1 + -d $SCRATCH_MNT/fsstress # Loading error table without "--nolockfs" option. Because "--nolockfs" # won't freeze fs, then some running I/Os may cause XFS to shutdown
tests/xfs/270 +1 -1
@@ -80,7 +80,7 @@ if [ $? -ne 0 ]; then else # no hang/panic is fine cat $SCRATCH_MNT/testfile > /dev/null - $FSSTRESS_PROG -d $SCRATCH_MNT -p 4 -n 400 >>$seqres.full 2>&1 + _run_fsstress -d $SCRATCH_MNT -p 4 -n 400 fi # remount as rw, kernel should reject it
tests/xfs/297 +3 -5
@@ -16,8 +16,7 @@ _cleanup() { # Make sure $SCRATCH_MNT is unfreezed xfs_freeze -u $SCRATCH_MNT 2>/dev/null - $KILLALL_PROG -q -9 $FSSTRESS_PROG - wait + _kill_fsstress cd / rm -f $tmp.* }
@@ -37,7 +36,7 @@ _scratch_mount STRESS_DIR="$SCRATCH_MNT/testdir" mkdir -p $STRESS_DIR -$FSSTRESS_PROG -d $STRESS_DIR -n 100 -p 1000 $FSSTRESS_AVOID >>$seqres.full & +_run_fsstress_bg -d $STRESS_DIR -n 1000 -p 1000 $FSSTRESS_AVOID # Freeze/unfreeze file system randomly echo "Start freeze/unfreeze randomly" | tee -a $seqres.full
@@ -60,8 +59,7 @@ while [ $LOOP -gt 0 ];do let LOOP=$LOOP-1 done echo "Test done" | tee -a $seqres.full -$KILLALL_PROG -q $FSSTRESS_PROG -wait +_kill_fsstress status=0 exit
tests/xfs/305 +3 -5
@@ -4,7 +4,7 @@ # # FS QA Test No. 305 # -# Test to verify that turn group/project quotas off while fstress and +# Test to verify that turn group/project quotas off while fsstress and # user quotas are left on. # . ./common/preamble
@@ -18,7 +18,6 @@ _begin_fstest auto quota _require_scratch _require_xfs_quota -_require_command "$KILLALL_PROG" killall _scratch_mkfs_xfs -m crc=1 >/dev/null 2>&1
@@ -33,12 +32,11 @@ _exercise() _qmount mkdir -p $QUOTA_DIR - $FSSTRESS_PROG -d $QUOTA_DIR -n 1000000 -p 100 $FSSTRESS_AVOID >>$seqres.full & + _run_fsstress_bg -d $QUOTA_DIR -n 1000000 -p 100 sleep 10 $XFS_QUOTA_PROG -x -c "disable -$type" $SCRATCH_DEV sleep 5 - $KILLALL_PROG -q $FSSTRESS_PROG - wait + _kill_fsstress } echo "*** turn off group quotas"
tests/xfs/442 +1 -9
@@ -12,14 +12,6 @@ . ./common/preamble _begin_fstest auto stress clone quota -# Override the default cleanup function. -_cleanup() -{ - cd / - rm -f $tmp.* - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 -} - # Import common functions. . ./common/quota . ./common/filter
@@ -72,7 +64,7 @@ _scratch_mount >> $seqres.full 2>&1 nr_cpus=$((LOAD_FACTOR * 4)) nr_ops=$((25000 * nr_cpus * TIME_FACTOR)) -$FSSTRESS_PROG $FSSTRESS_AVOID -w -d $SCRATCH_MNT -n $nr_ops -p $nr_cpus >> $seqres.full +_run_fsstress -w -d $SCRATCH_MNT -n $nr_ops -p $nr_cpus echo "Check quota before remount" check_quota_du_blocks
tests/xfs/538 +2 -2
@@ -46,7 +46,7 @@ echo "Inject bmap_alloc_minlen_extent error tag" _scratch_inject_error bmap_alloc_minlen_extent 1 echo "Execute fsstress" -$FSSTRESS_PROG -d $SCRATCH_MNT \ +_run_fsstress -d $SCRATCH_MNT \ $(_scale_fsstress_args -p 75 -n 1000) \ -f bulkstat=0 \ -f bulkstat1=0 \
@@ -61,7 +61,7 @@ $FSSTRESS_PROG -d $SCRATCH_MNT \ -f readv=0 \ -f stat=0 \ -f aread=0 \ - -f dread=0 >> $seqres.full + -f dread=0 # success, all done status=0
tests/xfs/609 +3 -17
@@ -18,21 +18,12 @@ _stress_scratch() nops=999999 # -w ensures that the only ops are ones which cause write I/O FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs \ - -n $nops $FSSTRESS_AVOID` - $FSSTRESS_PROG $FSSTRESS_ARGS >> $seqres.full 2>&1 & + -n $nops` + _run_fsstress_bg $FSSTRESS_ARGS >> $seqres.full 2>&1 } _require_scratch _require_command "$XFS_GROWFS_PROG" xfs_growfs -_require_command "$KILLALL_PROG" killall - -_cleanup() -{ - $KILLALL_ALL fsstress > /dev/null 2>&1 - wait - cd / - rm -f $tmp.* -} _scratch_mkfs_xfs | _filter_mkfs >$seqres.full 2>$tmp.mkfs . $tmp.mkfs # extract blocksize and data size for scratch device
@@ -63,12 +54,7 @@ while [ $size -le $endsize ]; do sleep $((RANDOM % 3)) _scratch_shutdown - ps -e | grep fsstress > /dev/null 2>&1 - while [ $? -eq 0 ]; do - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait > /dev/null 2>&1 - ps -e | grep fsstress > /dev/null 2>&1 - done + _kill_fsstress _scratch_cycle_mount done > /dev/null 2>&1 wait # stop for any remaining stress processes
tests/xfs/610 +3 -17
@@ -18,22 +18,13 @@ _stress_scratch() nops=999999 # -w ensures that the only ops are ones which cause write I/O FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs \ - -n $nops $FSSTRESS_AVOID` - $FSSTRESS_PROG $FSSTRESS_ARGS >> $seqres.full 2>&1 & + -n $nops` + _run_fsstress_bg $FSSTRESS_ARGS >> $seqres.full 2>&1 } _require_scratch _require_realtime _require_command "$XFS_GROWFS_PROG" xfs_growfs -_require_command "$KILLALL_PROG" killall - -_cleanup() -{ - $KILLALL_ALL fsstress > /dev/null 2>&1 - wait - cd / - rm -f $tmp.* -} _scratch_mkfs_xfs | _filter_mkfs >$seqres.full 2>$tmp.mkfs . $tmp.mkfs # extract blocksize and data size for scratch device
@@ -65,12 +56,7 @@ while [ $size -le $endsize ]; do sleep $((RANDOM % 3)) _scratch_shutdown - ps -e | grep fsstress > /dev/null 2>&1 - while [ $? -eq 0 ]; do - $KILLALL_PROG -9 fsstress > /dev/null 2>&1 - wait > /dev/null 2>&1 - ps -e | grep fsstress > /dev/null 2>&1 - done + _kill_fsstress _scratch_cycle_mount done > /dev/null 2>&1 wait # stop for any remaining stress processes
Signature · 1 line
2.45.2
PATCH 7/40 fstests: per-test dmthin instances
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
We can't run two tests that use dmthin at the same time because the device name is the same. hence they interfere with each other. Give dmthin devices their own per-test names to avoid this problem.
--- common/dmthin | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
common/dmthin +4 -4
@@ -9,16 +9,16 @@ # from a single scratch device # Backing data dev -DMTHIN_DATA_NAME="thin-data" +DMTHIN_DATA_NAME="thin-data.$seq" DMTHIN_DATA_DEV="/dev/mapper/$DMTHIN_DATA_NAME" # Backing metadata dev -DMTHIN_META_NAME="thin-meta" +DMTHIN_META_NAME="thin-meta.$seq" DMTHIN_META_DEV="/dev/mapper/$DMTHIN_META_NAME" # Backing pool dev (combination of above) -DMTHIN_POOL_NAME="thin-provision-pool" +DMTHIN_POOL_NAME="thin-provision-pool.$seq" DMTHIN_POOL_DEV="/dev/mapper/$DMTHIN_POOL_NAME" # Thin volume -DMTHIN_VOL_NAME="thin-vol" +DMTHIN_VOL_NAME="thin-vol.$seq" DMTHIN_VOL_DEV="/dev/mapper/$DMTHIN_VOL_NAME" _dmthin_cleanup()
Signature · 1 line
2.45.2
PATCH 4/40 fstests: per-test dmflakey instances
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
We can't run two tests that use dmflakey at the same time because the device name is the same. hence they interfere with each other. Given dmflakey devices their own per-test names to avoid this problem.
Also, drop_and_remount is about to fail the fs during unmount, so ensure the filesystem is going to fail the IO during unmount rather than retrying forever.
--- common/dmflakey | 56 ++++++++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 24 deletions(-)
common/dmflakey +32 -24
@@ -8,15 +8,19 @@ FLAKEY_ALLOW_WRITES=0 FLAKEY_DROP_WRITES=1 FLAKEY_ERROR_WRITES=2 +export FLAKEY_NAME="flakey-test.$seq" +export FLAKEY_RTNAME="flakey-rttest.$seq" +export FLAKEY_LOGNAME="flakey-logtest.$seq" + _init_flakey() { # Scratch device local BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV` - FLAKEY_DEV=/dev/mapper/flakey-test + export FLAKEY_DEV="/dev/mapper/$FLAKEY_NAME" FLAKEY_TABLE="0 $BLK_DEV_SIZE flakey $SCRATCH_DEV 0 180 0" FLAKEY_TABLE_DROP="0 $BLK_DEV_SIZE flakey $SCRATCH_DEV 0 0 180 1 drop_writes" FLAKEY_TABLE_ERROR="0 $BLK_DEV_SIZE flakey $SCRATCH_DEV 0 0 180 1 error_writes" - _dmsetup_create flakey-test --table "$FLAKEY_TABLE" || \ + _dmsetup_create $FLAKEY_NAME --table "$FLAKEY_TABLE" || \ _fatal "failed to create flakey device" # Realtime device
@@ -25,7 +29,7 @@ _init_flakey() # Set up the device switch local backing_dev="$SCRATCH_RTDEV" export NON_FLAKEY_RTDEV="$SCRATCH_RTDEV" - SCRATCH_RTDEV=/dev/mapper/flakey-rttest + SCRATCH_RTDEV=/dev/mapper/$FLAKEY_RTNAME else # Already set up; recreate tables local backing_dev="$NON_FLAKEY_RTDEV"
@@ -34,7 +38,7 @@ _init_flakey() FLAKEY_RTTABLE="0 $BLK_DEV_SIZE flakey $backing_dev 0 180 0" FLAKEY_RTTABLE_DROP="0 $BLK_DEV_SIZE flakey $backing_dev 0 0 180 1 drop_writes" FLAKEY_RTTABLE_ERROR="0 $BLK_DEV_SIZE flakey $backing_dev 0 0 180 1 error_writes" - _dmsetup_create flakey-rttest --table "$FLAKEY_RTTABLE" || \ + _dmsetup_create $FLAKEY_RTNAME --table "$FLAKEY_RTTABLE" || \ _fatal "failed to create flakey rt device" fi
@@ -44,7 +48,7 @@ _init_flakey() # Set up the device switch local backing_dev="$SCRATCH_LOGDEV" export NON_FLAKEY_LOGDEV="$SCRATCH_LOGDEV" - SCRATCH_LOGDEV=/dev/mapper/flakey-logtest + SCRATCH_LOGDEV=/dev/mapper/$FLAKEY_LOGNAME else # Already set up; recreate tables local backing_dev="$NON_FLAKEY_LOGDEV"
@@ -53,7 +57,7 @@ _init_flakey() FLAKEY_LOGTABLE="0 $BLK_DEV_SIZE flakey $backing_dev 0 180 0" FLAKEY_LOGTABLE_DROP="0 $BLK_DEV_SIZE flakey $backing_dev 0 0 180 1 drop_writes" FLAKEY_LOGTABLE_ERROR="0 $BLK_DEV_SIZE flakey $backing_dev 0 0 180 1 error_writes" - _dmsetup_create flakey-logtest --table "$FLAKEY_LOGTABLE" || \ + _dmsetup_create $FLAKEY_LOGNAME --table "$FLAKEY_LOGTABLE" || \ _fatal "failed to create flakey log device" fi }
@@ -74,15 +78,15 @@ _cleanup_flakey() { # If dmsetup load fails then we need to make sure to do resume here # otherwise the umount will hang - test -n "$NON_FLAKEY_LOGDEV" && $DMSETUP_PROG resume flakey-logtest &> /dev/null - test -n "$NON_FLAKEY_RTDEV" && $DMSETUP_PROG resume flakey-rttest &> /dev/null + test -n "$NON_FLAKEY_LOGDEV" && $DMSETUP_PROG resume $FLAKEY_LOGNAME &> /dev/null + test -n "$NON_FLAKEY_RTDEV" && $DMSETUP_PROG resume $FLAKEY_RTNAME &> /dev/null $DMSETUP_PROG resume flakey-test > /dev/null 2>&1 $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 - _dmsetup_remove flakey-test - test -n "$NON_FLAKEY_LOGDEV" && _dmsetup_remove flakey-logtest - test -n "$NON_FLAKEY_RTDEV" && _dmsetup_remove flakey-rttest + _dmsetup_remove $FLAKEY_NAME + test -n "$NON_FLAKEY_LOGDEV" && _dmsetup_remove $FLAKEY_LOGNAME + test -n "$NON_FLAKEY_RTDEV" && _dmsetup_remove $FLAKEY_RTNAME if [ -n "$NON_FLAKEY_LOGDEV" ]; then SCRATCH_LOGDEV="$NON_FLAKEY_LOGDEV"
@@ -125,54 +129,58 @@ _load_flakey_table() # Suspend the scratch device before the log and realtime devices so # that the kernel can freeze and flush the filesystem if the caller # wanted a freeze. - $DMSETUP_PROG suspend $suspend_opt flakey-test - [ $? -ne 0 ] && _fatal "failed to suspend flakey-test" + $DMSETUP_PROG suspend $suspend_opt $FLAKEY_NAME + [ $? -ne 0 ] && _fatal "failed to suspend $FLAKEY_NAME" if [ -n "$NON_FLAKEY_RTDEV" ]; then - $DMSETUP_PROG suspend $suspend_opt flakey-rttest + $DMSETUP_PROG suspend $suspend_opt $FLAKEY_RTNAME [ $? -ne 0 ] && _fatal "failed to suspend flakey-rttest" fi if [ -n "$NON_FLAKEY_LOGDEV" ]; then - $DMSETUP_PROG suspend $suspend_opt flakey-logtest + $DMSETUP_PROG suspend $suspend_opt $FLAKEY_LOGNAME [ $? -ne 0 ] && _fatal "failed to suspend flakey-logtest" fi # There may be multiple dm targets in the table, and these dm targets # will be joined by the newline ("\n"). Option --table can not cope with # the multiple-targets case, so get them by reading from standard input. - echo -e "$table" | $DMSETUP_PROG load flakey-test - [ $? -ne 0 ] && _fatal "failed to load table into flakey-test" + echo -e "$table" | $DMSETUP_PROG load $FLAKEY_NAME + [ $? -ne 0 ] && _fatal "failed to load table into $FLAKEY_NAME" if [ -n "$NON_FLAKEY_RTDEV" ]; then - echo -e "$rttable" | $DMSETUP_PROG load flakey-rttest + echo -e "$rttable" | $DMSETUP_PROG load $FLAKEY_RTNAME [ $? -ne 0 ] && _fatal "failed to load table into flakey-rttest" fi if [ -n "$NON_FLAKEY_LOGDEV" ]; then - echo -e "$logtable" | $DMSETUP_PROG load flakey-logtest + echo -e "$logtable" | $DMSETUP_PROG load $FLAKEY_LOGNAME [ $? -ne 0 ] && _fatal "failed to load table into flakey-logtest" fi # Resume devices in the opposite order that we suspended them. if [ -n "$NON_FLAKEY_LOGDEV" ]; then - $DMSETUP_PROG resume flakey-logtest + $DMSETUP_PROG resume $FLAKEY_LOGNAME [ $? -ne 0 ] && _fatal "failed to resume flakey-logtest" fi if [ -n "$NON_FLAKEY_RTDEV" ]; then - $DMSETUP_PROG resume flakey-rttest + $DMSETUP_PROG resume $FLAKEY_RTNAME [ $? -ne 0 ] && _fatal "failed to resume flakey-rttest" fi - $DMSETUP_PROG resume flakey-test - [ $? -ne 0 ] && _fatal "failed to resume flakey-test" + $DMSETUP_PROG resume $FLAKEY_NAME + [ $? -ne 0 ] && _fatal "failed to resume $FLAKEY_NAME" } # Silently drop all writes and unmount/remount to simulate a crash/power # failure. _flakey_drop_and_remount() { + # If the full environment is set up, configure ourselves for shutdown + type _prepare_for_eio_shutdown &>/dev/null && \ + _prepare_for_eio_shutdown $FLAKEY_DEV + _load_flakey_table $FLAKEY_DROP_WRITES _unmount_flakey
@@ -188,7 +196,7 @@ _require_flakey_with_error_writes() { local SIZE local TABLE - local NAME=flakey-test + local NAME=$FLAKEY_NAME _require_dm_target flakey
Signature · 1 line
2.45.2
PATCH 6/40 fstests: per-test dmhuge instances
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
We can't run two tests that use dmhuge at the same time because the device name is the same. hence they interfere with each other. Give dmhuge devices their own per-test names to avoid this problem.
--- common/dmhugedisk | 19 +++++++++++-------- tests/generic/620 | 1 + 2 files changed, 12 insertions(+), 8 deletions(-)
common/dmhugedisk +11 -8
@@ -4,6 +4,9 @@ # # Routines for creating huge (fake) disks +export DMHUGE_TEST="huge-test.$seq" +export DMHUGE_TEST_ZERO="huge-test-zero.$seq" + _require_dmhugedisk() { _require_dm_target zero
@@ -20,26 +23,26 @@ _dmhugedisk_init() chunk_size=512 fi - _dmsetup_remove huge-test - _dmsetup_remove huge-test-zero + _dmsetup_remove $DMHUGE_TEST + _dmsetup_remove $DMHUGE_TEST_ZERO local blk_dev_size=$1 - DMHUGEDISK_ZERO='/dev/mapper/huge-test-zero' - DMHUGEDISK_DEV='/dev/mapper/huge-test' + DMHUGEDISK_ZERO="/dev/mapper/$DMHUGE_TEST_ZERO" + DMHUGEDISK_DEV="/dev/mapper/$DMHUGE_TEST" DMHUGEDISK_ZERO_TABLE="0 $blk_dev_size zero" DMHUGEDISK_DEV_TABLE="0 $blk_dev_size snapshot $DMHUGEDISK_ZERO $SCRATCH_DEV N $chunk_size" - _dmsetup_create huge-test-zero --table "$DMHUGEDISK_ZERO_TABLE" || \ + _dmsetup_create $DMHUGE_TEST_ZERO --table "$DMHUGEDISK_ZERO_TABLE" || \ _fatal "failed to create dm huge zero device" - _dmsetup_create huge-test --table "$DMHUGEDISK_DEV_TABLE" || \ + _dmsetup_create $DMHUGE_TEST --table "$DMHUGEDISK_DEV_TABLE" || \ _fatal "failed to create dm huge device" } _dmhugedisk_cleanup() { $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 - _dmsetup_remove huge-test - _dmsetup_remove huge-test-zero + _dmsetup_remove $DMHUGE_TEST + _dmsetup_remove $DMHUGE_TEST_ZERO }
tests/generic/620 +1 -0
@@ -47,6 +47,7 @@ testfile=$SCRATCH_MNT/testfile-$seq $XFS_IO_PROG -fc "pwrite -S 0xaa 0 1m" -c "fsync" $testfile | _filter_xfs_io +_dmhugedisk_cleanup # success, all done status=0 exit
Signature · 1 line
2.45.2
PATCH 3/40 fuzzy: don't use killall
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Having test cleanup call 'killall xfs_io fsx xfs_scrub' results in a system wide process kill, rather than just the processes the test is running directly.
Make sure we only kill processes the fuzz test directly owns. We can do this with 'pkill --parent $$ <process names>' to limit the search for processes to kill to just the children of the current process.
--- common/fuzzy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
common/fuzzy +3 -2
@@ -1145,7 +1145,6 @@ __stress_scrub_fsstress_loop() { _require_xfs_stress_scrub() { _require_xfs_io_command "scrub" _require_test_program "xfsfind" - _require_command "$KILLALL_PROG" killall _require_freeze command -v _filter_scratch &>/dev/null || \ _notrun 'xfs scrub stress test requires common/filter'
@@ -1178,7 +1177,9 @@ _scratch_xfs_stress_scrub_cleanup() { # distorts the golden output. echo "Killing stressor processes at $(date)" >> $seqres.full _kill_fsstress - $KILLALL_PROG -INT xfs_io fsx xfs_scrub >> $seqres.full 2>&1 + pkill -INT --parent $$ xfs_io >> $seqres.full 2>&1 + pkill -INT --parent $$ fsx >> $seqres.full 2>&1 + pkill -INT --parent $$ xfs_scrub >> $seqres.full 2>&1 # Tests are not allowed to exit with the scratch fs frozen. If we # started a fs freeze/thaw background loop, wait for that loop to exit
Signature · 1 line
2.45.2
PATCH 26/40 generic/310: cleanup killing background processes
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Use the trick we used with fsstress of copying the binary to a test specific name so that we can simply use pkill to reliably kill the background processes this test runs. Also use SIGPIPE to avoid bash from throwing out "Killed" errors.
--- tests/generic/310 | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-)
tests/generic/310 +9 -12
@@ -29,11 +29,8 @@ _begin_fstest auto # Override the default cleanup function. _cleanup() { - if [ -n "$readdir_pid" ]; then - pkill --parent "$readdir_pid" t_readdir > /dev/null 2>&1 - kill -9 $readdir_pid > /dev/null 2>&1 - wait - fi + pkill -9 $seq.t_readdir > /dev/null 2>&1 + wait rm -rf $TEST_DIR/tmp rm -f $tmp.* }
@@ -74,6 +71,8 @@ check_kernel_bug() RUN_TIME=$((30 * $TIME_FACTOR)) +cp $here/src/t_readdir_1 $TEST_DIR/$seq.t_readdir_1 +cp $here/src/t_readdir_2 $TEST_DIR/$seq.t_readdir_2 SEQ_DIR=$TEST_DIR/$seq mkdir -p $SEQ_DIR for n in {1..4096}; do
@@ -82,12 +81,11 @@ done _test_read() { - $here/src/t_readdir_1 $SEQ_DIR > /dev/null 2>&1 & - readdir_pid=$! + $TEST_DIR/$seq.t_readdir_1 $SEQ_DIR > /dev/null 2>&1 & sleep $RUN_TIME - kill $readdir_pid - unset readdir_pid + pkill -PIPE $seq.t_readdir_1 wait + check_kernel_bug if [ $? -ne 0 ]; then _fatal "kernel bug detected, check dmesg for more infomation."
@@ -96,11 +94,10 @@ _test_read() _test_lseek() { - $here/src/t_readdir_2 $SEQ_DIR > /dev/null 2>&1 & + $TEST_DIR/$seq.t_readdir_2 $SEQ_DIR > /dev/null 2>&1 & readdir_pid=$! sleep $RUN_TIME - kill $readdir_pid - unset readdir_pid + pkill -PIPE $seq.t_readdir_2 wait check_kernel_bug
Signature · 1 line
2.45.2
PATCH 8/40 fstests: per-test dmdust instances
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
We can't run two tests that use dmdust at the same time because the device name is the same. hence they interfere with each other. Give dmdust devices their own per-test names to avoid this problem.
--- common/dmdust | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
common/dmdust +6 -4
@@ -4,12 +4,14 @@ # # common functions for setting up and tearing down a dmdust device +export DUST_NAME="dust-test.$seq" + _init_dust() { local DEV_SIZE=`blockdev --getsz $SCRATCH_DEV` - DUST_DEV=/dev/mapper/dust-test + DUST_DEV=/dev/mapper/$DUST_NAME DUST_TABLE="0 $DEV_SIZE dust $SCRATCH_DEV 0 512" - _dmsetup_create dust-test --table "$DUST_TABLE" || \ + _dmsetup_create $DUST_NAME --table "$DUST_TABLE" || \ _fatal "failed to create dust device" }
@@ -29,7 +31,7 @@ _cleanup_dust() { # If dmsetup load fails then we need to make sure to do resume here # otherwise the umount will hang - $DMSETUP_PROG resume dust-test > /dev/null 2>&1 + $DMSETUP_PROG resume $DUST_NAME > /dev/null 2>&1 $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 - _dmsetup_remove dust-test + _dmsetup_remove $DUST_NAME }
Signature · 1 line
2.45.2
PATCH 10/40 fstests: fix DM device creation/removal vs udev races
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
When there is load on the system, newly created DM devices don't seem to be created consistently. When a new device is created, it is supposed to be created as /dev/dm-X, and then a udev rule creates the symlink from /dev/mapper/<dev name> to /dev/dm-X.
Unfortunately, a lot of the tests that use dynamically created dm devices (dmerror, dmflakey) are not being created with this device node structure. This is resulting in getting the wrong short device name for the block device and hence we can't find the filesystem sysfs attribute directory for the filesystem on that block device.
For example, with added debug to check what device name was being passed around and resolved:
eneric/489 - output mismatch (see /mnt/xfs/runner-10/results/xfs/generic/489.out.bad)
--- tests/generic/489.out 2022-12-21 15:53:25.503043574 +1100
+++ /mnt/xfs/runner-10/results/xfs/generic/489.out.bad 2024-10-24 10:27:29.767196340 +1100
@@ -1,4 +1,10 @@
QA output created by 489
+./common/rc: line 4955: /sys/fs/xfs/flakey-test.489/error/fail_at_unmount: No such file or directory
+dev: /dev/mapper/flakey-test.489
+resolved dev: /dev/mapper/flakey-test.489
+brw-rw----. 1 root disk 251, 5 Oct 24 10:27 /dev/mapper/flakey-test.489
+./common/rc: line 4955: /sys/fs/xfs/flakey-test.489/error/metadata/EIO/max_retries: No such file or directory +./common/rc: line 4955: /sys/fs/xfs/flakey-test.489/error/metadata/EIO/retry_timeout_seconds: No such file or directory
...
(Run 'diff -u /home/dave/src/xfstests-dev/tests/generic/489.out /mnt/xfs/runner-10/results/xfs/generic/489.out.bad' to see the entire diff)
Here we see that the block device node is actually at /dev/mapper/flakey-test.489, not a link to a /dev/dm-X device node.
This implies that the udev rule to create the /dev/dm-X node and the symlink to it at /dev/mapper/flakey-test.489 has not run, and something else created the device node.
That looks like a bug in _dmsetup_create(). It creates the new DM device, then runs 'dmsetup mknodes', then waits for udev to settle. This means the mknodes command - which makes sure the dm device nodes exist - is racing with udev to create the device nodes. They don't use the same rules to create nodes, so we end up with this broken situation.
'dmsetup mknodes' is considered legacy functionality, intended for systems that have no udev capability. For systems that have udev enabled (i.e. all modern distros), mknodes should not be run because it creates a different device node structure to what udev creates and can race with udev as we see here.
Fix it by removing the 'dmsetup mknodes' as it is unnecessary to create the correct device node layout the rest of the system is expecting to see.
Additionally,_dmsetup_remove() calls 'dmsetup mknodes' and that can also race with udev and cause issues. Hence we need to remove that call from the remove operation as well.
Further, 'dmsetup remove' is also subject to races with udev which results in device remove failing. This problem is documented in the dmsetup man page and suggests the use of the "--retry" option. This means dmsetup will retry several times over a few seconds before failing the removal.
This reduces the remove failure rate substantially,
but it can still occasionally fail when the system is under heavy load and udev processing is very slow. This is fixable, but requires fstests udev infrastructure changes as it requires udevadm functionality that is relatively new. Hence that will be done as a separate fix.
--- common/rc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
common/rc +2 -3
@@ -5162,8 +5162,8 @@ _require_label_get_max() _dmsetup_remove() { $UDEV_SETTLE_PROG >/dev/null 2>&1 - $DMSETUP_PROG remove "$@" >>$seqres.full 2>&1 - $DMSETUP_PROG mknodes >/dev/null 2>&1 + $DMSETUP_PROG remove --retry "$@" >>$seqres.full 2>&1 + $UDEV_SETTLE_PROG >/dev/null 2>&1 } _dmsetup_create()
@@ -5174,7 +5174,6 @@ _dmsetup_create() # device open won't also fail. $UDEV_SETTLE_PROG >/dev/null 2>&1 $DMSETUP_PROG create "$@" >>$seqres.full 2>&1 || return 1 - $DMSETUP_PROG mknodes >/dev/null 2>&1 $UDEV_SETTLE_PROG >/dev/null 2>&1 }
Signature · 1 line
2.45.2
PATCH 37/40 fstests: always use fail-at-unmount semantics for XFS
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Rather than require every test that tests unmount in failure conditions have to set up fail-at-unmount semantics for the underlying filesystem, use these semantics for all test and scratch device mounts.
This currently only affects XFS filesystems, and helps prevent unexpected unmount hangs in EIO tests because metadata writes are configured to try forever by default.
--- common/rc | 2 ++ 1 file changed, 2 insertions(+)
common/rc +2 -0
@@ -410,6 +410,7 @@ _try_scratch_mount() mount_ret=$? [ $mount_ret -ne 0 ] && return $mount_ret _idmapped_mount $SCRATCH_DEV $SCRATCH_MNT + _prepare_for_eio_shutdown $SCRATCH_DEV } # mount scratch device with given options and _fail if mount fails
@@ -609,6 +610,7 @@ _test_mount() mount_ret=$? [ $mount_ret -ne 0 ] && return $mount_ret _idmapped_mount $TEST_DEV $TEST_DIR + _prepare_for_eio_shutdown $TEST_DEV } _test_unmount()
Signature · 1 line
2.45.2
PATCH 14/40 fstests: xfs/227 is really slow
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
The slowest test tto run on my test VMs is xfs/227:
...
xfs/227 826
...
It is doing nested iteration on created filesets that are explicitly defined, so separate the inner loop filesets and run the outer loops in parallel.
Also reduce the number of times we have to execute setfattr and xfs_io to once per created file instead of once per xattr/extent count per file.
The result is test runtime reduction of ~60%.
....
xfs/227 336
....
--- tests/xfs/227 | 57 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 21 deletions(-)
tests/xfs/227 +36 -21
@@ -41,7 +41,7 @@ fragment_freespace() # allocate inode space mkdir -p $_dir for i in `seq 0 1 1000`; do - touch $_file.$i + echo -n > $_file.$i done for i in `seq 0 63 1000`; do mv $_file.$i $_dir
@@ -68,19 +68,23 @@ fragment_freespace() create_attrs() { - for foo in `seq 0 1 $1`; do - $SETFATTR_PROG -n user.$foo -v 0xbabe $2 - done + ( echo "# file: $2" + for i in `seq 0 1 $1`; do + echo "user.$foo=\"0xbabe\"" + done ) > $tmp.$1.attrs + $SETFATTR_PROG --restore=$tmp.$1.attrs $2 } create_data() { - size=`expr \( $1 + 1 \) \* 4096` - $XFS_IO_PROG -f -c "truncate $size" $2 > /dev/null 2>&1 - for foo in `seq $1 -1 0`; do - let offset=$foo*4096 - $XFS_IO_PROG -f -c "resvsp $offset 4096" $2 > /dev/null 2>&1 + local blocks=$1 + local cmd_str + + for off in `seq $blocks -1 0`; do + cmd_str="-c \"resvsp $((off * 4096)) 4096\" $cmd_str" done + $XFS_IO_PROG -f -c "truncate $((($blocks + 1) * 4096))" \ + $cmd_str $2 >> seqres.full 2>&1 } # create the designated file with a certain number of attributes and a certain
@@ -119,6 +123,27 @@ create_target_attr_last() create_attrs $nattrs $target } +do_fsr() +{ + local n=$1 + local i=$2 + local j + + for j in `seq 5 1 20`; do + create_target_attr_first $i $j $targ.$i.$j >> $seqres.full 2>&1 + done + xfs_bmap -vp $targ.$i.* >> $seqres.full 2>&1 + FSRXFSTEST=true xfs_fsr -d -v -C $n $targ.$i.* >> $seqres.full 2>&1 + xfs_bmap -vp $targ.$i.* >> $seqres.full 2>&1 + for j in `seq 5 1 20`; do + create_target_attr_last $i $j $targ.$i.$j >> $seqres.full 2>&1 + done + xfs_bmap -vp $targ.$i.* >> $seqres.full 2>&1 + FSRXFSTEST=true xfs_fsr -d -v -C $n $targ.$i.* >> $seqres.full 2>&1 + xfs_bmap -vp $targ.$i.* >> $seqres.full 2>&1 +} + + # use a small filesystem so we can control freespace easily _scratch_mkfs_sized $((50 * 1024 * 1024)) >> $seqres.full 2>&1 _scratch_mount
@@ -154,19 +179,9 @@ targ=$SCRATCH_MNT/fsr_test_file.$$ for n in `seq 4 1 12`; do echo "*** n == $n ***" >> $seqres.full for i in `seq 5 1 15`; do - for j in `seq 5 1 20`; do - create_target_attr_first $i $j $targ.$i.$j >> $seqres.full 2>&1 - done - xfs_bmap -vp $targ.$i.* >> $seqres.full 2>&1 - FSRXFSTEST=true xfs_fsr -d -v -C $n $targ.$i.* >> $seqres.full 2>&1 - xfs_bmap -vp $targ.$i.* >> $seqres.full 2>&1 - for j in `seq 5 1 20`; do - create_target_attr_last $i $j $targ.$i.$j >> $seqres.full 2>&1 - done - xfs_bmap -vp $targ.$i.* >> $seqres.full 2>&1 - FSRXFSTEST=true xfs_fsr -d -v -C $n $targ.$i.* >> $seqres.full 2>&1 - xfs_bmap -vp $targ.$i.* >> $seqres.full 2>&1 + do_fsr $n $i & done + wait done _scratch_unmount
Signature · 1 line
2.45.2
PATCH 5/40 fstests: per-test dmerror instances
In reply to Dave ChinnerWe can't run two tests that use dmerror at the same time because the device name is the same. hence they interfere with each other. Give dmerror devices their own per-test names to avoid this problem.
Note that we need a hack to pass the test sequence number through to src/dmerror as used by generic/441 so that it can construct the dmerror name correctly.
--- common/dmerror | 70 +++++++++++++++++++++++++---------------------- src/dmerror | 6 +++- tests/generic/441 | 2 +- 3 files changed, 43 insertions(+), 35 deletions(-)
common/dmerror +37 -33
@@ -4,6 +4,10 @@ # # common functions for setting up and tearing down a dmerror device +export DMERROR_NAME="error-test.$seq" +export DMERROR_RTNAME="error-rttest.$seq" +export DMERROR_LOGNAME="error-logtest.$seq" + _dmerror_setup_vars() { local backing_dev="$1"
@@ -31,7 +35,7 @@ _dmerror_setup() done # Scratch device - export DMERROR_DEV='/dev/mapper/error-test' + export DMERROR_DEV="/dev/mapper/$DMERROR_NAME" _dmerror_setup_vars $SCRATCH_DEV # Realtime device. We reassign SCRATCH_RTDEV so that all the scratch
@@ -41,7 +45,7 @@ _dmerror_setup() # Set up the device switch local dm_backing_dev=$SCRATCH_RTDEV export NON_ERROR_RTDEV="$SCRATCH_RTDEV" - SCRATCH_RTDEV='/dev/mapper/error-rttest' + SCRATCH_RTDEV="/dev/mapper/$DMERROR_RTNAME" else # Already set up; recreate tables local dm_backing_dev="$NON_ERROR_RTDEV"
@@ -57,7 +61,7 @@ _dmerror_setup() # Set up the device switch local dm_backing_dev=$SCRATCH_LOGDEV export NON_ERROR_LOGDEV="$SCRATCH_LOGDEV" - SCRATCH_LOGDEV='/dev/mapper/error-logtest' + SCRATCH_LOGDEV="/dev/mapper/$DMERROR_LOGNAME" else # Already set up; recreate tables local dm_backing_dev="$NON_ERROR_LOGDEV"
@@ -71,19 +75,19 @@ _dmerror_init() { _dmerror_setup "$@" - _dmsetup_remove error-test - _dmsetup_create error-test --table "$DMLINEAR_TABLE" || \ + _dmsetup_remove $DMERROR_NAME + _dmsetup_create $DMERROR_NAME --table "$DMLINEAR_TABLE" || \ _fatal "failed to create dm linear device" if [ -n "$NON_ERROR_RTDEV" ]; then - _dmsetup_remove error-rttest - _dmsetup_create error-rttest --table "$DMLINEAR_RTTABLE" || \ + _dmsetup_remove $DMERROR_RTNAME + _dmsetup_create $DMERROR_RTNAME --table "$DMLINEAR_RTTABLE" || \ _fatal "failed to create dm linear rt device" fi if [ -n "$NON_ERROR_LOGDEV" ]; then - _dmsetup_remove error-logtest - _dmsetup_create error-logtest --table "$DMLINEAR_LOGTABLE" || \ + _dmsetup_remove $DMERROR_LOGNAME + _dmsetup_create $DMERROR_LOGNAME --table "$DMLINEAR_LOGTABLE" || \ _fatal "failed to create dm linear log device" fi }
@@ -102,15 +106,15 @@ _dmerror_unmount() _dmerror_cleanup() { - test -n "$NON_ERROR_LOGDEV" && $DMSETUP_PROG resume error-logtest &>/dev/null - test -n "$NON_ERROR_RTDEV" && $DMSETUP_PROG resume error-rttest &>/dev/null - $DMSETUP_PROG resume error-test > /dev/null 2>&1 + test -n "$NON_ERROR_LOGDEV" && $DMSETUP_PROG resume $DMERROR_LOGNAME &>/dev/null + test -n "$NON_ERROR_RTDEV" && $DMSETUP_PROG resume $DMERROR_RTNAME &>/dev/null + $DMSETUP_PROG resume $DMERROR_NAME > /dev/null 2>&1 $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 - test -n "$NON_ERROR_LOGDEV" && _dmsetup_remove error-logtest - test -n "$NON_ERROR_RTDEV" && _dmsetup_remove error-rttest - _dmsetup_remove error-test + test -n "$NON_ERROR_LOGDEV" && _dmsetup_remove $DMERROR_LOGNAME + test -n "$NON_ERROR_RTDEV" && _dmsetup_remove $DMERROR_RTNAME + _dmsetup_remove $DMERROR_NAME unset DMERROR_DEV DMLINEAR_TABLE DMERROR_TABLE
@@ -145,45 +149,45 @@ _dmerror_load_error_table() # Suspend the scratch device before the log and realtime devices so # that the kernel can freeze and flush the filesystem if the caller # wanted a freeze. - $DMSETUP_PROG suspend $suspend_opt error-test + $DMSETUP_PROG suspend $suspend_opt $DMERROR_NAME [ $? -ne 0 ] && _fail "dmsetup suspend failed" if [ -n "$NON_ERROR_RTDEV" ]; then - $DMSETUP_PROG suspend $suspend_opt error-rttest + $DMSETUP_PROG suspend $suspend_opt $DMERROR_RTNAME [ $? -ne 0 ] && _fail "failed to suspend error-rttest" fi if [ -n "$NON_ERROR_LOGDEV" ]; then - $DMSETUP_PROG suspend $suspend_opt error-logtest + $DMSETUP_PROG suspend $suspend_opt $DMERROR_LOGNAME [ $? -ne 0 ] && _fail "failed to suspend error-logtest" fi # Load new table - $DMSETUP_PROG load error-test --table "$DMERROR_TABLE" + $DMSETUP_PROG load $DMERROR_NAME --table "$DMERROR_TABLE" load_res=$? if [ -n "$NON_ERROR_RTDEV" ]; then - $DMSETUP_PROG load error-rttest --table "$DMERROR_RTTABLE" + $DMSETUP_PROG load $DMERROR_RTNAME --table "$DMERROR_RTTABLE" [ $? -ne 0 ] && _fail "failed to load error table into error-rttest" fi if [ -n "$NON_ERROR_LOGDEV" ]; then - $DMSETUP_PROG load error-logtest --table "$DMERROR_LOGTABLE" + $DMSETUP_PROG load $DMERROR_LOGNAME --table "$DMERROR_LOGTABLE" [ $? -ne 0 ] && _fail "failed to load error table into error-logtest" fi # Resume devices in the opposite order that we suspended them. if [ -n "$NON_ERROR_LOGDEV" ]; then - $DMSETUP_PROG resume error-logtest + $DMSETUP_PROG resume $DMERROR_LOGNAME [ $? -ne 0 ] && _fail "failed to resume error-logtest" fi if [ -n "$NON_ERROR_RTDEV" ]; then - $DMSETUP_PROG resume error-rttest + $DMSETUP_PROG resume $DMERROR_RTNAME [ $? -ne 0 ] && _fail "failed to resume error-rttest" fi - $DMSETUP_PROG resume error-test + $DMSETUP_PROG resume $DMERROR_NAME resume_res=$? [ $load_res -ne 0 ] && _fail "dmsetup failed to load error table"
@@ -206,45 +210,45 @@ _dmerror_load_working_table() # Suspend the scratch device before the log and realtime devices so # that the kernel can freeze and flush the filesystem if the caller # wanted a freeze. - $DMSETUP_PROG suspend $suspend_opt error-test + $DMSETUP_PROG suspend $suspend_opt $DMERROR_NAME [ $? -ne 0 ] && _fail "dmsetup suspend failed" if [ -n "$NON_ERROR_RTDEV" ]; then - $DMSETUP_PROG suspend $suspend_opt error-rttest + $DMSETUP_PROG suspend $suspend_opt $DMERROR_RTNAME [ $? -ne 0 ] && _fail "failed to suspend error-rttest" fi if [ -n "$NON_ERROR_LOGDEV" ]; then - $DMSETUP_PROG suspend $suspend_opt error-logtest + $DMSETUP_PROG suspend $suspend_opt $DMERROR_LOGNAME [ $? -ne 0 ] && _fail "failed to suspend error-logtest" fi # Load new table - $DMSETUP_PROG load error-test --table "$DMLINEAR_TABLE" + $DMSETUP_PROG load $DMERROR_NAME --table "$DMLINEAR_TABLE" load_res=$? if [ -n "$NON_ERROR_RTDEV" ]; then - $DMSETUP_PROG load error-rttest --table "$DMLINEAR_RTTABLE" + $DMSETUP_PROG load $DMERROR_RTNAME --table "$DMLINEAR_RTTABLE" [ $? -ne 0 ] && _fail "failed to load working table into error-rttest" fi if [ -n "$NON_ERROR_LOGDEV" ]; then - $DMSETUP_PROG load error-logtest --table "$DMLINEAR_LOGTABLE" + $DMSETUP_PROG load $DMERROR_LOGNAME --table "$DMLINEAR_LOGTABLE" [ $? -ne 0 ] && _fail "failed to load working table into error-logtest" fi # Resume devices in the opposite order that we suspended them. if [ -n "$NON_ERROR_LOGDEV" ]; then - $DMSETUP_PROG resume error-logtest + $DMSETUP_PROG resume $DMERROR_LOGNAME [ $? -ne 0 ] && _fail "failed to resume error-logtest" fi if [ -n "$NON_ERROR_RTDEV" ]; then - $DMSETUP_PROG resume error-rttest + $DMSETUP_PROG resume $DMERROR_RTNAME [ $? -ne 0 ] && _fail "failed to resume error-rttest" fi - $DMSETUP_PROG resume error-test + $DMSETUP_PROG resume $DMERROR_NAME resume_res=$? [ $load_res -ne 0 ] && _fail "dmsetup failed to load error table"
src/dmerror +5 -1
@@ -2,6 +2,10 @@ # SPDX-License-Identifier: GPL-2.0 # Copyright (c) 2017, Jeff Layton <[email protected]> +# hackity hack hack - first arg is the test number, second arg is op. +# This is needed so that dmerror names the dm dev correctly. +seq=$1 + . ./common/config . ./common/dmerror
@@ -10,7 +14,7 @@ if [ -z "$DMERROR_DEV" ]; then exit 1 fi -case $1 in +case $2 in load_error_table) _dmerror_load_error_table ;;
tests/generic/441 +1 -1
@@ -59,7 +59,7 @@ _require_fs_space $SCRATCH_MNT 65536 testfile=$SCRATCH_MNT/fsync-err-test echo "$here/src/fsync-err $sflag -d $here/src/dmerror $testfile" >> $seqres.full -$here/src/fsync-err $sflag -d $here/src/dmerror $testfile +$here/src/fsync-err $sflag -d "$here/src/dmerror $seq" $testfile # success, all done _dmerror_load_working_table
Signature · 1 line
2.45.2
PATCH 13/40 fstests: clean up loop device instantiation
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Lots of tests do there own special thing with loop devices rather than using _create_loop_device() and _destroy_loop_device(). This oftens means they do not clean up after themselves properly, leaving stale loop devices around that result in unmountable test or scratch devices. This is common when tests are killed by user interrupt.
Even the tests that do use _destroy_loop_device and try to clean up often do it incorrectly, leading to spurious error messages.
Some tests try to use dynamic instantiation via "mount -o loop", but then don't clean up in the correct order or hack around to find the loop device that was instantiated because the test needs to know the instantiated device name
Clean this up by converting all the tests to use _create_loop_device() and _destroy_loop_device(). In all the tests, use the variable "loop_dev" for the device consistently. In _destroy_loop_device(), test that a device name has been passed so that we don't try to clean up the same device twice (e.g. once before test exit and again from the _cleanup() function). When we destroy a loop device, unset the variable used to hold the loop device name so that we don't try to destroy it twice.
This results in much more reliable cleanup and clean exit from fstests when killed by the user.
--- common/metadump | 32 ++++++++++++-------------------- tests/generic/067 | 11 ++++++++--- tests/generic/361 | 6 +++++- tests/generic/563 | 14 +++++++++----- tests/generic/564 | 12 ++++++------ tests/generic/590 | 9 ++++++--- tests/generic/744 | 4 ++-- tests/generic/746 | 6 +++++- tests/xfs/014 | 7 +++++-- tests/xfs/049 | 35 +++++++++++++++++++++-------------- tests/xfs/073 | 24 +++++++++++++----------- tests/xfs/074 | 21 ++++++++++++--------- tests/xfs/078 | 16 +++++++++------- tests/xfs/148 | 23 ++++++++++++++--------- tests/xfs/149 | 4 ++++ tests/xfs/216 | 15 ++++++++++----- tests/xfs/217 | 22 ++++++++++++++++------ tests/xfs/250 | 14 +++++++++----- tests/xfs/259 | 13 ++++++++----- tests/xfs/513 | 44 ++++++++++++++++++++------------------------ tests/xfs/521 | 8 ++++++-- tests/xfs/528 | 10 +++++++--- tests/xfs/530 | 11 ++++++----- tests/xfs/606 | 12 ++++++++---- tests/xfs/613 | 40 ++++++++++++++-------------------------- tests/xfs/613.out | 1 - 26 files changed, 235 insertions(+), 179 deletions(-)
common/metadump +12 -20
@@ -24,17 +24,9 @@ _xfs_cleanup_verify_metadump() test -n "$XFS_METADUMP_FILE" && rm -f "$XFS_METADUMP_FILE" - if [ -n "$XFS_METADUMP_IMG" ]; then - losetup -n -a -O BACK-FILE,NAME | grep "^$XFS_METADUMP_IMG" | while read backing ldev; do - losetup -d "$ldev" - done - - # Don't call rm directly with a globbed argument here to avoid - # issues issues with variable expansions. - for img in "$XFS_METADUMP_IMG"*; do - test -e "$img" && rm -f "$img" - done - fi + [ -n "$md_data_loop_dev" ] && _destroy_loop_device $md_data_loop_dev + [ -n "$md_log_loop_dev" ] && _destroy_loop_device $md_log_loop_dev + rm -f $data_img $log_img } # Can xfs_metadump snapshot the fs metadata to a v1 metadump file?
@@ -122,25 +114,25 @@ _xfs_verify_metadump_v2() _scratch_xfs_mdrestore $metadump_file # Create loopdev for data device so we can mount the fs - data_loop=$(_create_loop_device $data_img) + md_data_loop_dev=$(_create_loop_device $data_img) # Create loopdev for log device if we recovered anything - test -s "$log_img" && log_loop=$(_create_loop_device $log_img) + test -s "$log_img" && md_log_loop_dev=$(_create_loop_device $log_img) # Mount fs, run an extra test, fsck, and unmount - SCRATCH_DEV=$data_loop SCRATCH_LOGDEV=$log_loop _scratch_mount + SCRATCH_DEV=$md_data_loop_dev SCRATCH_LOGDEV=$md_log_loop_dev _scratch_mount if [ -n "$extra_test" ]; then - SCRATCH_DEV=$data_loop SCRATCH_LOGDEV=$log_loop $extra_test + SCRATCH_DEV=$md_data_loop_dev SCRATCH_LOGDEV=$md_log_loop_dev $extra_test fi - SCRATCH_DEV=$data_loop SCRATCH_LOGDEV=$log_loop _check_xfs_scratch_fs - SCRATCH_DEV=$data_loop _scratch_unmount + SCRATCH_DEV=$md_data_loop_dev SCRATCH_LOGDEV=$md_log_loop_dev _check_xfs_scratch_fs + _unmount $md_data_loop_dev # Tear down what we created - if [ -b "$log_loop" ]; then - _destroy_loop_device $log_loop + if [ -b "$md_log_loop_dev" ]; then + _destroy_loop_device $md_log_loop_dev rm -f $log_img fi - _destroy_loop_device $data_loop + _destroy_loop_device $md_data_loop_dev rm -f $data_img }
tests/generic/067 +8 -3
@@ -37,13 +37,18 @@ mount_nonexistent_mnt() $MOUNT_PROG $SCRATCH_DEV $TEST_DIR/nosuchdir >>$seqres.full 2>&1 } -# fs driver should be able to handle mounting a free loop device gracefully -# xfs ever hung, "ec53d1d xfs: don't block on buffer read errors" fixed it +# fs driver should be able to handle mounting a free loop device gracefully xfs +# ever hung, "ec53d1d xfs: don't block on buffer read errors" fixed it +# +# Using 'losetup -f' like this is racy. We might end up mounting a real loop dev +# here, so unmount $SCRATCH_MNT (not the loop dev we might not own!) and ignore +# any error it might return. mount_free_loopdev() { echo "# mount a free loop device" >>$seqres.full loopdev=`losetup -f` - $MOUNT_PROG -t $FSTYP $loopdev $SCRATCH_MNT >>$seqres.full 2>&1 + _mount $loopdev $SCRATCH_MNT >>$seqres.full 2>&1 + _unmount $SCRATCH_MNT >> /dev/null 2>&1 } # mount with wrong fs type specified.
tests/generic/361 +5 -1
@@ -17,7 +17,7 @@ _begin_fstest auto quick _cleanup() { _unmount $fs_mnt - _destroy_loop_device $loop_dev + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev cd / rm -f $tmp.* }
@@ -54,6 +54,10 @@ $XFS_IO_PROG -fc "pwrite 0 520m" $fs_mnt/testfile >>$seqres.full 2>&1 # remount should not hang $MOUNT_PROG -o remount,ro $fs_mnt >>$seqres.full 2>&1 +_unmount $fs_mnt +_destroy_loop_device $loop_dev +unset loop_dev + # success, all done echo "Silence is golden" status=0
tests/generic/563 +9 -5
@@ -87,12 +87,12 @@ reset() # cgroup I/O accounting doesn't work on partitions. Use a loop device to rule # that out. -LOOP_DEV=$(_create_loop_device $SCRATCH_DEV) -smajor=$((0x`stat -L -c %t $LOOP_DEV`)) -sminor=$((0x`stat -L -c %T $LOOP_DEV`)) +loop_dev=$(_create_loop_device $SCRATCH_DEV) +smajor=$((0x`stat -L -c %t $loop_dev`)) +sminor=$((0x`stat -L -c %T $loop_dev`)) -_mkfs_dev $LOOP_DEV >> $seqres.full 2>&1 -_mount $LOOP_DEV $SCRATCH_MNT || _fail "mount failed" +_mkfs_dev $loop_dev >> $seqres.full 2>&1 +_mount $loop_dev $SCRATCH_MNT || _fail "mount failed" blksize=$(_get_block_size "$SCRATCH_MNT")
@@ -147,6 +147,10 @@ if [ "$drop_io_cgroup" = 1 ]; then echo "-io" > $cgdir/cgroup.subtree_control || _fail "subtree control" fi +_unmount $SCRATCH_MNT +_destroy_loop_device $loop_dev +unset loop_dev + # success, all done status=0 exit
tests/generic/564 +6 -6
@@ -19,7 +19,7 @@ _cleanup() { cd / rm -rf $tmp.* - [ -z "$loopdev" ] || _destroy_loop_device $loopdev + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev } # Import common functions.
@@ -72,11 +72,11 @@ $XFS_IO_PROG -f -c "copy_range -l 32k $testdir" $testdir/copy echo echo source/destination as blkdev returns EINVAL $XFS_IO_PROG -f -c "truncate 128k" $testdir/img >> $seqres.full 2>&1 -loopdev=`_create_loop_device $testdir/img` -$XFS_IO_PROG -c "copy_range -l 32k $testdir/file" $loopdev -$XFS_IO_PROG -f -c "copy_range -l 32k $loopdev" $testdir/copy -_destroy_loop_device $loopdev -loopdev= +loop_dev=`_create_loop_device $testdir/img` +$XFS_IO_PROG -c "copy_range -l 32k $testdir/file" $loop_dev +$XFS_IO_PROG -f -c "copy_range -l 32k $loop_dev" $testdir/copy +_destroy_loop_device $loop_dev +unset loop_dev echo echo source/destination as chardev returns EINVAL
tests/generic/590 +6 -3
@@ -15,9 +15,10 @@ _begin_fstest auto prealloc preallocrw # Override the default cleanup function. _cleanup() { + _scratch_unmount + [ -n $loop_dev ] && _destroy_loop_device $loop_dev cd / rm -f $tmp.* - test -n "$loop" && _destroy_loop_device "$loop" rm -f "$TEST_DIR/$seq" }
@@ -56,9 +57,9 @@ if [[ $FSTYP = xfs ]]; then loopsz="$((filesz + (1 << 26)))" _require_fs_space "$TEST_DIR" $((loopsz / 1024)) $XFS_IO_PROG -c "truncate $loopsz" -f "$TEST_DIR/$seq" - loop="$(_create_loop_device "$TEST_DIR/$seq")" + loop_dev="$(_create_loop_device "$TEST_DIR/$seq")" USE_EXTERNAL=yes - SCRATCH_RTDEV="$loop" + SCRATCH_RTDEV="$loop_dev" disabled_features=() # disable reflink if not supported by realtime devices
@@ -114,6 +115,8 @@ $XFS_IO_PROG -c "truncate 0" -c fsync "$SCRATCH_MNT/file" # We need to do this before the loop device gets torn down. _scratch_unmount _check_scratch_fs +_destroy_loop_device $loop_dev +unset loop_dev echo "Silence is golden" status=0
tests/generic/744 +2 -2
@@ -17,8 +17,8 @@ _cleanup() _unmount $mnt2 &> /dev/null _unmount $mnt1 &> /dev/null - [ -b "$loop_dev2" ] && losetup -d $loop_dev2 - [ -b "$loop_dev1" ] && losetup -d $loop_dev1 + [ -b "$loop_dev2" ] && _destroy_loop_device $loop_dev2 + [ -b "$loop_dev1" ] && _destroy_loop_device $loop_dev1 [ -n "$seq" ] && rm -rf $TEST_DIR/$seq }
tests/generic/746 +5 -1
@@ -39,7 +39,7 @@ esac _cleanup() { _unmount $loop_mnt &> /dev/null - _destroy_loop_device $loop_dev + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev if [ $status -eq 0 ]; then rm -rf $tmp rm $img_file
@@ -223,5 +223,9 @@ while read line; do done < $fiemap_after echo "done." +_unmount $loop_mnt +_destroy_loop_device $loop_dev +unset loop_dev + status=0 exit
tests/xfs/014 +5 -2
@@ -23,6 +23,7 @@ _cleanup() { cd / _unmount $LOOP_MNT 2>/dev/null + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev _scratch_unmount 2>/dev/null rm -f $tmp.* }
@@ -166,19 +167,21 @@ LOOP_FILE=$SCRATCH_MNT/$seq.fs LOOP_MNT=$SCRATCH_MNT/$seq.mnt $MKFS_XFS_PROG -d "file=1,name=$LOOP_FILE,size=10g" >> $seqres.full 2>&1 +loop_dev=$(_create_loop_device $LOOP_FILE) mkdir -p $LOOP_MNT -_mount -o uquota,gquota $LOOP_FILE $LOOP_MNT || \ +_mount -o uquota,gquota $loop_dev $LOOP_MNT || \ _fail "Failed to mount loop fs." _test_enospc $LOOP_MNT _test_edquot $LOOP_MNT _unmount $LOOP_MNT +_destroy_loop_device $loop_dev +unset loop_dev echo $orig_sp_time > /proc/sys/fs/xfs/speculative_prealloc_lifetime _scratch_unmount - status=0 exit
tests/xfs/049 +21 -14
@@ -12,16 +12,17 @@ _begin_fstest rw auto quick # Override the default cleanup function. _cleanup() { - cd / - umount $SCRATCH_MNT/test2 > /dev/null 2>&1 - umount $SCRATCH_MNT/test > /dev/null 2>&1 - rm -f $tmp.* + cd / + _unmount $SCRATCH_MNT/test2 > /dev/null 2>&1 + _unmount $SCRATCH_MNT/test > /dev/null 2>&1 + [ -n "$loop_dev2" ] && _destroy_loop_device $loop_dev2 + [ -n "$loop_dev1" ] && _destroy_loop_device $loop_dev1 + rm -f $tmp.* - if [ -w $seqres.full ] - then - echo "--- mounts at end (after cleanup)" >> $seqres.full - mount >> $seqres.full - fi + if [ -w $seqres.full ]; then + echo "--- mounts at end (after cleanup)" >> $seqres.full + mount >> $seqres.full + fi } # Import common functions.
@@ -64,7 +65,8 @@ mkdir $SCRATCH_MNT/test $SCRATCH_MNT/test2 >> $seqres.full 2>&1 \ || _fail "!!! failed to make mount points" _log "Mount xfs via loop" -mount -t xfs -o loop $SCRATCH_MNT/test.xfs $SCRATCH_MNT/test >> $seqres.full 2>&1 \ +loop_dev1=$(_create_loop_device $SCRATCH_MNT/test.xfs) +_mount $loop_dev1 $SCRATCH_MNT/test >> $seqres.full 2>&1 \ || _fail "!!! failed to loop mount xfs" _log "stress"
@@ -80,11 +82,12 @@ dd if=/dev/zero of=$SCRATCH_MNT/test/test.ext2 bs=1024 count=10240 >> $seqres.fu || _fail "!!! create file failed" _log "Create ext2 fs in file on looped xfs" -echo y | mkfs -t ext2 $SCRATCH_MNT/test/test.ext2 >> $seqres.full 2>&1 \ +loop_dev2=$(_create_loop_device $SCRATCH_MNT/test/test.ext2) +echo y | mkfs -t ext2 $loop_dev2 >> $seqres.full 2>&1 \ || _fail "!!! failed to mkfs ext2 on xfs" _log "Mount ext2 on xfs via loop" -mount -t ext2 -o loop $SCRATCH_MNT/test/test.ext2 $SCRATCH_MNT/test2 >> $seqres.full 2>&1 \ +_mount $loop_dev2 $SCRATCH_MNT/test2 >> $seqres.full 2>&1 \ || _fail "!!! failed to loop mount xfs" _log "stress ext2 on xfs via loop"
@@ -96,12 +99,16 @@ rm -rf $SCRATCH_MNT/test/* >> $seqres.full 2>&1 \ || _fail "!!! clean failed" _log "umount ext2 on xfs" -umount $SCRATCH_MNT/test2 >> $seqres.full 2>&1 \ +_unmount $SCRATCH_MNT/test2 >> $seqres.full 2>&1 \ || _fail "!!! umount ext2 failed" +_destroy_loop_device $loop_dev2 +unset loop_dev2 _log "umount xfs" -umount $SCRATCH_MNT/test >> $seqres.full 2>&1 \ +_unmount $SCRATCH_MNT/test >> $seqres.full 2>&1 \ || _fail "!!! umount xfs failed" +_destroy_loop_device $loop_dev1 +unset loop_dev1 echo "--- mounts at end (before cleanup)" >> $seqres.full mount >> $seqres.full
tests/xfs/073 +13 -11
@@ -23,6 +23,8 @@ _cleanup() _scratch_unmount 2>/dev/null _unmount $imgs.loop 2>/dev/null _unmount $imgs.source_dir 2>/dev/null + [ -n "$loop_dev1" ] && _destroy_loop_device $loop_dev1 + [ -n "$loop_dev2" ] && _destroy_loop_device $loop_dev2 [ -d $imgs.loop ] && rmdir $imgs.loop [ -d $imgs.source_dir ] && rm -rf $imgs.source_dir rm -f $imgs.* $tmp.* /var/tmp/xfs_copy.log.*
@@ -65,10 +67,11 @@ _verify_copy() rmdir $target_dir 2>/dev/null mkdir $target_dir - _mount -t xfs -o loop $target $target_dir 2>/dev/null + loop_dev1=$(_create_loop_device $target) + _mount $loop_dev1 $target_dir 2>/dev/null if [ $? -ne 0 ]; then echo retrying mount with nouuid option >>$seqres.full - _mount -t xfs -o loop -o nouuid $target $target_dir + _mount -o nouuid $loop_dev1 $target_dir if [ $? -ne 0 ]; then echo mount failed - evil! return
@@ -100,6 +103,8 @@ _verify_copy() echo unmounting and removing new image _unmount $source_dir _unmount $target_dir > /dev/null 2>&1 + _destroy_loop_device $loop_dev1 + unset loop_dev1 rm -f $target }
@@ -134,18 +139,15 @@ ${MKFS_XFS_PROG} -dfile,name=$imgs.source,size=100g \ rmdir $imgs.source_dir 2>/dev/null mkdir $imgs.source_dir -_mount -t xfs -o loop $imgs.source $imgs.source_dir -loop2=`mount | grep $imgs.source | grep -o -e 'loop=.*[^),]' | grep -o -e '/.*$'` +loop_dev2=$(_create_loop_device $imgs.source) +_mount $loop_dev2 $imgs.source_dir cp -a $here $imgs.source_dir -_mount -t xfs -o remount,ro $imgs.source $imgs.source_dir -$XFS_COPY_PROG $imgs.source $imgs.image | _filter_copy '#' $imgs.image '#' '#' +_mount -o remount,ro $loop_dev2 $imgs.source_dir +$XFS_COPY_PROG $loop_dev2 $imgs.image 2> /dev/null | _filter_copy '#' $imgs.image '#' '#' _verify_copy $imgs.image $imgs.source $imgs.source_dir -# HACK WARNING: -# -# We're done with the nested loop mount, now we have to clean -# up the pieces that mount is incapable of doing. -losetup -d $loop2 > /dev/null 2>&1 +_destroy_loop_device $loop_dev2 +unset loop_dev2 echo echo === copying scratch device to multiple targets
tests/xfs/074 +12 -9
@@ -26,7 +26,7 @@ _begin_fstest quick auto prealloc rw _cleanup() { cd / - _destroy_loop_device $LOOP_DEV + [ -n "$loop_dev" ] &&_destroy_loop_device $loop_dev rm -f $tmp.* $LOOP_FILE }
@@ -45,10 +45,10 @@ LOOP_FILE=$TEST_DIR/$seq.img LOOP_MNT=$TEST_DIR/$seq.mnt mkdir -p $LOOP_MNT $XFS_IO_PROG -ft -c "truncate 1t" $LOOP_FILE >> $seqres.full -LOOP_DEV=`_create_loop_device $LOOP_FILE` +loop_dev=`_create_loop_device $LOOP_FILE` -_mkfs_dev -d size=260g,agcount=2 $LOOP_DEV -_mount $LOOP_DEV $LOOP_MNT +_mkfs_dev -d size=260g,agcount=2 $loop_dev +_mount $loop_dev $LOOP_MNT BLOCK_SIZE=$(_get_file_block_size $LOOP_MNT)
@@ -59,11 +59,11 @@ $XFS_IO_PROG -ft \ -c "falloc 0 $(($BLOCK_SIZE * 2097152))" \ $LOOP_MNT/foo >> $seqres.full -umount $LOOP_MNT -_check_xfs_filesystem $LOOP_DEV none none +_unmount $LOOP_MNT +_check_xfs_filesystem $loop_dev none none -_mkfs_dev -f $LOOP_DEV -_mount $LOOP_DEV $LOOP_MNT +_mkfs_dev -f $loop_dev +_mount $loop_dev $LOOP_MNT # check we trim both ends of the extent approproiately; this will fail # on 1k block size filesystems without the correct fixes in place.
@@ -73,7 +73,10 @@ $XFS_IO_PROG -ft \ $LOOP_MNT/foo >> $seqres.full _unmount $LOOP_MNT -_check_xfs_filesystem $LOOP_DEV none none +_check_xfs_filesystem $loop_dev none none + +_destroy_loop_device $loop_dev +unset loop_dev # success, all done echo "Silence is golden"
tests/xfs/078 +9 -7
@@ -17,7 +17,7 @@ _cleanup() cd / rm -f $tmp.* _unmount $LOOP_MNT 2>/dev/null - [ -n "$LOOP_DEV" ] && _destroy_loop_device $LOOP_DEV 2>/dev/null + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev 2>/dev/null # try to keep the image file if test fails [ $status -eq 0 ] && rm -f $LOOP_IMG rmdir $LOOP_MNT
@@ -55,7 +55,7 @@ _grow_loop() agsize=$5 $XFS_IO_PROG -f -c "truncate $original" $LOOP_IMG - LOOP_DEV=`_create_loop_device $LOOP_IMG` + loop_dev=`_create_loop_device $LOOP_IMG` dparam="" if [ -n "$agsize" ]; then
@@ -67,15 +67,15 @@ _grow_loop() echo echo "*** mkfs loop file (size=$original)" - $MKFS_XFS_PROG -b size=$bsize $dparam $LOOP_DEV | \ + $MKFS_XFS_PROG -b size=$bsize $dparam $loop_dev | \ _filter_mkfs 2>/dev/null echo "*** extend loop file" - _destroy_loop_device $LOOP_DEV + _destroy_loop_device $loop_dev $XFS_IO_PROG -c "pwrite $new_size $bsize" $LOOP_IMG | _filter_io - LOOP_DEV=`_create_loop_device $LOOP_IMG` + loop_dev=`_create_loop_device $LOOP_IMG` echo "*** mount loop filesystem" - _mount -t xfs $LOOP_DEV $LOOP_MNT + _mount $loop_dev $LOOP_MNT echo "*** grow loop filesystem" $XFS_GROWFS_PROG $LOOP_MNT 2>&1 | _filter_growfs 2>&1
@@ -87,9 +87,11 @@ _grow_loop() if [ "$check" -gt "0" ] then echo "*** check" - _check_xfs_filesystem $LOOP_IMG none none + _check_xfs_filesystem $loop_dev none none fi + _destroy_loop_device $loop_dev + unset loop_dev rm -f $LOOP_IMG }
tests/xfs/148 +14 -9
@@ -15,7 +15,7 @@ _cleanup() { cd / _unmount $mntpt > /dev/null 2>&1 - _destroy_loop_device $loopdev > /dev/null 2>&1 + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev rm -r -f $tmp.* }
@@ -48,12 +48,12 @@ rm -f $imgfile $imgfile.old # even when security xattrs are present so we are always doing name matches on # lookup and not name hash compares as leaf/node forms will do. $XFS_IO_PROG -f -c 'truncate 40m' $imgfile -loopdev=$(_create_loop_device $imgfile) -MKFS_OPTIONS="-m crc=0 -i size=512" _mkfs_dev $loopdev >> $seqres.full +loop_dev=$(_create_loop_device $imgfile) +MKFS_OPTIONS="-m crc=0 -i size=512" _mkfs_dev $loop_dev >> $seqres.full # Mount image file mkdir -p $mntpt -_mount $loopdev $mntpt +_mount $loop_dev $mntpt echo "creating entries" >> $seqres.full
@@ -91,7 +91,8 @@ cat $tmp.log | _filter_test_dir # Corrupt the entries _unmount $mntpt -_destroy_loop_device $loopdev +_destroy_loop_device $loop_dev +unset loop_dev cp $imgfile $imgfile.old sed -b \ -e "s/$nullstr/too_many\x00beans/g" \
@@ -99,8 +100,9 @@ sed -b \ -i $imgfile test "$(md5sum < $imgfile)" != "$(md5sum < $imgfile.old)" || _fail "sed failed to change the image file?" -loopdev=$(_create_loop_device $imgfile) -_mount $loopdev $mntpt + +loop_dev=$(_create_loop_device $imgfile) +_mount $loop_dev $mntpt # Try to access the corrupt metadata echo "++ ACCESSING BAD METADATA" | tee -a $seqres.full
@@ -111,7 +113,7 @@ cat $tmp.log | _filter_test_dir | sed -e '/Could not list/d' echo "does scrub complain?" >> $seqres.full # Does scrub complain about this? -if _supports_xfs_scrub $mntpt $loopdev; then +if _supports_xfs_scrub $mntpt $loop_dev; then $XFS_SCRUB_PROG -n $mntpt >> $seqres.full 2>&1 res=$? test $((res & 1)) -eq 0 && \
@@ -122,11 +124,14 @@ echo "does repair complain?" >> $seqres.full # Does repair complain about this? _unmount $mntpt -$XFS_REPAIR_PROG -n $loopdev >> $seqres.full 2>&1 +$XFS_REPAIR_PROG -n $loop_dev >> $seqres.full 2>&1 res=$? test $res -eq 1 || \ echo "repair failed to report corruption ($res)" +_destroy_loop_device $loop_dev +unset loop_dev + # success, all done status=0 exit
tests/xfs/149 +4 -0
@@ -84,6 +84,10 @@ $XFS_GROWFS_PROG -D 16384 $loop_symlink > /dev/null echo "=== xfs_growfs - check device node ===" $XFS_GROWFS_PROG -D 20480 $loop_dev > /dev/null +_unmount $mntdir +_destroy_loop_device $loop_dev +unset loop_dev + # success, all done status=0 exit
tests/xfs/216 +10 -5
@@ -15,6 +15,7 @@ _begin_fstest log metadata auto quick _cleanup() { _unmount $LOOP_MNT > /dev/null 2>&1 + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev cd / rm -f $tmp.* }
@@ -24,7 +25,7 @@ _scratch_mkfs_xfs >/dev/null 2>&1 _scratch_mount _require_loop -LOOP_DEV=$SCRATCH_MNT/test_fs +LOOP_IMG=$SCRATCH_MNT/test_fs LOOP_MNT=$SCRATCH_MNT/test_fs_dir loop_mkfs_opts=
@@ -55,22 +56,26 @@ _do_mkfs() for i in $*; do echo -n "fssize=${i}g " $MKFS_XFS_PROG -f -b size=4096 -l version=2 \ - -d name=$LOOP_DEV,size=${i}g $loop_mkfs_opts |grep log - _mount -o loop -t xfs $LOOP_DEV $LOOP_MNT + -d size=${i}g $loop_mkfs_opts $loop_dev |grep log + _mount $loop_dev $LOOP_MNT echo "test write" > $LOOP_MNT/test _unmount $LOOP_MNT > /dev/null 2>&1 done } # make large holey file -$XFS_IO_PROG -f -c "truncate 256g" $LOOP_DEV +$XFS_IO_PROG -f -c "truncate 256g" $LOOP_IMG -choose_golden_output $0 $LOOP_DEV +choose_golden_output $0 $LOOP_IMG #make loopback mount dir mkdir $LOOP_MNT +loop_dev=$(_create_loop_device $LOOP_IMG) + # walk over standard sizes (up to 256GB) _do_mkfs 1 2 4 8 16 32 64 128 256 +_destroy_loop_device $loop_dev +unset loop_dev status=0 exit
tests/xfs/217 +16 -6
@@ -12,6 +12,12 @@ _begin_fstest log metadata auto # Import common functions. . ./common/filter +_cleanup() +{ + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev + cd / + rm -f $tmp.* +} _require_scratch _scratch_mkfs_xfs >/dev/null 2>&1
@@ -20,7 +26,7 @@ _scratch_mount _require_fs_space $SCRATCH_MNT 2202000 _require_loop -LOOP_DEV=$SCRATCH_MNT/test_fs +LOOP_IMG=$SCRATCH_MNT/test_fs LOOP_MNT=$SCRATCH_MNT/test_fs_dir _do_mkfs()
@@ -28,28 +34,30 @@ _do_mkfs() for i in $*; do echo -n "fssize=${i}g " $MKFS_XFS_PROG -f -b size=4096 -l version=2 \ - -d name=$LOOP_DEV,size=${i}g |grep log - _mount -o loop -t xfs $LOOP_DEV $LOOP_MNT + -d size=${i}g $loop_dev |grep log + _mount $loop_dev $LOOP_MNT echo "test write" > $LOOP_MNT/test _unmount $LOOP_MNT > /dev/null 2>&1 # punch out the previous blocks so that we keep the amount of # disk space the test requires down to a minimum. - $XFS_IO_PROG -f -c "unresvsp 0 16383g" $LOOP_DEV + $XFS_IO_PROG -f -c "unresvsp 0 16383g" $LOOP_IMG done } # make large holey file -$XFS_IO_PROG -f -c "truncate 16383g" $LOOP_DEV +$XFS_IO_PROG -f -c "truncate 16383g" $LOOP_IMG #make loopback mount dir mkdir $LOOP_MNT # test if large logs are supported -$MKFS_XFS_PROG -f -l size=256m -d name=$LOOP_DEV,size=10g > /dev/null 2>&1 +$MKFS_XFS_PROG -f -l size=256m -d name=$LOOP_IMG,size=10g > /dev/null 2>&1 if [ $? -ne 0 ]; then _notrun "large log sizes not supported by mkfs" fi +loop_dev=$(_create_loop_device $LOOP_IMG) + # # walk over "new" sizes supported by recent xfsprogs. # Note that the last test is for 16TB-1GB as 32bit platforms only support
@@ -57,5 +65,7 @@ fi # _do_mkfs 512 1024 2048 4096 8192 16383 +_destroy_loop_device $loop_dev +unset loop_dev status=0 exit
tests/xfs/250 +9 -5
@@ -14,7 +14,8 @@ _cleanup() { cd / _unmount $LOOP_MNT 2>/dev/null - rm -f $LOOP_DEV + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev + rm -f $LOOP_IMG rmdir $LOOP_MNT rm -f $tmp.* }
@@ -26,7 +27,7 @@ _require_test _require_loop _require_xfs_io_command "falloc" -LOOP_DEV=$TEST_DIR/$seq.fs +LOOP_IMG=$TEST_DIR/$seq.fs LOOP_MNT=$TEST_DIR/$seq.mnt _filter_io()
@@ -45,7 +46,7 @@ _test_loop() agsize=$2 fsize=$3 - dparam="file,name=$LOOP_DEV,size=$size" + dparam="file,name=$LOOP_IMG,size=$size" if [ -n "$agsize" ]; then dparam="$dparam,agsize=$agsize" fi
@@ -55,7 +56,8 @@ _test_loop() | _filter_mkfs 2>/dev/null echo "*** mount loop filesystem" - _mount -t xfs -o loop $LOOP_DEV $LOOP_MNT + loop_dev=$(_create_loop_device $LOOP_IMG) + mount $loop_dev $LOOP_MNT echo "*** preallocate large file" $XFS_IO_PROG -f -c "resvsp 0 $fsize" $LOOP_MNT/foo | _filter_io
@@ -64,7 +66,9 @@ _test_loop() _unmount $LOOP_MNT > /dev/null 2>&1 echo "*** check loop filesystem" - _check_xfs_filesystem $LOOP_DEV none none + _check_xfs_filesystem $loop_dev none none + _destroy_loop_device $loop_dev + unset loop_dev } _test_loop 50g 16m 40G
tests/xfs/259 +8 -5
@@ -12,7 +12,10 @@ _begin_fstest auto quick # Override the default cleanup function. _cleanup() { - rm -f "$testfile" + [ -n "$loop_dev" ] && _destroy_loop_device $testfile + rm -f "$testfile" + cd / + rm -f $tmp.* } # Import common functions.
@@ -45,13 +48,13 @@ for del in $sizes_to_check; do rm -f "$testfile" dd if=/dev/zero "of=$testfile" bs=1 count=0 seek=$ddseek \ >/dev/null 2>&1 || echo "dd failed" - lofile=$(losetup -f) - losetup $lofile "$testfile" - $MKFS_XFS_PROG -l size=32m -b size=$bs $lofile | _filter_mkfs \ + loop_dev=$(_create_loop_device $testfile) + $MKFS_XFS_PROG -l size=32m -b size=$bs $loop_dev | _filter_mkfs \ >/dev/null 2> $tmp.mkfs || echo "mkfs failed!" . $tmp.mkfs sync - losetup -d $lofile + _destroy_loop_device $loop_dev + unset loop_dev done done
tests/xfs/513 +20 -24
124 lines not on this page · raw message
tests/xfs/521 +6 -2
@@ -21,7 +21,7 @@ _cleanup() { cd / _scratch_unmount >> $seqres.full 2>&1 - test -e "$rtdev" && losetup -d $rtdev >> $seqres.full 2>&1 + [ -n "$rt_loop_dev" ] && _destroy_loop_device $rt_loop_dev rm -f $tmp.* $TEST_DIR/$seq.rtvol }
@@ -35,7 +35,7 @@ _require_no_large_scratch_dev echo "Create fake rt volume" truncate -s 400m $TEST_DIR/$seq.rtvol -rtdev=$(_create_loop_device $TEST_DIR/$seq.rtvol) +rt_loop_dev=$(_create_loop_device $TEST_DIR/$seq.rtvol) echo "Format and mount 100m rt volume" export USE_EXTERNAL=yes
@@ -69,6 +69,10 @@ cp -p $testdir/original $testdir/copy3 echo "Check filesystem" _check_scratch_fs +_scratch_unmount +_destroy_loop_device $rt_loop_dev +unset rt_loop_dev + # success, all done status=0 exit
tests/xfs/528 +7 -3
@@ -15,7 +15,7 @@ _cleanup() { cd / _scratch_unmount >> $seqres.full 2>&1 - test -e "$rtdev" && losetup -d $rtdev >> $seqres.full 2>&1 + [ -n "$rt_loop_dev" ] && _destroy_loop_device $rt_loop_dev rm -f $tmp.* $TEST_DIR/$seq.rtvol }
@@ -155,11 +155,11 @@ test_ops() { echo "Create fake rt volume" $XFS_IO_PROG -f -c "truncate 400m" $TEST_DIR/$seq.rtvol -rtdev=$(_create_loop_device $TEST_DIR/$seq.rtvol) +rt_loop_dev=$(_create_loop_device $TEST_DIR/$seq.rtvol) echo "Make sure synth rt volume works" export USE_EXTERNAL=yes -export SCRATCH_RTDEV=$rtdev +export SCRATCH_RTDEV=$rt_loop_dev _scratch_mkfs > $seqres.full _try_scratch_mount || \ _notrun "Could not mount with synthetic rt volume"
@@ -170,6 +170,10 @@ test_ops 262144 # not a power of two test_ops 327680 +_scratch_unmount +_destroy_loop_device $rt_loop_dev +unset rt_loop_dev + # success, all done status=0 exit
tests/xfs/530 +6 -5
@@ -15,7 +15,7 @@ _cleanup() { cd / _scratch_unmount >> $seqres.full 2>&1 - test -e "$rtdev" && losetup -d $rtdev >> $seqres.full 2>&1 + [ -n "$rt_loop_dev" ] && _destroy_loop_device $rt_loop_dev rm -f $tmp.* $TEST_DIR/$seq.rtvol }
@@ -52,12 +52,12 @@ fi rtdevsz=$((nr_bits * rtextsz)) truncate -s $rtdevsz $TEST_DIR/$seq.rtvol -rtdev=$(_create_loop_device $TEST_DIR/$seq.rtvol) +rt_loop_dev=$(_create_loop_device $TEST_DIR/$seq.rtvol) echo "Format and mount rt volume" export USE_EXTERNAL=yes -export SCRATCH_RTDEV=$rtdev +export SCRATCH_RTDEV=$rt_loop_dev _scratch_mkfs -d size=$((1024 * 1024 * 1024)) \ -r size=${rtextsz},extsize=${rtextsz} >> $seqres.full _try_scratch_mount || _notrun "Couldn't mount fs with synthetic rt volume"
@@ -116,8 +116,9 @@ done echo "Check filesystem" _check_scratch_fs -losetup -d $rtdev -rm -f $TEST_DIR/$seq.rtvol +_scratch_unmount +_destroy_loop_device $rt_loop_dev +unset rt_loop_dev # success, all done status=0
tests/xfs/606 +8 -4
@@ -13,10 +13,8 @@ _begin_fstest auto quick growfs _cleanup() { - local dev _unmount $LOOP_MNT 2>/dev/null - dev=$(losetup -j testfile | cut -d: -f1) - losetup -d $dev 2>/dev/null + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev rm -rf $LOOP_IMG $LOOP_MNT cd / rm -f $tmp.*
@@ -40,7 +38,9 @@ $MKFS_XFS_PROG -f $LOOP_IMG >$seqres.full # Extend by just 8K, expected to start with the last full-size AG ends of # above 1G block device. $XFS_IO_PROG -f -c "truncate 1073750016" $LOOP_IMG -_mount -oloop $LOOP_IMG $LOOP_MNT + +loop_dev=$(_create_loop_device $LOOP_IMG) +_mount $loop_dev $LOOP_MNT # A known bug shows "XFS_IOC_FSGROWFSDATA xfsctl failed: No space left on # device" at here, refer to _fixed_by_kernel_commit above $XFS_GROWFS_PROG $LOOP_MNT >$seqres.full
@@ -48,6 +48,10 @@ if [ $? -ne 0 ];then echo "xfs_growfs fails!" fi +_unmount $LOOP_MNT +_destroy_loop_device $loop_dev +unset loop_dev + echo "Silence is golden" # success, all done status=0
tests/xfs/613 +14 -26
@@ -15,14 +15,8 @@ _cleanup() cd / rm -f $tmp.* _unmount $LOOP_MNT 2>/dev/null - if [ -n "$LOOP_DEV" ];then - _destroy_loop_device $LOOP_DEV 2>/dev/null - fi - if [ -n "$LOOP_SPARE_DEV" ];then - _destroy_loop_device $LOOP_SPARE_DEV 2>/dev/null - fi + [ -n $loop_dev ] &&_destroy_loop_device $loop_dev rm -f $LOOP_IMG - rm -f $LOOP_SPARE_IMG rmdir $LOOP_MNT }
@@ -38,16 +32,11 @@ _require_loop _require_xfs_io_command "falloc" LOOP_IMG=$TEST_DIR/$seq.dev -LOOP_SPARE_IMG=$TEST_DIR/$seq.logdev LOOP_MNT=$TEST_DIR/$seq.mnt echo "** create loop device" $XFS_IO_PROG -f -c "truncate 32g" $LOOP_IMG -LOOP_DEV=`_create_loop_device $LOOP_IMG` - -echo "** create loop log device" -$XFS_IO_PROG -f -c "truncate 1g" $LOOP_SPARE_IMG -LOOP_SPARE_DEV=`_create_loop_device $LOOP_SPARE_IMG` +loop_dev=`_create_loop_device $LOOP_IMG` echo "** create loop mount point" rmdir $LOOP_MNT 2>/dev/null
@@ -56,8 +45,7 @@ mkdir -p $LOOP_MNT || _fail "cannot create loopback mount point" filter_loop() { sed -e "s,\B$LOOP_MNT,LOOP_MNT,g" \ - -e "s,\B$LOOP_DEV,LOOP_DEV,g" \ - -e "s,\B$LOOP_SPARE_DEV,LOOP_SPARE_DEV,g" + -e "s,\B$loop_dev,LOOP_DEV,g" } filter_xfs_opt()
@@ -70,22 +58,22 @@ MKFS_OPTIONS="" do_mkfs() { echo "FORMAT: $@" | filter_loop | tee -a $seqres.full - $MKFS_XFS_PROG -f $* $LOOP_DEV | _filter_mkfs >>$seqres.full 2>$tmp.mkfs + $MKFS_XFS_PROG -f $* $loop_dev | _filter_mkfs >>$seqres.full 2>$tmp.mkfs if [ "${PIPESTATUS[0]}" -ne 0 ]; then - _fail "Fails on _mkfs_dev $* $LOOP_DEV" + _fail "Fails on _mkfs_dev $* $loop_dev" fi . $tmp.mkfs } is_dev_mounted() { - findmnt --source $LOOP_DEV >/dev/null + findmnt --source $loop_dev >/dev/null return $? } get_mount_info() { - findmnt --source $LOOP_DEV -o OPTIONS -n + findmnt --source $loop_dev -o OPTIONS -n } force_unmount()
@@ -104,29 +92,29 @@ _do_test() local info # mount test - _mount $LOOP_DEV $LOOP_MNT $opts 2>>$seqres.full + _mount $loop_dev $LOOP_MNT $opts 2>>$seqres.full rc=$? if [ $rc -eq 0 ];then if [ "${mounted}" = "fail" ];then - echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "[FAILED]: mount $loop_dev $LOOP_MNT $opts" echo "ERROR: expect mount to fail, but it succeeded" return 1 fi is_dev_mounted if [ $? -ne 0 ];then - echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "[FAILED]: mount $loop_dev $LOOP_MNT $opts" echo "ERROR: fs not mounted even mount return 0" return 1 fi else if [ "${mounted}" = "pass" ];then - echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "[FAILED]: mount $loop_dev $LOOP_MNT $opts" echo "ERROR: expect mount to succeed, but it failed" return 1 fi is_dev_mounted if [ $? -eq 0 ];then - echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "[FAILED]: mount $loop_dev $LOOP_MNT $opts" echo "ERROR: fs is mounted even mount return non-zero" return 1 fi
@@ -142,13 +130,13 @@ _do_test() rc=$? if [ $rc -eq 0 ];then if [ "$found" != "true" ];then - echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "[FAILED]: mount $loop_dev $LOOP_MNT $opts" echo "ERROR: expected to find \"$key\" in mount info \"$info\"" return 1 fi else if [ "$found" != "false" ];then - echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "[FAILED]: mount $loop_dev $LOOP_MNT $opts" echo "ERROR: did not expect to find \"$key\" in \"$info\"" return 1 fi
tests/xfs/613.out +0 -1
@@ -1,6 +1,5 @@ QA output created by 613 ** create loop device -** create loop log device ** create loop mount point ** start xfs mount testing ... FORMAT: -m crc=0
Signature · 1 line
2.45.2
PATCH 12/40 fstests: clean up mount and unmount operations
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
The way tests run unmount is, at times, completely random. Sometimes they call the correct _scratch_unmount function, sometimes they open code it with a direct call to UMOUNT_PROG <dir>, sometimes they run umount directly.
This makes it really hard to instrument unmount operations when trying to work out why transient, unpredictable failures like this occur randomly during a test run:
umount: /mnt/xfs/runner-17/test: target is busy.
Sometimes it happens on a test device mount, sometimes a scratch device mount. Sometimes it happens to a test specific dm or loop device mount. But without instrumenting every single unmount call in every test, it's impossible to capture these failures easily.
Solve this problem by introducing the _unmount() wrapper. It is simply a call to UMOUNT_PROG <dir>, but it provides a single point were -every- unmount operation funnels through.
We already have a _mount wrapper for this reason. However, in trying to work out why mounts were failing (because unmounts were failing), I discovered that that_mount() is used inconsistently as well.
Sort this all out by adding and _unmount() wrapper to go with _mount() and use them everywhere consistently.
--- common/btrfs | 4 ++-- common/dmdelay | 4 ++-- common/dmdust | 4 ++-- common/dmerror | 4 ++-- common/dmflakey | 4 ++-- common/dmhugedisk | 2 +- common/dmlogwrites | 4 ++-- common/dmthin | 4 ++-- common/overlay | 10 +++++----- common/populate | 8 ++++---- common/rc | 42 +++++++++++++++++++++++++----------------- tests/generic/042 | 4 ++-- tests/generic/050 | 3 ++- tests/generic/067 | 6 +++--- tests/generic/081 | 2 +- tests/generic/085 | 6 +++--- tests/generic/108 | 2 +- tests/generic/171 | 2 +- tests/generic/172 | 2 +- tests/generic/173 | 2 +- tests/generic/174 | 2 +- tests/generic/306 | 2 +- tests/generic/332 | 2 +- tests/generic/361 | 2 +- tests/generic/373 | 2 +- tests/generic/374 | 2 +- tests/generic/395 | 2 +- tests/generic/459 | 2 +- tests/generic/563 | 10 +++++----- tests/generic/604 | 2 +- tests/generic/631 | 2 +- tests/generic/648 | 6 +++--- tests/generic/698 | 4 ++-- tests/generic/699 | 8 ++++---- tests/generic/704 | 2 +- tests/generic/717 | 2 +- tests/generic/730 | 2 +- tests/generic/731 | 2 +- tests/generic/732 | 4 ++-- tests/generic/741 | 2 +- tests/generic/744 | 6 +++--- tests/generic/746 | 8 ++++---- tests/xfs/014 | 6 +++--- tests/xfs/073 | 20 ++++++++++---------- tests/xfs/074 | 2 +- tests/xfs/078 | 6 +++--- tests/xfs/148 | 6 +++--- tests/xfs/149 | 4 ++-- tests/xfs/186 | 4 ++-- tests/xfs/216 | 10 ++++++++-- tests/xfs/217 | 4 ++-- tests/xfs/250 | 7 ++++--- tests/xfs/289 | 4 ++-- tests/xfs/507 | 2 +- tests/xfs/513 | 4 ++-- tests/xfs/544 | 2 +- tests/xfs/606 | 2 +- tests/xfs/613 | 4 ++-- 58 files changed, 149 insertions(+), 133 deletions(-)
common/btrfs +2 -2
@@ -352,7 +352,7 @@ _btrfs_stress_subvolume() while [ ! -e $stop_file ]; do $BTRFS_UTIL_PROG subvolume create $btrfs_mnt/$subvol_name $MOUNT_PROG -o subvol=$subvol_name $btrfs_dev $subvol_mnt - $UMOUNT_PROG $subvol_mnt + _unmount $subvol_mnt $BTRFS_UTIL_PROG subvolume delete $btrfs_mnt/$subvol_name done }
@@ -368,7 +368,7 @@ _btrfs_kill_stress_subvolume_pid() # Ignore if process already died. wait $subvol_pid &> /dev/null rm -f $stop_file - $UMOUNT_PROG $subvol_mnt &> /dev/null + _unmount $subvol_mnt &> /dev/null } # stress btrfs by running scrub in a loop
common/dmdelay +2 -2
@@ -28,7 +28,7 @@ _mount_delay() _unmount_delay() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } _cleanup_delay()
@@ -36,7 +36,7 @@ _cleanup_delay() # If dmsetup load fails then we need to make sure to do resume here # otherwise the umount will hang $DMSETUP_PROG resume $DELAY_NAME > /dev/null 2>&1 - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 _dmsetup_remove $DELAY_NAME }
common/dmdust +2 -2
@@ -24,7 +24,7 @@ _mount_dust() _unmount_dust() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } _cleanup_dust()
@@ -32,6 +32,6 @@ _cleanup_dust() # If dmsetup load fails then we need to make sure to do resume here # otherwise the umount will hang $DMSETUP_PROG resume $DUST_NAME > /dev/null 2>&1 - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 _dmsetup_remove $DUST_NAME }
common/dmerror +2 -2
@@ -101,7 +101,7 @@ _dmerror_mount() _dmerror_unmount() { - umount $SCRATCH_MNT + _unmount $SCRATCH_MNT } _dmerror_cleanup()
@@ -110,7 +110,7 @@ _dmerror_cleanup() test -n "$NON_ERROR_RTDEV" && $DMSETUP_PROG resume $DMERROR_RTNAME &>/dev/null $DMSETUP_PROG resume $DMERROR_NAME > /dev/null 2>&1 - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 test -n "$NON_ERROR_LOGDEV" && _dmsetup_remove $DMERROR_LOGNAME test -n "$NON_ERROR_RTDEV" && _dmsetup_remove $DMERROR_RTNAME
common/dmflakey +2 -2
@@ -71,7 +71,7 @@ _mount_flakey() _unmount_flakey() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } _cleanup_flakey()
@@ -82,7 +82,7 @@ _cleanup_flakey() test -n "$NON_FLAKEY_RTDEV" && $DMSETUP_PROG resume $FLAKEY_RTNAME &> /dev/null $DMSETUP_PROG resume flakey-test > /dev/null 2>&1 - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 _dmsetup_remove $FLAKEY_NAME test -n "$NON_FLAKEY_LOGDEV" && _dmsetup_remove $FLAKEY_LOGNAME
common/dmhugedisk +1 -1
@@ -42,7 +42,7 @@ _dmhugedisk_init() _dmhugedisk_cleanup() { - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 _dmsetup_remove $DMHUGE_TEST _dmsetup_remove $DMHUGE_TEST_ZERO }
common/dmlogwrites +2 -2
@@ -110,7 +110,7 @@ _log_writes_mount() _log_writes_unmount() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT } # _log_writes_replay_log <mark>
@@ -141,7 +141,7 @@ _log_writes_remove() _log_writes_cleanup() { - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 _log_writes_remove }
common/dmthin +2 -2
@@ -23,7 +23,7 @@ DMTHIN_VOL_DEV="/dev/mapper/$DMTHIN_VOL_NAME" _dmthin_cleanup() { - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 _dmsetup_remove $DMTHIN_VOL_NAME _dmsetup_remove $DMTHIN_POOL_NAME _dmsetup_remove $DMTHIN_META_NAME
@@ -32,7 +32,7 @@ _dmthin_cleanup() _dmthin_check_fs() { - $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 _check_scratch_fs $DMTHIN_VOL_DEV }
common/overlay +5 -5
@@ -142,18 +142,18 @@ _overlay_base_unmount() [ -n "$dev" -a -n "$mnt" ] || return 0 - $UMOUNT_PROG $mnt + _unmount $mnt } _overlay_test_unmount() { - $UMOUNT_PROG $TEST_DIR + _unmount $TEST_DIR _overlay_base_unmount "$OVL_BASE_TEST_DEV" "$OVL_BASE_TEST_DIR" } _overlay_scratch_unmount() { - $UMOUNT_PROG $SCRATCH_MNT + _unmount $SCRATCH_MNT _overlay_base_unmount "$OVL_BASE_SCRATCH_DEV" "$OVL_BASE_SCRATCH_MNT" }
@@ -342,7 +342,7 @@ _overlay_check_scratch_dirs() # Need to umount overlay for scratch dir check local ovl_mounted=`_is_dir_mountpoint $SCRATCH_MNT` - [ -z "$ovl_mounted" ] || $UMOUNT_PROG $SCRATCH_MNT + [ -z "$ovl_mounted" ] || _unmount $SCRATCH_MNT # Check dirs with extra overlay options _overlay_check_dirs $lowerdir $upperdir $workdir $*
@@ -387,7 +387,7 @@ _overlay_check_fs() else # Check and umount overlay for dir check ovl_mounted=`_is_dir_mountpoint $ovl_mnt` - [ -z "$ovl_mounted" ] || $UMOUNT_PROG $ovl_mnt + [ -z "$ovl_mounted" ] || _unmount $ovl_mnt fi _overlay_check_dirs $base_mnt/$OVL_LOWER $base_mnt/$OVL_UPPER \
common/populate +4 -4
@@ -517,7 +517,7 @@ _scratch_xfs_populate() { __populate_fragment_file "${SCRATCH_MNT}/RTRMAPBT" __populate_fragment_file "${SCRATCH_MNT}/REFCOUNTBT" - umount "${SCRATCH_MNT}" + _scratch_unmount } # Populate an ext4 on the scratch device with (we hope) all known
@@ -619,7 +619,7 @@ _scratch_ext4_populate() { # Make sure we get all the fragmentation we asked for __populate_fragment_file "${SCRATCH_MNT}/S_IFREG.FMT_ETREE" - umount "${SCRATCH_MNT}" + _scratch_unmount } # Find the inode number of a file
@@ -772,7 +772,7 @@ _scratch_xfs_populate_check() { dblksz="$(_xfs_get_dir_blocksize "$SCRATCH_MNT")" leaf_lblk="$((32 * 1073741824 / blksz))" node_lblk="$((64 * 1073741824 / blksz))" - umount "${SCRATCH_MNT}" + _scratch_unmount __populate_check_xfs_dformat "${extents_file}" "extents" __populate_check_xfs_dformat "${btree_file}" "btree"
@@ -885,7 +885,7 @@ _scratch_ext4_populate_check() { extents_slink="$(__populate_find_inode "${SCRATCH_MNT}/S_IFLNK.FMT_EXTENTS")" local_attr="$(__populate_find_inode "${SCRATCH_MNT}/ATTR.FMT_LOCAL")" block_attr="$(__populate_find_inode "${SCRATCH_MNT}/ATTR.FMT_BLOCK")" - umount "${SCRATCH_MNT}" + _scratch_unmount __populate_check_ext4_dformat "${extents_file}" "extents" __populate_check_ext4_dformat "${etree_file}" "etree"
common/rc +25 -17
137 lines not on this page · raw message
tests/generic/042 +2 -2
@@ -44,7 +44,7 @@ _crashtest() _filter_xfs_io $here/src/godown -f $mnt - $UMOUNT_PROG $mnt + _unmount $mnt _mount $img $mnt # We should /never/ see 0xCD in the file, because we wrote that pattern
@@ -54,7 +54,7 @@ _crashtest() _hexdump $file fi - $UMOUNT_PROG $mnt + _unmount $mnt } # Modify as appropriate.
tests/generic/050 +2 -1
@@ -87,8 +87,9 @@ blockdev --setro $SCRATCH_DEV echo "mounting filesystem that needs recovery on a read-only device:" _try_scratch_mount 2>&1 | _filter_ro_mount | _filter_scratch +# expects an error, so open code the unmount echo "unmounting read-only filesystem" -_scratch_unmount 2>&1 | _filter_scratch | _filter_ending_dot +$UMOUNT_PROG $SCRATCH_DEV 2>&1 | _filter_scratch | _filter_ending_dot # # This is the way out if the underlying device really is read-only.
tests/generic/067 +3 -3
@@ -66,7 +66,7 @@ umount_symlink_device() rm -f $symlink echo "# umount symlink to device, which is not mounted" >>$seqres.full ln -s $SCRATCH_DEV $symlink - $UMOUNT_PROG $symlink >>$seqres.full 2>&1 + _unmount $symlink >>$seqres.full 2>&1 } # umount a path name that is 256 bytes long, this should fail gracefully,
@@ -78,7 +78,7 @@ umount_toolong_name() _scratch_mount 2>&1 | tee -a $seqres.full echo "# umount a too-long name" >>$seqres.full - $UMOUNT_PROG $longname >>$seqres.full 2>&1 + _unmount $longname >>$seqres.full 2>&1 _scratch_unmount 2>&1 | tee -a $seqres.full }
@@ -93,7 +93,7 @@ lazy_umount_symlink() rm -f $symlink ln -s $SCRATCH_MNT/testdir $symlink - $UMOUNT_PROG -l $symlink >>$seqres.full 2>&1 + _unmount -l $symlink >>$seqres.full 2>&1 # _scratch_unmount should not be blocked _scratch_unmount 2>&1 | tee -a $seqres.full }
tests/generic/081 +1 -1
@@ -32,7 +32,7 @@ _cleanup() # other tests to fail. while test -e /dev/mapper/$vgname-$snapname || \ test -e /dev/mapper/$vgname-$lvname; do - $UMOUNT_PROG $mnt >> $seqres.full 2>&1 + _unmount $mnt >> $seqres.full 2>&1 $LVM_PROG lvremove -f $vgname/$snapname >>$seqres.full 2>&1 $LVM_PROG lvremove -f $vgname/$lvname >>$seqres.full 2>&1 $LVM_PROG vgremove -f $vgname >>$seqres.full 2>&1
tests/generic/085 +3 -3
@@ -27,7 +27,7 @@ cleanup_dmdev() $DMSETUP_PROG resume $lvdev >/dev/null 2>&1 [ -n "$pid" ] && kill -9 $pid 2>/dev/null wait $pid - $UMOUNT_PROG $lvdev >/dev/null 2>&1 + _unmount $lvdev >/dev/null 2>&1 _dmsetup_remove $node }
@@ -69,8 +69,8 @@ for ((i=0; i<100; i++)); do done & pid=$! for ((i=0; i<100; i++)); do - $MOUNT_PROG $lvdev $SCRATCH_MNT >/dev/null 2>&1 - $UMOUNT_PROG $lvdev >/dev/null 2>&1 + _mount $lvdev $SCRATCH_MNT >/dev/null 2>&1 + _unmount $lvdev >/dev/null 2>&1 done & pid="$pid $!"
tests/generic/108 +1 -1
@@ -18,7 +18,7 @@ _cleanup() { cd / echo running > /sys/block/`_short_dev $SCSI_DEBUG_DEV`/device/state - $UMOUNT_PROG $SCRATCH_MNT >>$seqres.full 2>&1 + _unmount $SCRATCH_MNT >>$seqres.full 2>&1 $LVM_PROG vgremove -f $vgname >>$seqres.full 2>&1 $LVM_PROG pvremove -f $SCRATCH_DEV $SCSI_DEBUG_DEV >>$seqres.full 2>&1 $UDEV_SETTLE_PROG
tests/generic/171 +1 -1
@@ -36,7 +36,7 @@ mkdir $testdir echo "Reformat with appropriate size" blksz="$(_get_block_size $testdir)" nr_blks=10240 -umount $SCRATCH_MNT +_scratch_unmount sz_bytes=$((nr_blks * 8 * blksz)) if [ $sz_bytes -lt $((32 * 1048576)) ]; then sz_bytes=$((32 * 1048576))
tests/generic/172 +1 -1
@@ -35,7 +35,7 @@ mkdir $testdir echo "Reformat with appropriate size" blksz="$(_get_block_size $testdir)" -umount $SCRATCH_MNT +_scratch_unmount file_size=$((768 * 1024 * 1024)) fs_size=$((1024 * 1024 * 1024))
tests/generic/173 +1 -1
@@ -36,7 +36,7 @@ mkdir $testdir echo "Reformat with appropriate size" blksz="$(_get_block_size $testdir)" nr_blks=10240 -umount $SCRATCH_MNT +_scratch_unmount sz_bytes=$((nr_blks * 8 * blksz)) if [ $sz_bytes -lt $((32 * 1048576)) ]; then sz_bytes=$((32 * 1048576))
tests/generic/174 +1 -1
@@ -37,7 +37,7 @@ mkdir $testdir echo "Reformat with appropriate size" blksz="$(_get_block_size $testdir)" nr_blks=10240 -umount $SCRATCH_MNT +_scratch_unmount sz_bytes=$((nr_blks * 8 * blksz)) if [ $sz_bytes -lt $((32 * 1048576)) ]; then sz_bytes=$((32 * 1048576))
tests/generic/306 +1 -1
@@ -12,7 +12,7 @@ _begin_fstest auto quick rw # Override the default cleanup function. _cleanup() { - umount $BINDFILE + _unmount $BINDFILE cd / rm -f $tmp.* }
tests/generic/332 +1 -1
@@ -61,7 +61,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "Check for damage" -umount $SCRATCH_MNT +_scratch_unmount _repair_scratch_fs >> $seqres.full # success, all done
tests/generic/361 +1 -1
@@ -16,7 +16,7 @@ _begin_fstest auto quick # Override the default cleanup function. _cleanup() { - $UMOUNT_PROG $fs_mnt + _unmount $fs_mnt _destroy_loop_device $loop_dev cd / rm -f $tmp.*
tests/generic/373 +1 -1
@@ -60,7 +60,7 @@ md5sum $testdir/file | _filter_scratch md5sum $othertestdir/otherfile | filter_otherdir echo "Unmount otherdir" -$UMOUNT_PROG $otherdir +_unmount $otherdir rm -rf $otherdir # success, all done
tests/generic/374 +1 -1
@@ -59,7 +59,7 @@ echo "Check output" md5sum $testdir/file $othertestdir/otherfile | filter_md5 echo "Unmount otherdir" -$UMOUNT_PROG $otherdir +_unmount $otherdir rm -rf $otherdir # success, all done
tests/generic/395 +1 -1
@@ -75,7 +75,7 @@ mount --bind $SCRATCH_MNT $SCRATCH_MNT/ro_bind_mnt mount -o remount,ro,bind $SCRATCH_MNT/ro_bind_mnt _set_encpolicy $SCRATCH_MNT/ro_bind_mnt/ro_dir |& _filter_scratch _get_encpolicy $SCRATCH_MNT/ro_bind_mnt/ro_dir |& _filter_scratch -umount $SCRATCH_MNT/ro_bind_mnt +_unmount $SCRATCH_MNT/ro_bind_mnt # success, all done status=0
tests/generic/459 +1 -1
@@ -28,7 +28,7 @@ _cleanup() xfs_freeze -u $SCRATCH_MNT 2>/dev/null cd / rm -f $tmp.* - $UMOUNT_PROG $SCRATCH_MNT >>$seqres.full 2>&1 + _unmount $SCRATCH_MNT >>$seqres.full 2>&1 $LVM_PROG vgremove -ff $vgname >>$seqres.full 2>&1 $LVM_PROG pvremove -ff $SCRATCH_DEV >>$seqres.full 2>&1 $UDEV_SETTLE_PROG
tests/generic/563 +5 -5
@@ -16,13 +16,13 @@ _begin_fstest auto quick # Override the default cleanup function. _cleanup() { + echo $$ > $cgdir/cgroup.procs + rmdir $cgdir/$seq-cg* > /dev/null 2>&1 + _unmount $SCRATCH_MNT > /dev/null 2>&1 + _destroy_loop_device $LOOP_DEV > /dev/null 2>&1 cd / rm -f $tmp.* - echo $$ > $cgdir/cgroup.procs - rmdir $cgdir/$seq-cg* > /dev/null 2>&1 - umount $SCRATCH_MNT > /dev/null 2>&1 - _destroy_loop_device $LOOP_DEV > /dev/null 2>&1 } # Import common functions.
@@ -80,7 +80,7 @@ reset() rmdir $cgdir/$seq-cg* > /dev/null 2>&1 $XFS_IO_PROG -fc "pwrite 0 $iosize" $SCRATCH_MNT/file \ >> $seqres.full 2>&1 - umount $SCRATCH_MNT || _fail "umount failed" + _unmount $SCRATCH_MNT || _fail "umount failed" _mount $LOOP_DEV $SCRATCH_MNT || _fail "mount failed" stat $SCRATCH_MNT/file > /dev/null }
tests/generic/604 +1 -1
@@ -26,7 +26,7 @@ done # mount the base fs. Delay the mount attempt by a small amount in the hope # that the mount() call will try to lock s_umount /after/ umount has already # taken it. -$UMOUNT_PROG $SCRATCH_MNT & +_unmount $SCRATCH_MNT & sleep 0.01s ; _scratch_mount wait
tests/generic/631 +1 -1
@@ -84,7 +84,7 @@ worker() { touch $mergedir/etc/access.conf mv $mergedir/etc/access.conf $mergedir/etc/access.conf.bak touch $mergedir/etc/access.conf - umount $mergedir + _unmount $mergedir done rm -f $SCRATCH_MNT/workers/$tag }
tests/generic/648 +3 -3
@@ -18,7 +18,7 @@ _cleanup() { _kill_fsstress if [ -n "$loopmnt" ]; then - $UMOUNT_PROG $loopmnt 2>/dev/null + _unmount $loopmnt 2>/dev/null rm -r -f $loopmnt fi _dmerror_unmount
@@ -102,7 +102,7 @@ while _soak_loop_running $((25 * TIME_FACTOR)); do # Mount again to replay log after loading working table, so we have a # consistent fs after test. - $UMOUNT_PROG $loopmnt + _unmount $loopmnt is_unmounted=1 # We must unmount dmerror at here, or whole later testing will crash. # So try to umount enough times, before we have no choice.
@@ -128,7 +128,7 @@ done # Make sure the fs image file is ok if [ -f "$loopimg" ]; then if _mount $loopimg $loopmnt -o loop; then - $UMOUNT_PROG $loopmnt &> /dev/null + _unmount $loopmnt &> /dev/null else _metadump_dev $DMERROR_DEV $seqres.scratch.final.md echo "final scratch mount failed"
tests/generic/698 +2 -2
@@ -17,8 +17,8 @@ _begin_fstest auto quick perms attr idmapped mount _cleanup() { cd / - $UMOUNT_PROG $SCRATCH_MNT/target-mnt 2>/dev/null - $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null + _unmount $SCRATCH_MNT/target-mnt 2>/dev/null + _unmount $SCRATCH_MNT 2>/dev/null rm -r -f $tmp.* }
tests/generic/699 +4 -4
@@ -15,9 +15,9 @@ _begin_fstest auto quick perms attr idmapped mount _cleanup() { cd / - $UMOUNT_PROG $SCRATCH_MNT/target-mnt - $UMOUNT_PROG $SCRATCH_MNT/ovl-merge 2>/dev/null - $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null + _unmount $SCRATCH_MNT/target-mnt + _unmount $SCRATCH_MNT/ovl-merge 2>/dev/null + _unmount $SCRATCH_MNT 2>/dev/null rm -r -f $tmp.* }
@@ -113,7 +113,7 @@ setup_overlayfs_idmapped_lower_metacopy_on() reset_overlayfs() { - $UMOUNT_PROG $SCRATCH_MNT/ovl-merge 2>/dev/null + _unmount $SCRATCH_MNT/ovl-merge 2>/dev/null rm -rf $upper $work $merge }
tests/generic/704 +1 -1
@@ -14,7 +14,7 @@ _cleanup() { cd / rm -r -f $tmp.* - [ -d "$SCSI_DEBUG_MNT" ] && $UMOUNT_PROG $SCSI_DEBUG_MNT 2>/dev/null + [ -d "$SCSI_DEBUG_MNT" ] && _unmount $SCSI_DEBUG_MNT 2>/dev/null _put_scsi_debug_dev }
tests/generic/717 +1 -1
@@ -85,7 +85,7 @@ mkdir -p $SCRATCH_MNT/xyz mount --bind $dir $SCRATCH_MNT/xyz --bind _pwrite_byte 0x60 0 $((blksz * (nrblks + 2))) $dir/c >> $seqres.full $XFS_IO_PROG -c "exchangerange $SCRATCH_MNT/xyz/c" $dir/a -umount $SCRATCH_MNT/xyz +_unmount $SCRATCH_MNT/xyz echo Swapping a file with itself $XFS_IO_PROG -c "exchangerange $dir/a" $dir/a
tests/generic/730 +1 -1
@@ -12,7 +12,7 @@ _begin_fstest auto quick _cleanup() { cd / - $UMOUNT_PROG $SCSI_DEBUG_MNT >>$seqres.full 2>&1 + _unmount $SCSI_DEBUG_MNT >>$seqres.full 2>&1 _put_scsi_debug_dev rm -f $tmp.* }
tests/generic/731 +1 -1
@@ -13,7 +13,7 @@ _begin_fstest auto quick _cleanup() { cd / - $UMOUNT_PROG $SCSI_DEBUG_MNT >>$seqres.full 2>&1 + _unmount $SCSI_DEBUG_MNT >>$seqres.full 2>&1 _put_scsi_debug_dev rm -f $tmp.* }
tests/generic/732 +2 -2
@@ -15,8 +15,8 @@ _begin_fstest auto quick rename # Override the default cleanup function. _cleanup() { - $UMOUNT_PROG $testdir1 2>/dev/null - $UMOUNT_PROG $testdir2 2>/dev/null + _unmount $testdir1 2>/dev/null + _unmount $testdir2 2>/dev/null cd / rm -r -f $tmp.* }
tests/generic/741 +1 -1
@@ -13,7 +13,7 @@ _begin_fstest auto quick volume tempfsid # Override the default cleanup function. _cleanup() { - umount $extra_mnt &> /dev/null + _unmount $extra_mnt &> /dev/null rm -rf $extra_mnt _unmount_flakey _cleanup_flakey
tests/generic/744 +3 -3
@@ -15,8 +15,8 @@ _cleanup() cd / rm -r -f $tmp.* - $UMOUNT_PROG $mnt2 &> /dev/null - $UMOUNT_PROG $mnt1 &> /dev/null + _unmount $mnt2 &> /dev/null + _unmount $mnt1 &> /dev/null [ -b "$loop_dev2" ] && losetup -d $loop_dev2 [ -b "$loop_dev1" ] && losetup -d $loop_dev1 [ -n "$seq" ] && rm -rf $TEST_DIR/$seq
@@ -42,7 +42,7 @@ clone_filesystem() _mount $dev1 $mnt1 $XFS_IO_PROG -fc 'pwrite -S 0x61 0 9000' $mnt1/foo >> $seqres.full - $UMOUNT_PROG $mnt1 + _unmount $mnt1 # device dump of $dev1 to $dev2 dd if=$dev1 of=$dev2 conv=fsync status=none || _fail "dd failed: $?"
tests/generic/746 +4 -4
@@ -38,7 +38,7 @@ esac # Override the default cleanup function. _cleanup() { - $UMOUNT_PROG $loop_dev &> /dev/null + _unmount $loop_mnt &> /dev/null _destroy_loop_device $loop_dev if [ $status -eq 0 ]; then rm -rf $tmp
@@ -53,7 +53,7 @@ get_holes() # in-core state that will perturb the free space map on umount. Stick # to established convention which requires the filesystem to be # unmounted while we probe the underlying file. - $UMOUNT_PROG $loop_mnt + _unmount $loop_mnt # FIEMAP only works on regular files, so call it on the backing file # and not the loop device like everything else
@@ -66,7 +66,7 @@ get_free_sectors() { case $FSTYP in ext4) - $UMOUNT_PROG $loop_mnt + _unmount $loop_mnt $DUMPE2FS_PROG $loop_dev 2>&1 | grep " Free blocks" | cut -d ":" -f2- | \ tr ',' '\n' | $SED_PROG 's/^ //' | \ $AWK_PROG -v spb=$sectors_per_block 'BEGIN{FS="-"};
@@ -80,7 +80,7 @@ get_free_sectors() xfs) agsize=`$XFS_INFO_PROG $loop_mnt | $SED_PROG -n 's/.*agsize=\(.*\) blks.*/\1/p'` # Convert free space (agno, block, length) to (start sector, end sector) - $UMOUNT_PROG $loop_mnt + _unmount $loop_mnt $XFS_DB_PROG -r -c "freesp -d" $loop_dev | $SED_PROG '/^.*from/,$d'| \ $AWK_PROG -v spb=$sectors_per_block -v agsize=$agsize \ '{ print spb * ($1 * agsize + $2), spb * ($1 * agsize + $2 + $3) - 1 }'
tests/xfs/014 +3 -3
@@ -22,7 +22,7 @@ _begin_fstest auto enospc quick quota prealloc _cleanup() { cd / - umount $LOOP_MNT 2>/dev/null + _unmount $LOOP_MNT 2>/dev/null _scratch_unmount 2>/dev/null rm -f $tmp.* }
@@ -168,13 +168,13 @@ LOOP_MNT=$SCRATCH_MNT/$seq.mnt $MKFS_XFS_PROG -d "file=1,name=$LOOP_FILE,size=10g" >> $seqres.full 2>&1 mkdir -p $LOOP_MNT -mount -t xfs -o loop,uquota,gquota $LOOP_FILE $LOOP_MNT || \ +_mount -o uquota,gquota $LOOP_FILE $LOOP_MNT || \ _fail "Failed to mount loop fs." _test_enospc $LOOP_MNT _test_edquot $LOOP_MNT -umount $LOOP_MNT +_unmount $LOOP_MNT echo $orig_sp_time > /proc/sys/fs/xfs/speculative_prealloc_lifetime
tests/xfs/073 +10 -10
@@ -21,9 +21,9 @@ _cleanup() { cd / _scratch_unmount 2>/dev/null - umount $imgs.loop 2>/dev/null + _unmount $imgs.loop 2>/dev/null + _unmount $imgs.source_dir 2>/dev/null [ -d $imgs.loop ] && rmdir $imgs.loop - umount $imgs.source_dir 2>/dev/null [ -d $imgs.source_dir ] && rm -rf $imgs.source_dir rm -f $imgs.* $tmp.* /var/tmp/xfs_copy.log.* }
@@ -65,10 +65,10 @@ _verify_copy() rmdir $target_dir 2>/dev/null mkdir $target_dir - mount -t xfs -o loop $target $target_dir 2>/dev/null + _mount -t xfs -o loop $target $target_dir 2>/dev/null if [ $? -ne 0 ]; then echo retrying mount with nouuid option >>$seqres.full - mount -t xfs -o loop -o nouuid $target $target_dir + _mount -t xfs -o loop -o nouuid $target $target_dir if [ $? -ne 0 ]; then echo mount failed - evil! return
@@ -87,19 +87,19 @@ _verify_copy() echo comparing new image geometry to old $XFS_INFO_PROG $source_dir \ - | _filter_copy $source $source_dir '/dev/loop.' '#' \ + | _filter_copy $source $source_dir '/dev/loop[0-9]\+' '#' \ | tr -s ' ' \ > $tmp.geometry1 $XFS_INFO_PROG $target_dir \ - | _filter_copy $target $target_dir '/dev/loop.' '#' \ + | _filter_copy $target $target_dir '/dev/loop[0-9]\+' '#' \ | tr -s ' ' \ > $tmp.geometry2 [ -s $tmp.geometry1 ] || echo no geometry output diff -u $tmp.geometry1 $tmp.geometry2 echo unmounting and removing new image - umount $source_dir - umount $target_dir > /dev/null 2>&1 + _unmount $source_dir + _unmount $target_dir > /dev/null 2>&1 rm -f $target }
@@ -134,10 +134,10 @@ ${MKFS_XFS_PROG} -dfile,name=$imgs.source,size=100g \ rmdir $imgs.source_dir 2>/dev/null mkdir $imgs.source_dir -mount -t xfs -o loop $imgs.source $imgs.source_dir +_mount -t xfs -o loop $imgs.source $imgs.source_dir loop2=`mount | grep $imgs.source | grep -o -e 'loop=.*[^),]' | grep -o -e '/.*$'` cp -a $here $imgs.source_dir -mount -t xfs -o remount,ro $imgs.source $imgs.source_dir +_mount -t xfs -o remount,ro $imgs.source $imgs.source_dir $XFS_COPY_PROG $imgs.source $imgs.image | _filter_copy '#' $imgs.image '#' '#' _verify_copy $imgs.image $imgs.source $imgs.source_dir
tests/xfs/074 +1 -1
@@ -72,7 +72,7 @@ $XFS_IO_PROG -ft \ -c "falloc 1023m 2g" \ $LOOP_MNT/foo >> $seqres.full -umount $LOOP_MNT +_unmount $LOOP_MNT _check_xfs_filesystem $LOOP_DEV none none # success, all done
tests/xfs/078 +3 -3
@@ -16,7 +16,7 @@ _cleanup() { cd / rm -f $tmp.* - $UMOUNT_PROG $LOOP_MNT 2>/dev/null + _unmount $LOOP_MNT 2>/dev/null [ -n "$LOOP_DEV" ] && _destroy_loop_device $LOOP_DEV 2>/dev/null # try to keep the image file if test fails [ $status -eq 0 ] && rm -f $LOOP_IMG
@@ -75,13 +75,13 @@ _grow_loop() $XFS_IO_PROG -c "pwrite $new_size $bsize" $LOOP_IMG | _filter_io LOOP_DEV=`_create_loop_device $LOOP_IMG` echo "*** mount loop filesystem" - $MOUNT_PROG -t xfs $LOOP_DEV $LOOP_MNT + _mount -t xfs $LOOP_DEV $LOOP_MNT echo "*** grow loop filesystem" $XFS_GROWFS_PROG $LOOP_MNT 2>&1 | _filter_growfs 2>&1 echo "*** unmount" - $UMOUNT_PROG -d $LOOP_MNT && LOOP_DEV= + _unmount $LOOP_MNT # Large grows takes forever to check.. if [ "$check" -gt "0" ]
tests/xfs/148 +3 -3
@@ -14,7 +14,7 @@ _begin_fstest auto quick fuzzers _cleanup() { cd / - $UMOUNT_PROG $mntpt > /dev/null 2>&1 + _unmount $mntpt > /dev/null 2>&1 _destroy_loop_device $loopdev > /dev/null 2>&1 rm -r -f $tmp.* }
@@ -90,7 +90,7 @@ cat $tmp.log >> $seqres.full cat $tmp.log | _filter_test_dir # Corrupt the entries -$UMOUNT_PROG $mntpt +_unmount $mntpt _destroy_loop_device $loopdev cp $imgfile $imgfile.old sed -b \
@@ -121,7 +121,7 @@ fi echo "does repair complain?" >> $seqres.full # Does repair complain about this? -$UMOUNT_PROG $mntpt +_unmount $mntpt $XFS_REPAIR_PROG -n $loopdev >> $seqres.full 2>&1 res=$? test $res -eq 1 || \
tests/xfs/149 +2 -2
@@ -22,7 +22,7 @@ loop_symlink=$TEST_DIR/loop_symlink.$$ # Override the default cleanup function. _cleanup() { - $UMOUNT_PROG $mntdir + _unmount $mntdir [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev rmdir $mntdir rm -f $loop_symlink
@@ -73,7 +73,7 @@ echo "=== xfs_growfs - check device symlink ===" $XFS_GROWFS_PROG -D 12288 $loop_symlink > /dev/null echo "=== unmount ===" -$UMOUNT_PROG $mntdir || _fail "!!! failed to unmount" +_unmount $mntdir || _fail "!!! failed to unmount" echo "=== mount device symlink ===" $MOUNT_PROG $loop_symlink $mntdir || _fail "!!! failed to loopback mount"
tests/xfs/186 +2 -2
@@ -87,7 +87,7 @@ _do_eas() _create_eas $2 $3 fi echo "" - cd /; $UMOUNT_PROG $SCRATCH_MNT + cd /; _unmount $SCRATCH_MNT _print_inode }
@@ -99,7 +99,7 @@ _do_dirents() echo "" _scratch_mount _create_dirents $1 $2 - cd /; $UMOUNT_PROG $SCRATCH_MNT + cd /; _unmount $SCRATCH_MNT _print_inode }
tests/xfs/216 +8 -2
@@ -12,6 +12,12 @@ _begin_fstest log metadata auto quick # Import common functions. . ./common/filter +_cleanup() +{ + _unmount $LOOP_MNT > /dev/null 2>&1 + cd / + rm -f $tmp.* +} _require_scratch _scratch_mkfs_xfs >/dev/null 2>&1
@@ -50,9 +56,9 @@ _do_mkfs() echo -n "fssize=${i}g " $MKFS_XFS_PROG -f -b size=4096 -l version=2 \ -d name=$LOOP_DEV,size=${i}g $loop_mkfs_opts |grep log - mount -o loop -t xfs $LOOP_DEV $LOOP_MNT + _mount -o loop -t xfs $LOOP_DEV $LOOP_MNT echo "test write" > $LOOP_MNT/test - umount $LOOP_MNT > /dev/null 2>&1 + _unmount $LOOP_MNT > /dev/null 2>&1 done } # make large holey file
tests/xfs/217 +2 -2
@@ -29,9 +29,9 @@ _do_mkfs() echo -n "fssize=${i}g " $MKFS_XFS_PROG -f -b size=4096 -l version=2 \ -d name=$LOOP_DEV,size=${i}g |grep log - mount -o loop -t xfs $LOOP_DEV $LOOP_MNT + _mount -o loop -t xfs $LOOP_DEV $LOOP_MNT echo "test write" > $LOOP_MNT/test - umount $LOOP_MNT > /dev/null 2>&1 + _unmount $LOOP_MNT > /dev/null 2>&1 # punch out the previous blocks so that we keep the amount of # disk space the test requires down to a minimum.
tests/xfs/250 +4 -3
@@ -13,9 +13,10 @@ _begin_fstest auto quick rw prealloc metadata _cleanup() { cd / - umount $LOOP_MNT 2>/dev/null + _unmount $LOOP_MNT 2>/dev/null rm -f $LOOP_DEV rmdir $LOOP_MNT + rm -f $tmp.* } # Import common functions.
@@ -54,13 +55,13 @@ _test_loop() | _filter_mkfs 2>/dev/null echo "*** mount loop filesystem" - mount -t xfs -o loop $LOOP_DEV $LOOP_MNT + _mount -t xfs -o loop $LOOP_DEV $LOOP_MNT echo "*** preallocate large file" $XFS_IO_PROG -f -c "resvsp 0 $fsize" $LOOP_MNT/foo | _filter_io echo "*** unmount loop filesystem" - umount $LOOP_MNT > /dev/null 2>&1 + _unmount $LOOP_MNT > /dev/null 2>&1 echo "*** check loop filesystem" _check_xfs_filesystem $LOOP_DEV none none
tests/xfs/289 +2 -2
@@ -13,8 +13,8 @@ _begin_fstest growfs auto quick # Override the default cleanup function. _cleanup() { - $UMOUNT_PROG $tmpdir - $UMOUNT_PROG $tmpbind + _unmount $tmpdir + _unmount $tmpbind rmdir $tmpdir rm -f $tmpsymlink rmdir $tmpbind
tests/xfs/507 +1 -1
@@ -22,7 +22,7 @@ _register_cleanup "_cleanup" BUS _cleanup() { cd / - test -n "$loop_mount" && $UMOUNT_PROG $loop_mount > /dev/null 2>&1 + test -n "$loop_mount" && _unmount $loop_mount > /dev/null 2>&1 test -n "$loop_dev" && _destroy_loop_device $loop_dev rm -rf $tmp.* }
tests/xfs/513 +2 -2
@@ -14,7 +14,7 @@ _cleanup() { cd / rm -f $tmp.* - $UMOUNT_PROG $LOOP_MNT 2>/dev/null + _unmount $LOOP_MNT 2>/dev/null if [ -n "$LOOP_DEV" ];then _destroy_loop_device $LOOP_DEV 2>/dev/null fi
@@ -89,7 +89,7 @@ get_mount_info() force_unmount() { - $UMOUNT_PROG $LOOP_MNT >/dev/null 2>&1 + _unmount $LOOP_MNT >/dev/null 2>&1 } # _do_test <mount options> <should be mounted?> [<key string> <key should be found?>]
tests/xfs/544 +1 -1
@@ -15,7 +15,7 @@ _cleanup() _cleanup_dump cd / rm -r -f $tmp.* - $UMOUNT_PROG $TEST_DIR/dest.$seq 2> /dev/null + _unmount $TEST_DIR/dest.$seq 2> /dev/null rmdir $TEST_DIR/src.$seq 2> /dev/null rmdir $TEST_DIR/dest.$seq 2> /dev/null }
tests/xfs/606 +1 -1
@@ -14,7 +14,7 @@ _begin_fstest auto quick growfs _cleanup() { local dev - $UMOUNT_PROG $LOOP_MNT 2>/dev/null + _unmount $LOOP_MNT 2>/dev/null dev=$(losetup -j testfile | cut -d: -f1) losetup -d $dev 2>/dev/null rm -rf $LOOP_IMG $LOOP_MNT
tests/xfs/613 +2 -2
@@ -14,7 +14,7 @@ _cleanup() { cd / rm -f $tmp.* - $UMOUNT_PROG $LOOP_MNT 2>/dev/null + _unmount $LOOP_MNT 2>/dev/null if [ -n "$LOOP_DEV" ];then _destroy_loop_device $LOOP_DEV 2>/dev/null fi
@@ -90,7 +90,7 @@ get_mount_info() force_unmount() { - $UMOUNT_PROG $LOOP_MNT >/dev/null 2>&1 + _unmount $LOOP_MNT >/dev/null 2>&1 } # _do_test <mount options> <should be mounted?> [<key string> <key should be found?>]
Signature · 1 line
2.45.2
PATCH 11/40 fstests: use syncfs rather than sync
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
sync(1) is a system wide sync and is implemented by iterating all the superblocks in the system. In most cases, fstests require just the filesystem under test to be synced - we require syncfs(2) semantics but what we use is sync(2) semantics.
The result of this is that when running many concurrent fstests at the same time, we can have *hundreds* of concurrent sync operations in progress (thanks fsstress!) and this causes excessive interference with other tests that are running on other filesystems.
For example, some tests try to specifically control extent layout via specific write and fsync patterns. All these global syncs perturb them and cause them to spuriously fail.
A random snapshot of running concurrent tests shows just how many tests are explicitly blocked in sync(1):
check-parallel───check───077───077─┬─cut
│ ├─du
│ └─tail
├─check-parallel───check───311───xfs_scrub───{xfs_scrub}
├─check-parallel───check───531───128*[t_open_tmpfiles]
├─check-parallel───check───227
├─check-parallel───check───388
├─check-parallel───check───070───fsstress───fsstress───{fsstress+
├─check-parallel───check───232───fsstress───7*[fsstress───{fsstr+
├─check-parallel───check───648───sleep
├─check-parallel───check───409───sync
├─check-parallel───check───683───sync
├─check-parallel───check───013─┬─013───sleep
│ └─fsstress───2*[fsstress───{fsstr+
├─check-parallel───check───684───sync
├─check-parallel───check───673───sync
├─check-parallel───check───118───dd
├─check-parallel───check───467───open_by_handle
├─check-parallel───check─┬─622
│ └─check
├─check-parallel───check───685───sync
├─check-parallel───check───049───fsstress───fsstress───{fsstress+
├─check-parallel───check───599
├─check-parallel───check───426───open_by_handle
├─check-parallel───check───057───umount
├─check-parallel───check───390───fsstress─┬─18*[fsstress───{fsst+
│ └─fsstress
├─check-parallel───check───158───fsstress───fsstress───{fsstress+
├─check-parallel───check───017
├─check-parallel───check───032───fsstress───fsstress
├─check-parallel───check───076
├─check-parallel───check───477───open_by_handle
├─check-parallel───check───170───2*[170───170]
├─check-parallel───check───112
├─check-parallel───check───686───sync
├─4*[check-parallel───check───check───xfs_scrub───{xfs_scrub}]
├─check-parallel───check───387───xfs_io───{xfs_io}
├─check-parallel───check───615───615
├─check-parallel───check─┬─051
│ └─check───xfs_repair
├─check-parallel───check───049
├─check-parallel───check───247
├─check-parallel───check───674───sync
├─check-parallel───check───040
├─check-parallel───check───560───fsstress───fsstress───{fsstress+
├─check-parallel───check───030─┬─030─┬─030───xfs_repair
│ │ └─030───perl
│ ├─sed
│ └─uniq
├─check-parallel───check───055───055
├─2*[check-parallel───check───check]
├─check-parallel───check───042
├─check-parallel───check───204
├─check-parallel───check───271─┬─271───sed
│ └─md5sum
├─check-parallel───check───091─┬─fsx
│ └─tee
├─check-parallel───check───063───sleep
├─check-parallel───check───026
├─check-parallel───check───459───lvm
├─check-parallel───check───495
├─check-parallel───check───141───fsstress───4*[fsstress]
├─check-parallel───check───011─┬─fsstress─┬─fsstress───{fsstress+
│ │ └─fsstress
│ └─sleep
├─check-parallel───check───328───sync
├─check-parallel───check───507───507
├─check-parallel───check
├─check-parallel───check───687───sync
├─check-parallel───check───109───mkfs.xfs
├─check-parallel───check───324
├─check-parallel───check───114───aio-dio-eof-rac
└─check-parallel───check───503───xfs_scrub───2*[{xfs_scrub}]There are ~10 sync(1) calls blocked and at least half of the 50-odd fsstress processes currently running are also going to be stuck in sync(2) calls.
They are stuck because the superblock iteration has to wait for mount, unmount, freeze, thaw and any other operation that locks a superblock exclusively. When running dozens of tests concurrently, there can be tens of superblocks that are locked exclusively for every second for significant lengths of time.
Hence the use of sync has impact on both performance and test behaviour and we need to minimise the amount of sync(1) and sync(2) usage as much as possible.
Introduce _test_sync() and _scratch_sync() so we can implement a syncfs mechanism with a fallback to sync(1) if it is not supported without dirtying all the test code unnecessarily. Then convert fsstress to use syncfs(2) in preference to sync(2).
This commit changes all the generic and XFS tests to use the new sync functions, other filesystem specific tests will eventually need to be converted to avoid similar problems.
--- common/encrypt | 2 +- common/log | 2 +- common/quota | 2 +- common/rc | 24 ++++++++++++++++++++++++ common/repair | 2 +- common/report | 2 +- common/verity | 2 +- common/xfs | 2 +- ltp/fsstress.c | 12 ++++++++++++ tests/generic/015 | 2 +- tests/generic/029 | 2 +- tests/generic/030 | 2 +- tests/generic/032 | 2 +- tests/generic/034 | 2 +- tests/generic/039 | 2 +- tests/generic/040 | 2 +- tests/generic/041 | 2 +- tests/generic/048 | 2 +- tests/generic/049 | 2 +- tests/generic/051 | 4 ++-- tests/generic/054 | 2 +- tests/generic/057 | 2 +- tests/generic/059 | 2 +- tests/generic/065 | 2 +- tests/generic/066 | 2 +- tests/generic/073 | 2 +- tests/generic/090 | 4 ++-- tests/generic/092 | 2 +- tests/generic/098 | 4 ++-- tests/generic/101 | 2 +- tests/generic/104 | 2 +- tests/generic/106 | 2 +- tests/generic/107 | 2 +- tests/generic/150 | 2 +- tests/generic/151 | 2 +- tests/generic/152 | 2 +- tests/generic/157 | 3 ++- tests/generic/158 | 3 ++- tests/generic/159 | 2 +- tests/generic/160 | 2 +- tests/generic/171 | 4 ++-- tests/generic/172 | 4 ++-- tests/generic/173 | 4 ++-- tests/generic/174 | 4 ++-- tests/generic/204 | 8 -------- tests/generic/247 | 2 +- tests/generic/250 | 2 +- tests/generic/252 | 2 +- tests/generic/265 | 2 +- tests/generic/266 | 2 +- tests/generic/267 | 2 +- tests/generic/268 | 2 +- tests/generic/271 | 2 +- tests/generic/272 | 2 +- tests/generic/273 | 2 +- tests/generic/274 | 6 +++--- tests/generic/275 | 6 +++--- tests/generic/276 | 2 +- tests/generic/278 | 2 +- tests/generic/279 | 2 +- tests/generic/281 | 2 +- tests/generic/282 | 2 +- tests/generic/283 | 2 +- tests/generic/315 | 2 +- tests/generic/317 | 2 +- tests/generic/318 | 2 +- tests/generic/325 | 2 +- tests/generic/328 | 4 ++-- tests/generic/329 | 2 +- tests/generic/330 | 2 +- tests/generic/331 | 2 +- tests/generic/332 | 2 +- tests/generic/335 | 2 +- tests/generic/336 | 2 +- tests/generic/341 | 2 +- tests/generic/342 | 2 +- tests/generic/343 | 2 +- tests/generic/347 | 2 +- tests/generic/348 | 2 +- tests/generic/353 | 2 +- tests/generic/376 | 2 +- tests/generic/382 | 2 +- tests/generic/387 | 2 +- tests/generic/391 | 2 +- tests/generic/409 | 2 +- tests/generic/410 | 2 +- tests/generic/411 | 2 +- tests/generic/416 | 2 +- tests/generic/422 | 4 ++-- tests/generic/425 | 2 +- tests/generic/461 | 2 +- tests/generic/474 | 4 ++-- tests/generic/479 | 2 +- tests/generic/480 | 2 +- tests/generic/483 | 2 +- tests/generic/489 | 2 +- tests/generic/502 | 2 +- tests/generic/505 | 2 +- tests/generic/506 | 2 +- tests/generic/507 | 2 +- tests/generic/508 | 2 +- tests/generic/510 | 2 +- tests/generic/520 | 2 +- tests/generic/526 | 2 +- tests/generic/527 | 2 +- tests/generic/535 | 2 +- tests/generic/546 | 2 +- tests/generic/556 | 2 +- tests/generic/579 | 2 +- tests/generic/589 | 2 +- tests/generic/599 | 2 +- tests/generic/610 | 2 +- tests/generic/628 | 4 ++-- tests/generic/629 | 4 ++-- tests/generic/640 | 2 +- tests/generic/673 | 2 +- tests/generic/674 | 2 +- tests/generic/675 | 2 +- tests/generic/677 | 2 +- tests/generic/683 | 2 +- tests/generic/684 | 2 +- tests/generic/685 | 2 +- tests/generic/686 | 2 +- tests/generic/687 | 2 +- tests/generic/688 | 2 +- tests/generic/690 | 2 +- tests/generic/694 | 2 +- tests/generic/695 | 2 +- tests/generic/703 | 2 +- tests/generic/716 | 2 +- tests/generic/718 | 2 +- tests/generic/719 | 2 +- tests/generic/721 | 2 +- tests/generic/725 | 2 +- tests/generic/726 | 2 +- tests/generic/727 | 2 +- tests/generic/735 | 2 +- tests/generic/738 | 2 +- tests/generic/745 | 4 ++-- tests/generic/746 | 4 ++-- tests/generic/747 | 4 ++-- tests/generic/749 | 4 ++-- tests/xfs/016 | 4 ++-- tests/xfs/052 | 2 +- tests/xfs/110 | 2 +- tests/xfs/118 | 4 ++-- tests/xfs/119 | 2 +- tests/xfs/128 | 2 +- tests/xfs/133 | 2 +- tests/xfs/134 | 2 +- tests/xfs/161 | 2 +- tests/xfs/176 | 2 +- tests/xfs/195 | 2 +- tests/xfs/201 | 4 ++-- tests/xfs/212 | 2 +- tests/xfs/227 | 2 +- tests/xfs/231 | 4 ++-- tests/xfs/232 | 4 ++-- tests/xfs/234 | 2 +- tests/xfs/236 | 2 +- tests/xfs/237 | 2 +- tests/xfs/239 | 2 +- tests/xfs/240 | 2 +- tests/xfs/241 | 2 +- tests/xfs/243 | 4 ++-- tests/xfs/246 | 2 +- tests/xfs/265 | 2 +- tests/xfs/272 | 2 +- tests/xfs/274 | 2 +- tests/xfs/276 | 2 +- tests/xfs/291 | 4 ++-- tests/xfs/309 | 2 +- tests/xfs/312 | 2 +- tests/xfs/313 | 2 +- tests/xfs/314 | 2 +- tests/xfs/315 | 4 ++-- tests/xfs/316 | 2 +- tests/xfs/317 | 2 +- tests/xfs/318 | 4 ++-- tests/xfs/319 | 2 +- tests/xfs/320 | 2 +- tests/xfs/321 | 2 +- tests/xfs/322 | 2 +- tests/xfs/323 | 2 +- tests/xfs/324 | 2 +- tests/xfs/325 | 4 ++-- tests/xfs/326 | 4 ++-- tests/xfs/327 | 2 +- tests/xfs/420 | 2 +- tests/xfs/421 | 2 +- tests/xfs/423 | 2 +- tests/xfs/438 | 2 +- tests/xfs/440 | 2 +- tests/xfs/442 | 2 +- tests/xfs/511 | 2 +- tests/xfs/519 | 2 +- tests/xfs/520 | 2 +- tests/xfs/541 | 2 +- tests/xfs/553 | 4 ++-- tests/xfs/558 | 6 +++--- tests/xfs/607 | 6 +++--- tests/xfs/617 | 2 +- tests/xfs/629 | 2 +- tests/xfs/630 | 2 +- tests/xfs/631 | 2 +- tests/xfs/790 | 2 +- tests/xfs/791 | 2 +- tests/xfs/792 | 2 +- 208 files changed, 279 insertions(+), 249 deletions(-)
common/encrypt +1 -1
@@ -686,7 +686,7 @@ _get_ciphertext_block_list() { local file=$1 - sync + _sync_fs $file $XFS_IO_PROG -c fiemap $file | perl -ne ' next if not /^\s*\d+: \[\d+\.\.\d+\]: (\d+)\.\.(\d+)/; print $_ . "," foreach $1..$2;' | sed 's/,$//'
common/log +1 -1
@@ -392,7 +392,7 @@ _create_log_sync() # add some syncs to get the log flushed to disk for file in $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}; do touch $file - sync + _scratch_sync done # unmount the FS
common/quota +1 -1
@@ -336,7 +336,7 @@ _qmount_option() _check_quota_usage() { # Sync to get delalloc to disk - sync + _scratch_sync # kill caches to guarantee removal speculative delalloc # XXX: really need an ioctl instead of this big hammer
common/rc +24 -0
@@ -6,6 +6,30 @@ BC="$(type -P bc)" || BC= +# Don't use sync(1) directly if at all possible. In most cases we only need to +# sync the fs under test, so we use syncfs if it is supported to prevent +# disturbance of other tests that may be running concurrently. +_sync_fs() +{ + local dir=$1 + + if [ -e $dir ]; then + $XFS_IO_PROG -rxc "syncfs" $dir > /dev/null 2>&1 + return + fi + sync +} + +_scratch_sync() +{ + _sync_fs $SCRATCH_MNT +} + +_test_sync() +{ + _sync_fs $TEST_DIR +} + # Common execution handling for fsstress invocation. # # We need per-test fsstress binaries because of the way fsstress forks and
common/repair +1 -1
@@ -119,7 +119,7 @@ _check_repair() _scratch_mount POSIXLY_CORRECT=yes \ dd if=/bin/bash of=$SCRATCH_MNT/sh 2>&1 |_filter_dd - sync + _scratch_sync rm -f $SCRATCH_MNT/sh _scratch_unmount
common/report +1 -1
@@ -156,7 +156,7 @@ ENDL cat $report >> "$tmp_fn" fi echo "</testsuite>" >> "$tmp_fn" - sync "$tmp_fn" && mv "$tmp_fn" "$out_fn" + _sync_fs "$tmp_fn" && mv "$tmp_fn" "$out_fn" echo "Xunit report: $out_fn" }
common/verity +1 -1
@@ -335,7 +335,7 @@ _fsv_scratch_corrupt_bytes() local dd_cmds=() local cmd - sync # Sync to avoid unwritten extents + _scratch_sync # Sync to avoid unwritten extents cat > $tmp.bytes local end=$(( offset + $(_get_filesize $tmp.bytes ) ))
common/xfs +1 -1
@@ -1087,7 +1087,7 @@ _scratch_xfs_unmount_dirty() rm -f "$f" echo "test" > "$f" - sync + _scratch_sync _scratch_shutdown _scratch_unmount }
ltp/fsstress.c +12 -0
@@ -5241,6 +5241,18 @@ symlink_f(opnum_t opno, long r)void sync_f (opnum_t opno,long r) { +int fd; + + fd =open (homedir,O_RDONLY |O_DIRECTORY ); +if (fd <0 ) + goto use_sync; +syncfs (fd); +close (fd); +if (verbose) +printf ("%d/%lld: syncfs\n" , procid, opno); +return ; + +use_sync:sync ();if (verbose)printf ("%d/%lld: sync\n" , procid, opno);
tests/generic/015 +1 -1
@@ -85,7 +85,7 @@ fi echo "check free space:" -sync +_scratch_sync free2=`_free` if [ -z "$free2" ]
tests/generic/029 +1 -1
@@ -43,7 +43,7 @@ echo "==== Post-Remount ==" _hexdump $testfile rm -f $testfile -sync +_scratch_sync # second case is to do a mwrite between the truncate to a block on the # same page we are truncating within the EOF. This checks that a mapped
tests/generic/030 +1 -1
@@ -48,7 +48,7 @@ echo "==== Post-Remount ==" _hexdump $testfile rm -f $testfile -sync +_scratch_sync # second case is to do a mwrite between the truncate to a block on the # same page we are truncating within the EOF. This checks that a mapped
tests/generic/032 +1 -1
@@ -29,7 +29,7 @@ _cleanup() _syncloop() { while [ true ]; do - sync + _scratch_sync done }
tests/generic/034 +1 -1
@@ -41,7 +41,7 @@ touch $SCRATCH_MNT/test_dir/foo # The intention is that at log recovery time we have a dir entry for 'foo' both # in the fs/subvol tree and in the log tree - this is necessary to trigger the # bug on btrfs. -sync +_scratch_sync touch $SCRATCH_MNT/test_dir/bar $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/test_dir
tests/generic/039 +1 -1
@@ -44,7 +44,7 @@ echo "hello world" > $SCRATCH_MNT/a/b/foo ln $SCRATCH_MNT/a/b/foo $SCRATCH_MNT/a/b/bar # Make sure all metadata and data are durably persisted. -sync +_scratch_sync # Now remove one of the hard links and fsync the inode. rm -f $SCRATCH_MNT/a/b/bar
tests/generic/040 +1 -1
@@ -60,7 +60,7 @@ for i in `seq 1 3000`; do done # Make sure all metadata and data are durably persisted. -sync +_scratch_sync # Add one more link to the inode that ends up being a btrfs extref and fsync # the inode.
tests/generic/041 +1 -1
@@ -64,7 +64,7 @@ for i in `seq 1 3000`; do done # Make sure all metadata and data are durably persisted. -sync +_scratch_sync # Now remove one link, add a new one with a new name, add another new one with # the same name as the one we just removed and fsync the inode.
tests/generic/048 +1 -1
@@ -69,7 +69,7 @@ do done # sync, then shutdown immediately after, then remount and test -sync +_scratch_sync _scratch_shutdown _scratch_unmount _scratch_mount
tests/generic/049 +1 -1
@@ -66,7 +66,7 @@ do done # sync, then shutdown immediately after, then remount and test -sync +_scratch_sync _scratch_shutdown _scratch_unmount _scratch_mount
tests/generic/051 +2 -2
@@ -30,7 +30,7 @@ load_dir=$SCRATCH_MNT/test _run_fsstress_bg -n 10000000 -p $PROCS -d $load_dir sleep $SLEEP_TIME _kill_fsstress -sync +_scratch_sync _scratch_unmount # now mount again, run the load again, this time with a shutdown.
@@ -38,7 +38,7 @@ _scratch_mount $XFS_FSR_PROG -v $load_dir >> $seqres.full 2>&1 _run_fsstress_bg -n10000000 -p $PROCS -d $load_dir sleep $SLEEP_TIME -sync +_scratch_sync # now shutdown and unmount sleep 5
tests/generic/054 +1 -1
@@ -67,7 +67,7 @@ for s in sync nosync ; do # add some syncs to get the log flushed to disk for file in $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}; do touch $file - sync + _scratch_sync done else # generate some log traffic - but not too much - life gets a little
tests/generic/057 +1 -1
@@ -41,7 +41,7 @@ $XFS_IO_PROG -f -c "pwrite -S 0xaa -b 8K 0 8K" \ $SCRATCH_MNT/foo | _filter_xfs_io # Make sure the file is durably persisted. -sync +_scratch_sync # Append some data to our file, to increase its size. $XFS_IO_PROG -f -c "pwrite -S 0xcc -b 4K 8K 4K" \
tests/generic/059 +1 -1
@@ -58,7 +58,7 @@ $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foo # that modifies the data or metadata of our file, should update those fields in # the btrfs inode with values that make the next fsync operation write to the # fsync log. -sync +_scratch_sync # Sleep for 1 second, because we want to check that the next punch operations we # do update the file's mtime and ctime.
tests/generic/065 +1 -1
@@ -42,7 +42,7 @@ $XFS_IO_PROG -f -c "pwrite -S 0xaa 0 8K" $SCRATCH_MNT/foo | _filter_xfs_io mkdir $SCRATCH_MNT/mydir # Make sure all metadata and data are durably persisted. -sync +_scratch_sync # Add a hard link to 'foo' inside our test directory and fsync only the # directory. The btrfs fsync implementation had a bug that caused the new
tests/generic/066 +1 -1
@@ -48,7 +48,7 @@ $SETFATTR_PROG -n user.attr2 -v val2 $SCRATCH_MNT/foobar $SETFATTR_PROG -n user.attr3 -v val3 $SCRATCH_MNT/foobar # Make sure everything is durably persisted. -sync +_scratch_sync # Now delete the second xattr and fsync the inode. $SETFATTR_PROG -x user.attr2 $SCRATCH_MNT/foobar
tests/generic/073 +1 -1
@@ -51,7 +51,7 @@ touch $SCRATCH_MNT/testdir_1/bar mkdir $SCRATCH_MNT/testdir_2 # Make sure everything is durably persisted. -sync +_scratch_sync # Write more 8Kb of data to our file. $XFS_IO_PROG -c "pwrite -S 0xbb 8K 8K" $SCRATCH_MNT/foo | _filter_xfs_io
tests/generic/090 +2 -2
@@ -41,7 +41,7 @@ _mount_flakey $XFS_IO_PROG -f -c "pwrite -S 0xaa 0 32k" \ -c "fsync" \ $SCRATCH_MNT/foo | _filter_xfs_io -sync +_scratch_sync # Add a hard link to our file. # On btrfs this sets the flag BTRFS_INODE_COPY_EVERYTHING on the btrfs inode,
@@ -50,7 +50,7 @@ ln $SCRATCH_MNT/foo $SCRATCH_MNT/bar # Sync the filesystem to force a commit of the current btrfs transaction, this # is a necessary condition to trigger the bug on btrfs. -sync +_scratch_sync # Now append more data to our file, increasing its size, and fsync the file. # In btrfs because the inode flag BTRFS_INODE_COPY_EVERYTHING was set and the
tests/generic/092 +1 -1
@@ -36,7 +36,7 @@ _require_congruent_file_oplen $TEST_DIR $((7 * 1048576)) # past i_size $XFS_IO_PROG -f -c "falloc -k 0 10M" -c "pwrite 0 5M" -c "truncate 5M"\ $TEST_DIR/testfile.$seq | _filter_xfs_io -sync +_test_sync $XFS_IO_PROG -c "fiemap -v" $TEST_DIR/testfile.$seq | _filter_fiemap # Now verify that if we truncate up past i_size we don't trim the preallocated
tests/generic/098 +2 -2
@@ -38,7 +38,7 @@ workout() # Create our test file with some data and durably persist it. $XFS_IO_PROG -t -f -c "pwrite -S 0xaa 0 128K" $SCRATCH_MNT/foo | _filter_xfs_io - sync + _scratch_sync # Append some data to the file, increasing its size, and leave a hole between # the old size and the start offset if the following write. So our file gets
@@ -49,7 +49,7 @@ workout() # This is required to trigger a bug in btrfs truncate where it updates on-disk # inode size incorrectly. if [ $need_sync -eq 1 ]; then - sync + _scratch_sync fi # Now truncate our file to a smaller size that is in the middle of the hole we
tests/generic/101 +1 -1
@@ -49,7 +49,7 @@ $XFS_IO_PROG -f -c "pwrite -S 0xaa 0 64K" \ $XFS_IO_PROG -f -c "pwrite -S 0xee 0 64K" \ -c "pwrite -S 0xff 64K 61K" \ $SCRATCH_MNT/bar | _filter_xfs_io -sync +_scratch_sync # Now truncate our file foo to a smaller size (64Kb) and then truncate it to the # size it had before the shrinking truncate (125Kb). Then fsync our file. If a
tests/generic/104 +1 -1
@@ -38,7 +38,7 @@ touch $SCRATCH_MNT/testdir/foo touch $SCRATCH_MNT/testdir/bar # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Create one hard link for file foo and another one for file bar. After that # fsync only the file bar.
tests/generic/106 +1 -1
@@ -37,7 +37,7 @@ touch $SCRATCH_MNT/testdir/foo ln $SCRATCH_MNT/testdir/foo $SCRATCH_MNT/testdir/bar # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Now remove one of the links, trigger inode eviction and then fsync our # inode.
tests/generic/107 +1 -1
@@ -41,7 +41,7 @@ ln $SCRATCH_MNT/foo $SCRATCH_MNT/testdir/foo2 ln $SCRATCH_MNT/foo $SCRATCH_MNT/testdir/foo3 # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Now we remove one of our file's hardlinks in the directory testdir. unlink $SCRATCH_MNT/testdir/foo3
tests/generic/150 +1 -1
@@ -38,7 +38,7 @@ sz=$((blksz * blks)) nr=7 filesize=$((blksz * nr)) _pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full -sync +_test_sync free_blocks0=$(stat -f $testdir -c '%f') echo "Create the reflink copies"
tests/generic/151 +1 -1
@@ -43,7 +43,7 @@ free_blocks0=$(stat -f $testdir -c '%f') nr=7 filesize=$((blksz * nr)) _pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full -sync +_test_sync echo "Create the reflink copies" for i in `seq 2 $nr`; do
tests/generic/152 +1 -1
@@ -44,7 +44,7 @@ free_blocks0=$(stat -f $testdir -c '%f') nr=4 filesize=$((blksz * nr)) _pwrite_byte 0x61 0 $sz $testdir/file1 >> $seqres.full -sync +_test_sync echo "Create the reflink copies" for i in `seq 2 $nr`; do
tests/generic/157 +2 -1
@@ -54,7 +54,8 @@ seq 1 $((2 * blksz / 250)) | while read f; do done mknod $testdir1/dev1 c 1 3 mkfifo $testdir1/fifo1 -sync +_test_sync +_scratch_sync _filter_enotty() { sed -e 's/Inappropriate ioctl for device/Invalid argument/g'
tests/generic/158 +2 -1
@@ -55,7 +55,8 @@ seq 1 $((2 * blksz / 250)) | while read f; do done mknod $testdir1/dev1 c 1 3 mkfifo $testdir1/fifo1 -sync +_test_sync +_scratch_sync _filter_enotty() { _filter_dedupe_error | \
tests/generic/159 +1 -1
@@ -39,7 +39,7 @@ nr=4 filesize=$((blksz * nr)) _pwrite_byte 0x61 0 $sz $testdir1/file1 >> $seqres.full _pwrite_byte 0x61 0 $sz $testdir1/file2 >> $seqres.full -sync +_test_sync do_filter_output() {
tests/generic/160 +1 -1
@@ -39,7 +39,7 @@ nr=4 filesize=$((blksz * nr)) _pwrite_byte 0x61 0 $sz $testdir1/file1 >> $seqres.full _pwrite_byte 0x61 0 $sz $testdir1/file2 >> $seqres.full -sync +_test_sync do_filter_output() {
tests/generic/171 +2 -2
@@ -49,12 +49,12 @@ mkdir $testdir echo "Create a big file and reflink it" _pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/bigfile >> $seqres.full 2>&1 _cp_reflink $testdir/bigfile $testdir/clonefile -sync +_scratch_sync echo "Allocate the rest of the space" nr_free=$(stat -f -c '%f' $testdir) _fill_fs $((nr_free * blksz)) $testdir/space $blksz 0 >> $seqres.full 2>&1 -sync +_scratch_sync echo "CoW the big file" out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile 2>&1 | \
tests/generic/172 +2 -2
@@ -47,11 +47,11 @@ mkdir $testdir echo "Create a big file and reflink it" _pwrite_byte 0x61 0 $file_size $testdir/bigfile >> $seqres.full 2>&1 _cp_reflink $testdir/bigfile $testdir/clonefile -sync +_scratch_sync echo "Allocate the rest of the space" _fill_fs $fs_size $testdir/space $blksz 0 >> $seqres.full 2>&1 -sync +_scratch_sync echo "CoW the big file" out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1 | \
tests/generic/173 +2 -2
@@ -49,12 +49,12 @@ mkdir $testdir echo "Create a big file and reflink it" _pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/bigfile >> $seqres.full 2>&1 _cp_reflink $testdir/bigfile $testdir/clonefile -sync +_scratch_sync echo "Allocate the rest of the space" nr_free=$(stat -f -c '%f' $testdir) _fill_fs $((blksz * nr_free)) $testdir/space $blksz 0 >> $seqres.full 2>&1 -sync +_scratch_sync echo "mmap CoW the big file" core_ulimit="$(ulimit -c)"
tests/generic/174 +2 -2
@@ -50,12 +50,12 @@ mkdir $testdir echo "Create a big file and reflink it" _pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/bigfile >> $seqres.full 2>&1 _cp_reflink $testdir/bigfile $testdir/clonefile -sync +_scratch_sync echo "Allocate the rest of the space" nr_free=$(stat -f -c '%f' $testdir) _fill_fs $((blksz * nr_free)) $testdir/space $blksz 0 >> $seqres.full 2>&1 -sync +_scratch_sync echo "CoW the big file" out="$(_pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/bigfile -d 2>&1 | \
tests/generic/204 +0 -8
@@ -9,17 +9,9 @@ . ./common/preamble _begin_fstest metadata rw auto -# Override the default cleanup function. -_cleanup() -{ - rm -f $tmp.* - sync -} - # Import common functions. . ./common/filter - _require_scratch # For xfs, we need to handle the different default log sizes that different
tests/generic/247 +1 -1
@@ -39,7 +39,7 @@ iosize=1048576 # Initialise file dd if=/dev/zero of=$testfile bs=$iosize count=$loops &> /dev/null [ $? -ne 0 ] && exit -sync +_test_sync # Direct I/O overwriter dd if=/dev/zero of=$testfile oflag=direct bs=$iosize count=$loops conv=notrunc &> /dev/null &
tests/generic/250 +1 -1
@@ -61,7 +61,7 @@ md5sum $testdir/file2 | _filter_scratch echo "Write and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full -sync +_scratch_sync _dmerror_load_error_table $XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ >> $seqres.full 2>&1
tests/generic/252 +1 -1
@@ -64,7 +64,7 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full -sync +_scratch_sync _dmerror_load_error_table $AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full _dmerror_load_working_table
tests/generic/265 +1 -1
@@ -53,7 +53,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table urk=$($XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" \ -c "fdatasync" $testdir/file2 2>&1)
tests/generic/266 +1 -1
@@ -53,7 +53,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table urk=$($XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" \ -c "fdatasync" $testdir/file2 2>&1)
tests/generic/267 +1 -1
@@ -53,7 +53,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full 2>&1 _dmerror_load_working_table
tests/generic/268 +1 -1
@@ -54,7 +54,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table urk=$($XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" \ -c "fdatasync" $testdir/file2 2>&1)
tests/generic/271 +1 -1
@@ -54,7 +54,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table urk=$($XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 2>&1) echo $urk >> $seqres.full
tests/generic/272 +1 -1
@@ -54,7 +54,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table urk=$($XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 2>&1) echo $urk >> $seqres.full
tests/generic/273 +1 -1
@@ -92,7 +92,7 @@ _porter() echo "_porter $_suffix not complete" fi - sync + _scratch_sync } _do_workload()
tests/generic/274 +3 -3
@@ -50,7 +50,7 @@ echo "Fill fs with 1M IOs; ENOSPC expected" >> $seqres.full dd if=/dev/zero of=$SCRATCH_MNT/tmp1 bs=1M >>$seqres.full 2>&1 echo "Fill fs with 4K IOs; ENOSPC expected" >> $seqres.full dd if=/dev/zero of=$SCRATCH_MNT/tmp2 bs=4K >>$seqres.full 2>&1 -sync +_scratch_sync # Last effort, use O_SYNC echo "Fill fs with 4K DIOs; ENOSPC expected" >> $seqres.full dd if=/dev/zero of=$SCRATCH_MNT/tmp3 bs=4K oflag=sync >>$seqres.full 2>&1
@@ -66,7 +66,7 @@ for i in `seq 1 2 1023`; do dd if=/dev/zero of=$SCRATCH_MNT/test seek=$i bs=4K count=1 conv=notrunc \ >>$seqres.full 2>/dev/null || _fail "failed to write to test file" done -sync +_scratch_sync echo >> $seqres.full echo "Fill in prealloc space; fill holes at offsets:" >> $seqres.full for i in `seq 2 2 1023`; do
@@ -74,7 +74,7 @@ for i in `seq 2 2 1023`; do dd if=/dev/zero of=$SCRATCH_MNT/test seek=$i bs=4K count=1 conv=notrunc \ >>$seqres.full 2>/dev/null || _fail "failed to fill test file" done -sync +_scratch_sync echo >> $seqres.full echo "done"
tests/generic/275 +3 -3
@@ -51,9 +51,9 @@ dd if=/dev/zero of=$SCRATCH_MNT/tmp1 bs=256K count=1 >>$seqres.full 2>&1 # Attempt to completely fill fs dd if=/dev/zero of=$SCRATCH_MNT/tmp2 bs=1M >>$seqres.full 2>&1 -sync +_scratch_sync dd if=/dev/zero of=$SCRATCH_MNT/tmp3 bs=4K >>$seqres.full 2>&1 -sync +_scratch_sync # Last effort, use O_SYNC dd if=/dev/zero of=$SCRATCH_MNT/tmp4 bs=4K oflag=sync >>$seqres.full 2>&1 # Save space usage info to the full file
@@ -62,7 +62,7 @@ $DF_PROG $SCRATCH_MNT >>$seqres.full 2>&1 # Should leave approx 256k free rm -f $SCRATCH_MNT/tmp1 -sync +_scratch_sync echo "Post rm space:" >> $seqres.full $DF_PROG $SCRATCH_MNT >>$seqres.full 2>&1 _freespace=`$DF_PROG -k $SCRATCH_MNT | tail -n 1 | awk '{print $5}'`
tests/generic/276 +1 -1
@@ -54,7 +54,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table $XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ >> $seqres.full 2>&1
tests/generic/278 +1 -1
@@ -55,7 +55,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table urk=$($XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 2>&1) echo $urk >> $seqres.full
tests/generic/279 +1 -1
@@ -53,7 +53,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table # Insulate ourselves against bash reporting the SIGBUS when we try to modify # the metadata.
tests/generic/281 +1 -1
@@ -53,7 +53,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table # Insulate ourselves against bash reporting the SIGBUS when we try to modify # the metadata.
tests/generic/282 +1 -1
@@ -53,7 +53,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table # Insulate ourselves against bash reporting the SIGBUS when we try to modify # the metadata.
tests/generic/283 +1 -1
@@ -54,7 +54,7 @@ md5sum $testdir/file1 | _filter_scratch md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" -sync +_scratch_sync _dmerror_load_error_table # Insulate ourselves against bash reporting the SIGBUS when we try to modify # the metadata.
tests/generic/315 +1 -1
@@ -41,7 +41,7 @@ fsize=`_get_filesize $TEST_DIR/testfile.$seq` # Truncate the file size back to 0 truncate -s 0 $TEST_DIR/testfile.$seq -sync +_test_sync # Preallocated disk space should be released avail_done=`df -P $TEST_DIR | awk 'END {print $4}'`
tests/generic/317 +1 -1
@@ -73,7 +73,7 @@ _print_numeric_uid echo "" echo "*** Remounting ***" echo "" -sync +_scratch_sync _scratch_cycle_mount >>$seqres.full 2>&1 || _fail "remount failed" _print_numeric_uid
tests/generic/318 +1 -1
@@ -81,7 +81,7 @@ _print_getfacls echo "*** Remounting ***" echo "" -sync +_scratch_sync _scratch_cycle_mount >>$seqres.full 2>&1 || _fail "remount failed" _print_getfacls
tests/generic/325 +1 -1
@@ -42,7 +42,7 @@ $XFS_IO_PROG -f -c "pwrite -S 0xff 0 256K" $SCRATCH_MNT/foo | _filter_xfs_io # Now sync the file data to disk using 'sync' and not an fsync. This is because # in btrfs the first fsync clears the btrfs inode full fsync flag, which must # be set when the first msync below happens in order to trigger the bug. -sync +_scratch_sync # Now update the first 4Kb and the last 4Kb of the file, using memory mapped IO # because an msync(), since the linux kernel commit
tests/generic/328 +2 -2
@@ -62,12 +62,12 @@ _report_quota_blocks $SCRATCH_MNT echo "Try to dio write the whole file" _pwrite_byte 0x62 0 $sz $testdir/file1 -d >> $seqres.full -sync +_scratch_sync _report_quota_blocks $SCRATCH_MNT echo "Try to write the whole file" _pwrite_byte 0x62 0 $sz $testdir/file3 >> $seqres.full -sync +_scratch_sync _report_quota_blocks $SCRATCH_MNT # success, all done
tests/generic/329 +1 -1
@@ -57,7 +57,7 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full -sync +_scratch_sync _dmerror_load_error_table $AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full _dmerror_load_working_table
tests/generic/330 +1 -1
@@ -51,7 +51,7 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full -sync +_scratch_sync $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full $AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full _scratch_cycle_mount
tests/generic/331 +1 -1
@@ -57,7 +57,7 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full -sync +_scratch_sync _dmerror_load_error_table $AIO_TEST -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full $XFS_IO_PROG -c "fdatasync" $testdir/file2
tests/generic/332 +1 -1
@@ -52,7 +52,7 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full -sync +_scratch_sync $AIO_TEST -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full _scratch_cycle_mount
tests/generic/335 +1 -1
@@ -38,7 +38,7 @@ mkdir $SCRATCH_MNT/c touch $SCRATCH_MNT/a/b/foo # Make sure everything is durably persisted. -sync +_scratch_sync # Now move our test file into a new parent directory. mv $SCRATCH_MNT/a/b/foo $SCRATCH_MNT/c/
tests/generic/336 +1 -1
@@ -43,7 +43,7 @@ ln $SCRATCH_MNT/a/foo $SCRATCH_MNT/b/foo_link touch $SCRATCH_MNT/b/bar # Make sure everything is durably persisted. -sync +_scratch_sync # Now delete one of the hard links of file foo and move file bar into c/ unlink $SCRATCH_MNT/b/foo_link
tests/generic/341 +1 -1
@@ -36,7 +36,7 @@ mkdir -p $SCRATCH_MNT/a/x $XFS_IO_PROG -f -c "pwrite -S 0xaf 0 32K" $SCRATCH_MNT/a/x/foo | _filter_xfs_io $XFS_IO_PROG -f -c "pwrite -S 0xba 0 32K" $SCRATCH_MNT/a/x/bar | _filter_xfs_io # Make sure everything done so far is durably persisted. -sync +_scratch_sync echo "File digests before power failure:" md5sum $SCRATCH_MNT/a/x/foo | _filter_scratch
tests/generic/342 +1 -1
@@ -40,7 +40,7 @@ _mount_flakey mkdir $SCRATCH_MNT/a $XFS_IO_PROG -f -c "pwrite -S 0xf1 0 16K" $SCRATCH_MNT/a/foo | _filter_xfs_io # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Now rename file foo to bar and create a new file named foo under the same # directory. After a power failure we must see the two files.
tests/generic/343 +1 -1
@@ -41,7 +41,7 @@ mkdir $SCRATCH_MNT/y/z touch $SCRATCH_MNT/y/foo2 # Make sure everything is durably persisted. -sync +_scratch_sync # Now add a link to foo at directory x, move directory z and file foo2 from # directory y to directory x and fsync foo's inode. We expect that after a
tests/generic/347 +1 -1
@@ -36,7 +36,7 @@ _workout() $XFS_IO_PROG -f -c "pwrite -W 0 1M" $SCRATCH_MNT/file$I &>/dev/null done - sync + _scratch_sync _dmthin_grow $GROW_SIZE
tests/generic/348 +1 -1
@@ -35,7 +35,7 @@ _mount_flakey mkdir $SCRATCH_MNT/testdir1 # Make sure it's durably persisted. -sync +_scratch_sync # Create our symlinks and fsync their parent directories. # We test both the case where the parent directory is new (not yet durably
tests/generic/353 +1 -1
@@ -48,7 +48,7 @@ cmp -s $extmap1 $extmap2 || echo "mismatched extent maps before sync" # sync and recheck, to make sure the fiemap doesn't change just # due to sync -sync +_scratch_sync $XFS_IO_PROG -c "fiemap -v" $file1 | _filter_fiemap_flags > $extmap1 $XFS_IO_PROG -c "fiemap -v" $file2 | _filter_fiemap_flags > $extmap2
tests/generic/376 +1 -1
@@ -36,7 +36,7 @@ _mount_flakey mkdir $SCRATCH_MNT/dir touch $SCRATCH_MNT/dir/foo # Make sure everything is durably persisted. -sync +_scratch_sync mv $SCRATCH_MNT/dir/foo $SCRATCH_MNT/dir/bar touch $SCRATCH_MNT/dir/foo $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/dir/bar
tests/generic/382 +1 -1
@@ -56,7 +56,7 @@ do_test() for ((i=0; i<30; i++));do _user_do "echo -n > ${SCRATCH_MNT}/file${i}" done - sync + _scratch_sync rm -f ${SCRATCH_MNT}/* >/dev/null 2>&1 }
tests/generic/387 +1 -1
@@ -37,7 +37,7 @@ done # consume all remaining free space dd if=/dev/zero of=$SCRATCH_MNT/space >/dev/null 2>&1 -sync +_scratch_sync # fs is full now and fs internal operations may need some free space, for # example, in btrfs, transaction will need to reserve space first, so here free
tests/generic/391 +1 -1
@@ -38,7 +38,7 @@ for ((off = 0; off < num_extents * extent_size; off += extent_size)); do done # To reproduce the Btrfs bug, the extent map must not be cached in memory. -sync +_test_sync echo 3 > /proc/sys/vm/drop_caches "$here/src/dio-interleaved" "$extent_size" "$num_extents" "$testfile"
tests/generic/409 +1 -1
@@ -58,7 +58,7 @@ fs_stress() -f getdents=1 \ -f fiemap=1 \ -d $target - sync + _sync_fs $target } # prepare some mountpoint dir
tests/generic/410 +1 -1
@@ -66,7 +66,7 @@ fs_stress() -f getdents=1 \ -f fiemap=1 \ -d $target - sync + _sync_fs $target } # prepare some mountpoint dir
tests/generic/411 +1 -1
@@ -49,7 +49,7 @@ fs_stress() -f getdents=1 \ -f fiemap=1 \ -d $target - sync + _sync_fs $target } # prepare some mountpoint dir
tests/generic/416 +1 -1
@@ -52,7 +52,7 @@ _scratch_remount # remove all files with odd file names, which should free near half # of the space rm $SCRATCH_MNT/*[13579] -sync +_scratch_sync # We should be able to write at least 1/8 of the whole fs size # The number 1/8 is for btrfs, which only has about 47M for data.
tests/generic/422 +2 -2
@@ -34,7 +34,7 @@ $XFS_IO_PROG -f \ touch $SCRATCH_MNT/foo4 # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Now overwrite the extent of the first file. $XFS_IO_PROG -c "pwrite -S 0xff 0 64K" $SCRATCH_MNT/foo1 | _filter_xfs_io
@@ -77,7 +77,7 @@ space_used > $SCRATCH_MNT/$seq.before cat $SCRATCH_MNT/$seq.before ) >> $seqres.full -sync +_scratch_sync # We expect the same file sizes reported by 'du' after writeback finishes.
tests/generic/425 +1 -1
@@ -52,7 +52,7 @@ while [ $i -lt $max_attrs ]; do $SETFATTR_PROG -n "user.$n" -v "$n" $testfile > $seqres.full 2>&1 || break i=$((i + 1)) done -sync +_scratch_sync echo "Check attr extent counts" f1=$(_count_attr_extents $testfile)
tests/generic/461 +1 -1
@@ -27,7 +27,7 @@ load_dir=$SCRATCH_MNT/test _run_fsstress_bg -n10000000 -p $PROCS -d $load_dir sleep $SLEEP_TIME -sync +_scratch_sync # now shutdown and unmount sleep 5
tests/generic/474 +2 -2
@@ -36,7 +36,7 @@ _scratch_mount # accelerates syncfs on testing filesystem so that test case can finish # in 30 seconds. -sync +_scratch_sync # Large fs has a huge size .use_space file, will take long time on running # fssum $SCRATCH_MNT. So change the target path to a sub-dir of $SCRATCH_MNT.
@@ -47,7 +47,7 @@ $XFS_IO_PROG -f -c "pwrite 0 4K" $localdir/testfile >/dev/null 2>&1 # fssum used for comparing checksum of test file(data & metedata), # exclude checking about atime, block structure, open error. $FSSUM_PROG -ugomAcdES -f -w $tmp.fssum $localdir -$XFS_IO_PROG -c "syncfs" $localdir/testfile >/dev/null 2>&1 +_sync_fs $localdir/testfile _scratch_shutdown _scratch_cycle_mount $FSSUM_PROG -r $tmp.fssum $localdir
tests/generic/479 +1 -1
@@ -53,7 +53,7 @@ run_test() _fail "Invalid file type argument: $file_type" esac # Make sure everything done so far is durably persisted. - sync + _scratch_sync # Create a file and fsync it just to create a journal/log. This file # must be in the same directory as our special file "foo".
tests/generic/480 +1 -1
@@ -38,7 +38,7 @@ touch $SCRATCH_MNT/testdir/foo ln $SCRATCH_MNT/testdir/foo $SCRATCH_MNT/testdir/bar # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Now remove of the links of our file and create a new file with the same name # and in the same parent directory, and finally fsync this new file.
tests/generic/483 +1 -1
@@ -57,7 +57,7 @@ $XFS_IO_PROG -f -c "pwrite -S 0xf1 0 256K" \ $SCRATCH_MNT/baz >/dev/null # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Allocate an extent beyond the size of the first test file and fsync it. $XFS_IO_PROG -c "falloc -k 256K 1M"\
tests/generic/489 +1 -1
@@ -39,7 +39,7 @@ $SETFATTR_PROG -n user.xa3 -v test $SCRATCH_MNT/foobar $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foobar # Call sync to commit all fileystem metadata. -sync +_scratch_sync $XFS_IO_PROG -c "pwrite -S 0xea 0 64K" \ -c "fsync" \
tests/generic/502 +1 -1
@@ -46,7 +46,7 @@ touch $SCRATCH_MNT/testdir/foo ln $SCRATCH_MNT/testdir/foo $SCRATCH_MNT/testdir/bar # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Now rename the first hard link (foo) to a new name and rename the second hard # link (bar) to the old name of the first hard link (foo).
tests/generic/505 +1 -1
@@ -40,7 +40,7 @@ do_check() touch $testfile if [ "$1" == "sync" ]; then - sync + _scratch_sync fi chown 100 $testfile
tests/generic/506 +1 -1
@@ -45,7 +45,7 @@ do_check() touch $testfile if [ "$1" == "sync" ]; then - sync + _scratch_sync fi $XFS_IO_PROG -x -c "chproj 100" $testfile
tests/generic/507 +1 -1
@@ -59,7 +59,7 @@ do_check() if [ "$2" == "sync" ]; then echo "sync" >> $seqres.full - sync + _scratch_sync fi echo "Test chattr +$1" >> $seqres.full
tests/generic/508 +1 -1
@@ -44,7 +44,7 @@ do_check() touch $testfile if [ "$1" == "sync" ]; then - sync + _scratch_sync fi before=`$XFS_IO_PROG -f $testfile -c "statx -v" | grep btime`
tests/generic/510 +1 -1
@@ -39,7 +39,7 @@ mkdir $SCRATCH_MNT/testdir/B touch $SCRATCH_MNT/testdir/B/bar # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Now move our file bar from directory B to directory A and then replace # directory B with directory A, also renaming directory A to B. Finally
tests/generic/520 +1 -1
@@ -125,7 +125,7 @@ test_link_sync() mkdir -p "${dest%/*}" touch $src ln $src $dest - sync + _scratch_sync before=`stat "$stat_opt" $src` check_consistency $src 0
tests/generic/526 +1 -1
@@ -43,7 +43,7 @@ echo -n "foo" > $SCRATCH_MNT/testdir/fname1 echo -n "hello" > $SCRATCH_MNT/testdir/fname2 # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Rename and link files such that one new name corresponds to the name of # another renamed file and one new file has the old name of one of the renamed
tests/generic/527 +1 -1
@@ -49,7 +49,7 @@ ln $SCRATCH_MNT/testdir2/zz $SCRATCH_MNT/testdir2/zz_link echo -n "hello" > $SCRATCH_MNT/testdir2/a # Make sure everything done so far is durably persisted. -sync +_scratch_sync # Rename, remove and link files such that one new name corresponds to the name # of a deleted file and one new file has the old name of the renamed file. Then
tests/generic/535 +1 -1
@@ -59,7 +59,7 @@ do_check() echo "Test chmod $target" >> $seqres.full chmod 777 $target - sync + _scratch_sync chmod 755 $target $XFS_IO_PROG $target -c "fsync"
tests/generic/546 +1 -1
@@ -47,7 +47,7 @@ _pwrite_byte 0x00 0 512m "$SCRATCH_MNT/padding" >> $seqres.full 2>&1 # Sync to ensure that padding file reach disk so that at log recovery we # still have no data space -sync +_scratch_sync # This should not fail _pwrite_byte 0xcd 1m 16m "$SCRATCH_MNT/foobar" >> $seqres.full
tests/generic/556 +1 -1
@@ -366,7 +366,7 @@ test_toplevel_dir_rename() # 'f2fs: don't use casefolded comparison for "." and ".."'. mkdir ${dir} _casefold_set_attr ${dir} - sync + _scratch_sync echo 2 > /proc/sys/vm/drop_caches mv ${dir} ${dir}.new }
tests/generic/579 +1 -1
@@ -86,7 +86,7 @@ done ( while [ ! -e $tmp.done ]; do sleep 2.$((RANDOM % 100)) - sync && echo 3 > /proc/sys/vm/drop_caches + _scratch_sync && echo 3 > /proc/sys/vm/drop_caches done ) &
tests/generic/589 +1 -1
@@ -48,7 +48,7 @@ fs_stress() local target=$1 _run_fsstress -n 50 -p 3 -d $target - sync + _sync_fs $target } # prepare some mountpoint dir
tests/generic/599 +1 -1
@@ -24,7 +24,7 @@ _scratch_mount localdir=$SCRATCH_MNT/dir mkdir $localdir -sync +_scratch_sync # fssum used for comparing checksum of test file(data & metedata), # exclude checking about atime, block structure, open error.
tests/generic/610 +1 -1
@@ -30,7 +30,7 @@ $here/src/punch-alternating $SCRATCH_MNT/foobar >>$seqres.full # For btrfs, trigger a transaction commit to force metadata COW for the # following fallocate zero range operation. -sync +_scratch_sync $XFS_IO_PROG -c "fzero 0 100M" $SCRATCH_MNT/foobar
tests/generic/628 +2 -2
@@ -54,7 +54,7 @@ $XFS_IO_PROG -f -c 'pwrite -S 0x59 0 1m -b 1m' $SCRATCH_MNT/c >> $seqres.full _cp_reflink $SCRATCH_MNT/a $SCRATCH_MNT/e _cp_reflink $SCRATCH_MNT/c $SCRATCH_MNT/d touch $SCRATCH_MNT/b -sync +_scratch_sync # Test that reflink forces dirty data/metadata to disk when destination file # opened with O_SYNC
@@ -81,7 +81,7 @@ rm -f $SCRATCH_MNT/b $SCRATCH_MNT/d _cp_reflink $SCRATCH_MNT/c $SCRATCH_MNT/d touch $SCRATCH_MNT/b chattr +S $SCRATCH_MNT/b $SCRATCH_MNT/d -sync +_scratch_sync # Test that reflink forces dirty data/metadata to disk when destination file # has the sync iflag set
tests/generic/629 +2 -2
@@ -50,7 +50,7 @@ md5sum $SCRATCH_MNT/0 | _filter_scratch # Set up initial files for copy test $XFS_IO_PROG -f -c 'pwrite -S 0x58 0 1m -b 1m' $SCRATCH_MNT/a >> $seqres.full touch $SCRATCH_MNT/b -sync +_scratch_sync # Test that unaligned copy file range forces dirty data/metadata to disk when # destination file opened with O_SYNC
@@ -66,7 +66,7 @@ md5sum $SCRATCH_MNT/a $SCRATCH_MNT/b | _filter_scratch rm -f $SCRATCH_MNT/b touch $SCRATCH_MNT/b chattr +S $SCRATCH_MNT/b -sync +_scratch_sync # Test that unaligned copy file range forces dirty data/metadata to disk when # destination file has the sync iflag set
tests/generic/640 +1 -1
@@ -38,7 +38,7 @@ mkdir $SCRATCH_MNT/B echo -n "hello world" > $SCRATCH_MNT/A/foo # Persist everything done so far. -sync +_scratch_sync # Add some new file to directory A and fsync the directory. touch $SCRATCH_MNT/A/bar
tests/generic/673 +1 -1
@@ -28,7 +28,7 @@ setup_testfile() { _pwrite_byte 0x58 0 1m $SCRATCH_MNT/a >> $seqres.full _pwrite_byte 0x57 0 1m $SCRATCH_MNT/b >> $seqres.full chmod a+r $SCRATCH_MNT/b - sync + _scratch_sync } commit_and_check() {
tests/generic/674 +1 -1
@@ -29,7 +29,7 @@ setup_testfile() { _pwrite_byte 0x58 0 1m $SCRATCH_MNT/a >> $seqres.full _pwrite_byte 0x58 0 1m $SCRATCH_MNT/b >> $seqres.full chmod a+r $SCRATCH_MNT/b - sync + _scratch_sync } commit_and_check() {
tests/generic/675 +1 -1
@@ -33,7 +33,7 @@ setup_testfile() { _pwrite_byte 0x57 0 1m $SCRATCH_MNT/b >> $seqres.full chmod a+rwx $SCRATCH_MNT/a $SCRATCH_MNT/b $SETCAP_PROG cap_setgid,cap_setuid+ep $SCRATCH_MNT/a - sync + _scratch_sync } commit_and_check() {
tests/generic/677 +1 -1
@@ -62,7 +62,7 @@ $XFS_IO_PROG -c "falloc -k 20M 1M" $SCRATCH_MNT/foo # On btrfs this commits the current transaction and it makes all the created # extents to have a generation lower than the generation of the transaction used # by the next write and fsync. -sync +_scratch_sync # Now overwrite only the first extent. # On btrfs, due to COW (both data and metadata), that results in modifying only
tests/generic/683 +1 -1
@@ -36,7 +36,7 @@ chmod a+rw $junk_dir/ setup_testfile() { rm -f $junk_file _pwrite_byte 0x58 0 192k $junk_file >> $seqres.full - sync + _test_sync } commit_and_check() {
tests/generic/684 +1 -1
@@ -36,7 +36,7 @@ chmod a+rw $junk_dir/ setup_testfile() { rm -f $junk_file _pwrite_byte 0x58 0 192k $junk_file >> $seqres.full - sync + _test_sync } commit_and_check() {
tests/generic/685 +1 -1
@@ -36,7 +36,7 @@ chmod a+rw $junk_dir/ setup_testfile() { rm -f $junk_file _pwrite_byte 0x58 0 192k $junk_file >> $seqres.full - sync + _test_sync } commit_and_check() {
tests/generic/686 +1 -1
@@ -36,7 +36,7 @@ chmod a+rw $junk_dir/ setup_testfile() { rm -f $junk_file _pwrite_byte 0x58 0 192k $junk_file >> $seqres.full - sync + _test_sync } commit_and_check() {
tests/generic/687 +1 -1
@@ -36,7 +36,7 @@ chmod a+rw $junk_dir/ setup_testfile() { rm -f $junk_file _pwrite_byte 0x58 0 192k $junk_file >> $seqres.full - sync + _test_sync } commit_and_check() {
tests/generic/688 +1 -1
@@ -40,7 +40,7 @@ setup_testfile() { touch $junk_file chmod a+rwx $junk_file $SETCAP_PROG cap_setgid,cap_setuid+ep $junk_file - sync + _test_sync } commit_and_check() {
tests/generic/690 +1 -1
@@ -52,7 +52,7 @@ _mount_flakey mkdir "$SCRATCH_MNT"/testdir # Commit the current transaction and persist the directory. -sync +_scratch_sync # Create a file in the test directory, so that the next fsync on the directory # actually does something (it logs the directory).
tests/generic/694 +1 -1
@@ -39,7 +39,7 @@ fi # make sure indirect block reservations and other temporary block reservations # are released before sampling i_blocks -sync $junk_file +_test_sync iblocks=`stat -c '%b' $junk_file`
tests/generic/695 +1 -1
@@ -51,7 +51,7 @@ $XFS_IO_PROG -f -c "truncate 12M" \ $SCRATCH_MNT/foobar | _filter_xfs_io # Persist everything, commit the filesystem's transaction. -sync +_scratch_sync # Now punch two holes in the file: #
tests/generic/703 +1 -1
@@ -70,7 +70,7 @@ fi $XFS_IO_PROG -c "falloc 0 256M" $test_file # Persist everything, make sure the file exists after power failure. -sync +_scratch_sync echo -e "Running fio with config:\n" >> $seqres.full cat $fio_config >> $seqres.full
tests/generic/716 +1 -1
@@ -36,7 +36,7 @@ filesnap() { mkfile() { rm -f $dir/a _pwrite_byte 0x58 0 $((blksz * nrblks)) $dir/a >> $seqres.full - sync + _test_sync } dir=$TEST_DIR/test-$seq
tests/generic/718 +1 -1
@@ -31,7 +31,7 @@ nrblks=64 # Create some 4M files to test exchangerange _pwrite_byte 0x58 0 $((blksz * nrblks)) $dir/a >> $seqres.full _pwrite_byte 0x59 0 $((blksz * nrblks)) $dir/b >> $seqres.full -sync +_test_sync md5sum $dir/a $dir/b | _filter_test_dir # Set FSIZE to twice the blocksize (IOWs, 128k)
tests/generic/719 +1 -1
@@ -34,7 +34,7 @@ filesnap() { mkfile() { rm -f $dir/a _pwrite_byte 0x58 0 $((blksz * nrblks)) $dir/a >> $seqres.full - sync + _test_sync } dir=$TEST_DIR/test-$seq
tests/generic/721 +1 -1
@@ -35,7 +35,7 @@ mkfile() { rm -f $dir/a _pwrite_byte 0x58 0 $((blksz * nrblks)) $dir/a >> $seqres.full chown $qa_user $dir/a $dir/ - sync + _test_sync } dir=$TEST_DIR/test-$seq
tests/generic/725 +1 -1
@@ -31,7 +31,7 @@ _require_congruent_file_oplen $SCRATCH_MNT 65536 # Create original file _pwrite_byte 0x58 0 1m $SCRATCH_MNT/a >> $seqres.full -sync +_scratch_sync md5sum $SCRATCH_MNT/a | _filter_scratch # Test atomic scatter-gather file commits.
tests/generic/726 +1 -1
@@ -35,7 +35,7 @@ chmod a+rw $SCRATCH_MNT/ setup_testfile() { rm -f $SCRATCH_MNT/a _pwrite_byte 0x58 0 1m $SCRATCH_MNT/a >> $seqres.full - sync + _scratch_sync } commit_and_check() {
tests/generic/727 +1 -1
@@ -42,7 +42,7 @@ setup_testfile() { _pwrite_byte 0x57 0 1m $SCRATCH_MNT/b >> $seqres.full chmod a+rw $SCRATCH_MNT/a $SCRATCH_MNT/b $SETCAP_PROG cap_setgid,cap_setuid+ep $SCRATCH_MNT/a - sync + _scratch_sync } commit_and_check() {
tests/generic/735 +1 -1
@@ -42,7 +42,7 @@ $XFS_IO_PROG -f -c "finsert 1M ${finsert_len}" "${SCRATCH_MNT}/file" >> $seqres. # Filling up the free space ensures that the pre-allocated space is the reserved space. nr_free=$(stat -f -c '%f' ${SCRATCH_MNT}) _fill_fs $((nr_free * file_blksz)) ${SCRATCH_MNT}/fill $file_blksz 0 >> $seqres.full 2>&1 -sync +_scratch_sync # Remove reserved space to gain free space for allocation rm -f ${SCRATCH_MNT}/tmp
tests/generic/738 +1 -1
@@ -36,7 +36,7 @@ $XFS_IO_PROG -fc "pwrite 0 64k" $SCRATCH_MNT/testfile >> $seqres.full for i in $(seq 0 1024); do create_eof_block_file $SCRATCH_MNT/$i done -sync +_scratch_sync xfs_freeze -f $SCRATCH_MNT # This will hang if bug reproduces
tests/generic/745 +2 -2
@@ -51,7 +51,7 @@ _mount_flakey # Create the test file with some initial data and make sure everything is # durably persisted. $XFS_IO_PROG -f -c "pwrite -S 0xaa 0 32k" $SCRATCH_MNT/foo | _filter_xfs_io -sync +_scratch_sync # Add many small xattrs to our file. # We create such a large amount because it's needed to trigger the issue found
@@ -66,7 +66,7 @@ done # Sync the filesystem to force a commit of the current btrfs transaction, this # is a necessary condition to trigger the bug on btrfs. -sync +_scratch_sync # Now update our file's data and fsync the file. # After a successful fsync, if the fsync log/journal is replayed we expect to
tests/generic/746 +2 -2
@@ -170,7 +170,7 @@ for i in `seq 1 10`; do done # Get reference fiemap, this can contain i.e. uninitialized inode table -sync +_sync_fs $loop_mnt get_holes > $fiemap_ref # Delete some files
@@ -184,7 +184,7 @@ echo "done." echo -n "Detecting interesting holes in image..." # Get after-trim fiemap -sync +_sync_fs $loop_mnt get_holes > $fiemap_after echo "done."
tests/generic/747 +2 -2
@@ -57,7 +57,7 @@ _used_percent() { _delete_random_file() { local to_delete=$(find ${SCRATCH_MNT} -type f | shuf | head -1) rm $to_delete - sync ${SCRATCH_MNT} + _scratch_sync } _get_random_fsz() {
@@ -110,7 +110,7 @@ echo "Starting mixed write/delete test using buffered IO" _mixed_write_delete "" echo "Syncing" -sync ${SCRATCH_MNT}/* +_scratch_sync echo "Done, all good"
tests/generic/749 +2 -2
@@ -100,7 +100,7 @@ do_mmap_tests() $XFS_IO_PROG -f -c "pwrite -S 0xaa -b 512 $offset $len" \ $test_file >> $seqres.full - sync + _scratch_sync new_filelen=$(_get_filesize $test_file) map_len=$(_round_up_to_page_boundary $new_filelen) csum_orig="$(_md5_checksum $test_file)"
@@ -141,7 +141,7 @@ do_mmap_tests() -c "mmap -w 0 $map_len" \ -c "mwrite $new_filelen $zero_filled_data_len" \ -c "munmap" - sync + _scratch_sync csum_post="$(_md5_checksum $test_file)" if [[ "$csum_orig" != "$csum_post" ]]; then let failed=$failed+1
tests/xfs/016 +2 -2
@@ -101,9 +101,9 @@ _log_traffic() while [ $count -ge 0 ] do touch $out - sync + _scratch_sync rm $out - sync + _scratch_sync let "count = count - 1" done
tests/xfs/052 +1 -1
@@ -54,7 +54,7 @@ fi # create 100 (fs-blocksize) blocks _file_as_id $SCRATCH_MNT/foo $id $type $dbsize 220 -sync +_scratch_sync # set limit at 1001 (1k) blocks bsoft=1001
tests/xfs/110 +1 -1
@@ -43,7 +43,7 @@ do done wait -sync +_scratch_sync I=10030585 E=10030599
tests/xfs/118 +2 -2
@@ -38,7 +38,7 @@ echo "Silence is golden" # preallocation added. Let's say... 64k free chunks. $XFS_IO_PROG -fs -c "falloc 0 40000k" $SCRATCH_MNT/fill >> $seqres.full 2>&1 -sync +_scratch_sync dd if=/dev/zero of=$SCRATCH_MNT/remainder oflag=direct > /dev/null 2>&1
@@ -55,7 +55,7 @@ for I in `seq 1 64`; do >> $seqres.full 2>&1 done # sync to get extents on disk so fsr sees them -sync +_scratch_sync # Free up some space for defragmentation temp file rm -f $SCRATCH_MNT/fill
tests/xfs/119 +1 -1
@@ -30,7 +30,7 @@ _require_scratch _require_freeze # this may hang -sync +_scratch_sync export MKFS_OPTIONS="-l version=2,su=64k" logblks=$(_scratch_find_xfs_min_logblocks)
tests/xfs/128 +1 -1
@@ -42,7 +42,7 @@ blksz_factor=$((blksz / real_blksz)) # preallocate space to try to produce a single extent. $XFS_IO_PROG -f -c "falloc 0 $((blks * blksz))" $testdir/file1 >> $seqres.full _pwrite_byte 0x61 0 $((blks * blksz)) $testdir/file1 >> $seqres.full -sync +_scratch_sync nextents=$($XFS_IO_PROG -c 'stat' $testdir/file1 | grep 'fsxattr.nextents' | awk '{print $3}')
tests/xfs/133 +1 -1
@@ -49,7 +49,7 @@ fi echo "Remount, try to append" _scratch_mount dd if=/dev/zero of=$testdir/a bs=512 count=1 oflag=append conv=notrunc >> $seqres.full 2>&1 || echo "Write did not succeed (ok)." -sync +_scratch_sync # success, all done status=0
tests/xfs/134 +1 -1
@@ -52,7 +52,7 @@ fi echo "Remount, try to append" _scratch_mount dd if=/dev/zero of=$testdir/a bs=512 count=1 oflag=direct,append conv=notrunc >> $seqres.full 2>&1 || echo "Write did not succeed (ok)." -sync +_scratch_sync # success, all done status=0
tests/xfs/161 +1 -1
@@ -51,7 +51,7 @@ lim_bhard=$(( 100 * blksz )) # Force the block counters for uid 1 and 2 above zero _pwrite_byte 0x61 0 $filesz $SCRATCH_MNT/a >> $seqres.full _pwrite_byte 0x61 0 $filesz $SCRATCH_MNT/b >> $seqres.full -sync +_scratch_sync chown 1 $SCRATCH_MNT/a chown 2 $SCRATCH_MNT/b
tests/xfs/176 +1 -1
@@ -151,7 +151,7 @@ for ((ino = icluster_ino; ino < icluster_ino + XFS_INODES_PER_CHUNK; ino++)); do find $SCRATCH_MNT/urk/ -inum "$ino" -print0 | xargs -r -0 mv -t $SCRATCH_MNT/save/ done rm -rf $SCRATCH_MNT/urk/ $SCRATCH_MNT/save/*/* -sync +_scratch_sync $XFS_IO_PROG -c 'fsmap -vvvvv' $SCRATCH_MNT &>> $seqres.full # Propose shrinking the filesystem such that the end of the fs ends up in the
tests/xfs/195 +1 -1
@@ -56,7 +56,7 @@ $CHATTR_PROG +d $TEST_DIR/d/t _do_dump echo "Dump exclude flag set, after sync (should be skipped)" -sync +_test_sync _do_dump # success, all done
tests/xfs/201 +2 -2
@@ -64,8 +64,8 @@ do_pwrite 5000 6455 $min_align do_pwrite 1728 4999 $min_align do_pwrite 0 1727 $min_align -sync -sync +_scratch_sync +_scratch_sync # and truncate it again > $SCRATCH_MNT/bigfile
tests/xfs/212 +1 -1
@@ -52,7 +52,7 @@ echo "CoW and leave leftovers" $XFS_IO_PROG -f -c "extsize" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 $((filesize - 1)) 1" -c "fsync" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 $((filesize - 1)) 1" -c "fsync" $testdir/file2.chk >> $seqres.full -sync +_scratch_sync echo "Crash and recover" $XFS_IO_PROG -x -c "shutdown" $testdir/file2 >> $seqres.full
tests/xfs/227 +1 -1
@@ -60,7 +60,7 @@ fragment_freespace() $XFS_IO_PROG -f -c "unresvsp ${i}k 4k" $_file \ > /dev/null 2>&1 done - sync + _scratch_sync # and now use up all the remaining extents larger than 3 blocks $XFS_IO_PROG -fs -c "resvsp 0 4m" $_file.large > /dev/null 2>&1
tests/xfs/231 +2 -2
@@ -71,7 +71,7 @@ seq 2 2 $((nr - 1)) | while read f; do $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f - 1)) 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f - 1)) 1" $testdir/file2.chk >> $seqres.full done -sync +_scratch_sync echo "Wait for CoW expiration" sleep 3
@@ -88,7 +88,7 @@ seq 2 2 $((nr - 1)) | while read f; do $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f)) 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f)) 1" $testdir/file2.chk >> $seqres.full done -sync +_scratch_sync echo "Compare files" md5sum $testdir/file1 | _filter_scratch
tests/xfs/232 +2 -2
@@ -74,7 +74,7 @@ seq 2 2 $((nr - 1)) | while read f; do $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f - 1)) 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f - 1)) 1" $testdir/file2.chk >> $seqres.full done -sync +_scratch_sync echo "Wait for CoW expiration" $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * 2)) 1" $testdir/file2 >> $seqres.full
@@ -92,7 +92,7 @@ seq 2 2 $((nr - 1)) | while read f; do $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f)) 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f)) 1" $testdir/file2.chk >> $seqres.full done -sync +_scratch_sync echo "Compare files" md5sum $testdir/file1 | _filter_scratch
tests/xfs/234 +1 -1
@@ -39,7 +39,7 @@ echo "Create the original file blocks" blksz="$(_get_block_size $testdir)" nr_blks=$((4 * blksz / 12)) _pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/file1 >> $seqres.full -sync +_scratch_sync echo "Punch every other block" seq 1 2 $((nr_blks - 1)) | while read nr; do
tests/xfs/236 +1 -1
@@ -38,7 +38,7 @@ nr_blks=$((8 * blksz / 12)) for i in 1 2 x; do _pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/file1 >> $seqres.full _pwrite_byte 0x62 0 $((blksz * nr_blks)) $testdir/file2 >> $seqres.full - sync + _scratch_sync echo "$i: Reflink every other block" seq 1 2 $((nr_blks - 1)) | while read nr; do
tests/xfs/237 +1 -1
@@ -60,7 +60,7 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full -sync +_scratch_sync _dmerror_load_error_table $AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full _dmerror_load_working_table
tests/xfs/239 +1 -1
@@ -56,7 +56,7 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full -sync +_scratch_sync $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full $AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full _scratch_cycle_mount
tests/xfs/240 +1 -1
@@ -62,7 +62,7 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full -sync +_scratch_sync _dmerror_load_error_table $AIO_TEST -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full $XFS_IO_PROG -c "fdatasync" $testdir/file2
tests/xfs/241 +1 -1
@@ -57,7 +57,7 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full -sync +_scratch_sync $AIO_TEST -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full _scratch_cycle_mount
tests/xfs/243 +2 -2
@@ -66,7 +66,7 @@ seq 3 5 $nr | while read f; do _pwrite_byte 0x71 $((blksz * f)) $blksz $testdir/file3 >> $seqres.full _pwrite_byte 0x71 $((blksz * f)) $blksz $testdir/file3.chk >> $seqres.full done -sync +_scratch_sync # 4 blocks are delalloc (do later) seq 4 5 $nr | while read f; do _pwrite_byte 0x62 $((blksz * f)) $blksz $testdir/file3 >> $seqres.full
@@ -102,7 +102,7 @@ echo "Regular data extents:" test $(_xfs_bmapx_find data $testdir/file3 -E '00[01]{4}$') -gt 0 || \ echo "Expected to find a regular data extent" -sync +_scratch_sync echo "Dump extents after sync" $XFS_IO_PROG -c "cowextsize" $testdir/file3 | _filter_scratch
tests/xfs/246 +1 -1
@@ -25,7 +25,7 @@ mkdir $testdir echo "Create the original files" touch $testdir/file1 -sync +_scratch_sync echo "Dump extents after sync" echo "Hole CoW extents:"
tests/xfs/265 +1 -1
@@ -44,7 +44,7 @@ for i in 1 2 x; do seq 1 $nr_blks | while read nr; do _cp_reflink $testdir/file1 $testdir/file1.$nr >> $seqres.full done - sync + _scratch_sync echo "$i: Truncate files" seq 1 $nr_blks | while read nr; do
tests/xfs/272 +1 -1
@@ -33,7 +33,7 @@ _scratch_mount _xfs_force_bdev data $SCRATCH_MNT _pwrite_byte 0x80 0 737373 $SCRATCH_MNT/urk >> $seqres.full -sync +_scratch_sync $here/src/punch-alternating $SCRATCH_MNT/urk >> $seqres.full ino=$(stat -c '%i' $SCRATCH_MNT/urk)
tests/xfs/274 +1 -1
@@ -32,7 +32,7 @@ _scratch_mkfs > "$seqres.full" 2>&1 _scratch_mount _pwrite_byte 0x80 0 737373 $SCRATCH_MNT/f1 >> $seqres.full -sync +_scratch_sync $here/src/punch-alternating $SCRATCH_MNT/f1 >> $seqres.full _cp_reflink $SCRATCH_MNT/f1 $SCRATCH_MNT/f2 ino=$(stat -c '%i' $SCRATCH_MNT/f1)
tests/xfs/276 +1 -1
@@ -37,7 +37,7 @@ _scratch_mount test $rtextsz -eq $dbsize || _notrun "Skipping test due to rtextsize > 1 fsb" $XFS_IO_PROG -f -R -c 'pwrite -S 0x80 0 737373' $SCRATCH_MNT/urk >> $seqres.full -sync +_scratch_sync $here/src/punch-alternating $SCRATCH_MNT/urk >> $seqres.full ino=$(stat -c '%i' $SCRATCH_MNT/urk)
tests/xfs/291 +2 -2
@@ -41,12 +41,12 @@ mkdir $SCRATCH_MNT/fragdir for I in `seq 0 26200`; do (echo data > $SCRATCH_MNT/fragdir/f$I) >> $seqres.full 2>&1 done -sync +_scratch_sync for I in `seq 0 2 26200`; do rm -f $SCRATCH_MNT/fragdir/f$I >> $seqres.full 2>&1 done -sync +_scratch_sync # Soak up any remaining freespace $XFS_IO_PROG -f -c "pwrite 0 16m" -c "fsync" $SCRATCH_MNT/space_file.large >> $seqres.full 2>&1
tests/xfs/309 +1 -1
@@ -44,7 +44,7 @@ for i in 1 2 x; do seq 1 $nr_blks | while read nr; do _cp_reflink $testdir/file1 $testdir/file1.$nr >> $seqres.full done - sync + _scratch_sync echo "$i: Truncate files" seq 1 $nr_blks | while read nr; do
tests/xfs/312 +1 -1
@@ -45,7 +45,7 @@ _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file3 seq 1 2 $blks | while read off; do $XFS_IO_PROG -c "fpunch $((off * blksz)) $blksz" $SCRATCH_MNT/file3 >> $seqres.full done -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch
tests/xfs/313 +1 -1
@@ -44,7 +44,7 @@ _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file3 seq 1 2 $blks | while read off; do $XFS_IO_PROG -c "fpunch $((off * blksz)) $blksz" $SCRATCH_MNT/file3 >> $seqres.full done -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch
tests/xfs/314 +1 -1
@@ -45,7 +45,7 @@ _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file3 seq 1 2 $blks | while read off; do $XFS_IO_PROG -c "fpunch $((off * blksz)) $blksz" $SCRATCH_MNT/file3 >> $seqres.full done -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch
tests/xfs/315 +2 -2
@@ -43,7 +43,7 @@ echo "Create files" _pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full _pwrite_byte 0x66 $((sz / 2)) $((sz / 2)) $SCRATCH_MNT/file2 >> $seqres.full _reflink_range $SCRATCH_MNT/file1 0 $SCRATCH_MNT/file2 0 $((sz / 2)) >> $seqres.full -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch
@@ -54,7 +54,7 @@ _scratch_inject_error "free_extent" echo "CoW a few blocks" $XFS_IO_PROG -c "pwrite -W -S 0x67 -b $sz 0 $sz" $SCRATCH_MNT/file1 >> $seqres.full 2>&1 -sync +_scratch_sync echo "FS should be shut down, touch will fail" touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch
tests/xfs/316 +1 -1
@@ -45,7 +45,7 @@ _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file3 seq 1 2 $blks | while read off; do $XFS_IO_PROG -c "fpunch $((off * blksz)) $blksz" $SCRATCH_MNT/file3 >> $seqres.full done -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch
tests/xfs/317 +1 -1
@@ -36,7 +36,7 @@ _scratch_mount >> $seqres.full echo "Create files" touch $SCRATCH_MNT/file1 _pwrite_byte 0x67 0 $sz $SCRATCH_MNT/file0 >> $seqres.full -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file0 | _filter_scratch
tests/xfs/318 +2 -2
@@ -43,7 +43,7 @@ touch $SCRATCH_MNT/file1 echo "Write files" $XFS_IO_PROG -c "pwrite -S 0x67 0 $sz" $SCRATCH_MNT/file1 >> $seqres.full -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 2>&1 | _filter_scratch
@@ -53,7 +53,7 @@ _scratch_inject_error "free_extent" echo "Remove files" rm -rf $SCRATCH_MNT/file1 -sync +_scratch_sync $XFS_IO_PROG -x -c 'freeze' -c 'thaw' $SCRATCH_MNT >> $seqres.full 2>&1 echo "FS should be shut down, touch will fail"
tests/xfs/319 +1 -1
@@ -38,7 +38,7 @@ echo "Create files" _pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file2 _pwrite_byte 0x67 0 $sz $SCRATCH_MNT/file3 >> $seqres.full -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch
tests/xfs/320 +1 -1
@@ -37,7 +37,7 @@ _scratch_mount >> $seqres.full echo "Create files" _pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file2 -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch
tests/xfs/321 +1 -1
@@ -37,7 +37,7 @@ _scratch_mount >> $seqres.full echo "Create files" _pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full $XFS_IO_PROG -f -c "truncate $sz" $SCRATCH_MNT/file3 >> $seqres.full -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch
tests/xfs/322 +1 -1
@@ -39,7 +39,7 @@ _require_congruent_file_oplen $SCRATCH_MNT $blksz echo "Create files" _pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full $XFS_IO_PROG -f -c "truncate $sz" $SCRATCH_MNT/file3 >> $seqres.full -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch
tests/xfs/323 +1 -1
@@ -37,7 +37,7 @@ _scratch_mount >> $seqres.full echo "Create files" _pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full _pwrite_byte 0x67 0 $sz $SCRATCH_MNT/file3 >> $seqres.full -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch
tests/xfs/324 +1 -1
@@ -45,7 +45,7 @@ _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file3 seq 1 2 $blks | while read off; do $XFS_IO_PROG -c "fpunch $((off * blksz)) $blksz" $SCRATCH_MNT/file3 >> $seqres.full done -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch
tests/xfs/325 +2 -2
@@ -39,7 +39,7 @@ _scratch_mount >> $seqres.full echo "Create files" _pwrite_byte 0x66 0 $((blksz * blks)) $SCRATCH_MNT/file1 >> $seqres.full _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file2 -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch
@@ -52,7 +52,7 @@ echo "Inject error" _scratch_inject_error "free_extent" rm $SCRATCH_MNT/file1 -sync +_scratch_sync $XFS_IO_PROG -x -c 'freeze' -c 'thaw' $SCRATCH_MNT >> $seqres.full 2>&1 echo "FS should be shut down, touch will fail"
tests/xfs/326 +2 -2
@@ -62,7 +62,7 @@ _cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file3 seq 1 2 $blks | while read off; do $XFS_IO_PROG -c "fpunch $((off * blksz)) $blksz" $SCRATCH_MNT/file3 >> $seqres.full done -sync +_scratch_sync echo "Check files" md5sum $SCRATCH_MNT/file1 | _filter_scratch
@@ -70,7 +70,7 @@ md5sum $SCRATCH_MNT/file2 | _filter_scratch md5sum $SCRATCH_MNT/file3 | _filter_scratch $XFS_IO_PROG -c "pwrite -W -S 0x67 $((10 * blksz)) 1" $SCRATCH_MNT/file2 >> $seqres.full -sync +_scratch_sync echo "Inject error" _scratch_inject_error "refcount_finish_one"
tests/xfs/327 +1 -1
@@ -37,7 +37,7 @@ _pwrite_byte 0x66 0 1 $SCRATCH_MNT/file.0 >> $seqres.full seq 1 $nr | while read i; do _cp_reflink $SCRATCH_MNT/file.0 $SCRATCH_MNT/file.$i done -sync +_scratch_sync ino_0=$(stat -c '%i' $SCRATCH_MNT/file.0) ino_64=$(stat -c '%i' $SCRATCH_MNT/file.64)
tests/xfs/420 +1 -1
@@ -109,7 +109,7 @@ md5sum $testdir/file3 | _filter_scratch echo 1 > /proc/sys/vm/drop_caches echo "sync filesystem" | tee -a $seqres.full -sync +_scratch_sync $XFS_IO_PROG -c "bmap -ev" -c "bmap -cv" $testdir/file1 >> $seqres.full 2>&1 $XFS_IO_PROG -c "bmap -ev" -c "bmap -cv" $testdir/file2 >> $seqres.full 2>&1
tests/xfs/421 +1 -1
@@ -94,7 +94,7 @@ md5sum $testdir/file3 | _filter_scratch echo 1 > /proc/sys/vm/drop_caches echo "sync filesystem" | tee -a $seqres.full -sync +_scratch_sync $XFS_IO_PROG -c "bmap -ev" -c "bmap -cv" $testdir/file1 >> $seqres.full 2>&1 $XFS_IO_PROG -c "bmap -ev" -c "bmap -cv" $testdir/file2 >> $seqres.full 2>&1
tests/xfs/423 +1 -1
@@ -31,7 +31,7 @@ _scratch_mount $XFS_IO_PROG -f -c 'falloc 0 10m' $SCRATCH_MNT/a >> $seqres.full $XFS_IO_PROG -f -c 'falloc 0 10m' $SCRATCH_MNT/b >> $seqres.full $here/src/punch-alternating $SCRATCH_MNT/b -sync +_scratch_sync echo "Set up delalloc extents" $XFS_IO_PROG -c 'pwrite -S 0x66 10m 128k' $SCRATCH_MNT/a >> $seqres.full
tests/xfs/438 +1 -1
@@ -136,7 +136,7 @@ $DMSETUP_PROG table >> $seqres.full $XFS_QUOTA_PROG -x -c "limit -u isoft=400 $qa_user" $SCRATCH_MNT $XFS_QUOTA_PROG -x -c "report -ih" $SCRATCH_MNT >> $seqres.full -sync +_scratch_sync # wait for the push of the dquota log item in AIL and # the completion of the retried write of dquota buffer
tests/xfs/440 +1 -1
@@ -43,7 +43,7 @@ $XFS_IO_PROG -c 'stat -r' $SCRATCH_MNT/a | grep stat.size >> $seqres.full _report_quota_blocks "-u $SCRATCH_MNT" echo "Sync" -sync +_scratch_sync _report_quota_blocks "-u $SCRATCH_MNT" echo "Chown and check quota"
tests/xfs/442 +1 -1
@@ -36,7 +36,7 @@ compare_quota_to_du() { # This ensures that we did the quota accounting correctly and that we're # accurately reporting cow preallocation blocks in stat. check_quota_du_blocks() { - sync + _scratch_sync #$XFS_QUOTA_PROG -x -c 'report' $SCRATCH_MNT >> $seqres.full du_rep=$(du -ks $SCRATCH_MNT | awk '{print $1}') u_rep=$(report_quota_blocks -u)
tests/xfs/511 +1 -1
@@ -33,7 +33,7 @@ _require_prjquota $SCRATCH_DEV # Create a directory to be project object, and create a file to take 64k space mkdir $SCRATCH_MNT/t -$XFS_IO_PROG -f -c "pwrite 0 65536" -c sync $SCRATCH_MNT/t/file >>$seqres.full +$XFS_IO_PROG -f -c "pwrite 0 65536" -c syncfs $SCRATCH_MNT/t/file >>$seqres.full quota_cmd="$XFS_QUOTA_PROG -x" $quota_cmd -c "project -s -p $SCRATCH_MNT/t 42" $SCRATCH_MNT >/dev/null 2>&1
tests/xfs/519 +1 -1
@@ -28,7 +28,7 @@ $XFS_IO_PROG -f -c 'pwrite -S 0x59 0 1m -b 1m' $SCRATCH_MNT/c >> $seqres.full _cp_reflink $SCRATCH_MNT/a $SCRATCH_MNT/e _cp_reflink $SCRATCH_MNT/c $SCRATCH_MNT/d touch $SCRATCH_MNT/b -sync +_scratch_sync # Test that setting the reflink flag on the dest file forces the log echo "test reflink flag not set"
tests/xfs/520 +1 -1
@@ -46,7 +46,7 @@ force_crafted_metadata() { if [ $mounted -ne 0 ]; then dd if=/dev/zero of=$SCRATCH_MNT/test bs=65536 count=1 >> \ $seqres.full 2>&1 - sync + _scratch_sync fi _dmesg_since_test_start | tac | sed -ne "0,\#${kmsg}#p" | tac | \
tests/xfs/541 +1 -1
@@ -91,7 +91,7 @@ test $after_rtextsz_blocks -eq $new_rtextsz_blocks || \ # Create a new realtime file to prove that we can. echo moo > $SCRATCH_MNT/a -sync -f $SCRATCH_MNT +_scratch_sync $XFS_IO_PROG -c 'lsattr -v' $SCRATCH_MNT/a | \ cut -d ' ' -f 1 | \ grep -q realtime || \
tests/xfs/553 +2 -2
@@ -45,7 +45,7 @@ $XFS_IO_PROG -c "cowextsize $((blksz * 4096))" $destination >> $seqres.full echo "Fragment FS" $XFS_IO_PROG -f -c "pwrite 0 $((blksz * 16384))" $fragmented_file \ >> $seqres.full -sync +_scratch_sync $here/src/punch-alternating $fragmented_file >> $seqres.full echo "Inject bmap_alloc_minlen_extent error tag"
@@ -54,7 +54,7 @@ _scratch_inject_error bmap_alloc_minlen_extent 1 echo "Create delalloc extent of length 4096 blocks in destination file's CoW fork" $XFS_IO_PROG -c "pwrite 0 $blksz" $destination >> $seqres.full -sync +_scratch_sync echo "Direct I/O write at 3rd block in destination file" $XFS_IO_PROG -d -c "pwrite $((blksz * 3)) $((blksz * 2))" $destination \
tests/xfs/558 +3 -3
@@ -140,13 +140,13 @@ $XFS_IO_PROG -c 'cowextsize 1m' $SCRATCH_MNT # Write out a file with the first two blocks unshared and the rest shared. _pwrite_byte 0x59 0 $((160 * blksz)) $SCRATCH_MNT/file >> $seqres.full _pwrite_byte 0x59 0 $((160 * blksz)) $SCRATCH_MNT/file.compare >> $seqres.full -sync +_scratch_sync _cp_reflink $SCRATCH_MNT/file $SCRATCH_MNT/file.reflink _pwrite_byte 0x58 0 $((2 * blksz)) $SCRATCH_MNT/file >> $seqres.full _pwrite_byte 0x58 0 $((2 * blksz)) $SCRATCH_MNT/file.compare >> $seqres.full -sync +_scratch_sync # Avoid creation of large folios on newer kernels by cycling the mount and # immediately writing to the page cache.
@@ -156,7 +156,7 @@ _scratch_cycle_mount # before slowing down writeback to avoid unnecessary delay. _pwrite_byte 0x57 0 $((2 * blksz)) $SCRATCH_MNT/file.compare >> $seqres.full _pwrite_byte 0x56 $((2 * blksz)) $((2 * blksz)) $SCRATCH_MNT/file.compare >> $seqres.full -sync +_scratch_sync # Introduce a half-second wait to each writeback block mapping call. This # gives us a chance to race speculative cow prealloc with writeback.
tests/xfs/607 +3 -3
@@ -53,7 +53,7 @@ fi echo "Create source file" $XFS_IO_PROG -f -c "pwrite 0 $((blksz * 256))" $file1 >> $seqres.full -sync +_test_sync echo "Create Reflinked file" _cp_reflink $file1 $file2 >> $seqres.full
@@ -63,7 +63,7 @@ $XFS_IO_PROG -c "cowextsize $((blksz * 128))" -c stat $file1 >> $seqres.full echo "Fragment FS" $XFS_IO_PROG -f -c "pwrite 0 $((blksz * 512))" $fragmentedfile >> $seqres.full -sync +_test_sync $here/src/punch-alternating $fragmentedfile echo "Allocate block sized extent from now onwards"
@@ -72,7 +72,7 @@ _test_inject_error bmap_alloc_minlen_extent 1 echo "Create big delalloc extent in CoW fork" $XFS_IO_PROG -c "pwrite 0 $blksz" $file1 >> $seqres.full -sync +_test_sync $XFS_IO_PROG -c 'bmap -elpv' -c 'bmap -celpv' $file1 &>> $seqres.full
tests/xfs/617 +1 -1
@@ -35,7 +35,7 @@ swap_and_check_contents() { local b="$2" local tag="$3" - sync + _scratch_sync # Test exchangerange. -w means skip holes in /b echo "swap $tag" >> $seqres.full
tests/xfs/629 +1 -1
@@ -55,7 +55,7 @@ for ((n=0; n<nfiles; n++)); do write_sync_file $n > /dev/null 2>&1 & done wait -sync +_scratch_sync for ((n=0; n<nfiles; n++)); do count=$(_count_extents $workfile.$n)
tests/xfs/630 +1 -1
@@ -58,7 +58,7 @@ for ((n=0; n<nfiles; n++)); do write_extsz_file $n > /dev/null 2>&1 & done wait -sync +_scratch_sync for ((n=0; n<nfiles; n++)); do count=$(_count_extents $workfile.$n)
tests/xfs/631 +1 -1
@@ -58,7 +58,7 @@ for ((n=0; n<nfiles; n++)); do write_direct_file $n > /dev/null 2>&1 & done wait -sync +_scratch_sync for ((n=0; n<nfiles; n++)); do count=$(_count_extents $workfile.$n)
tests/xfs/790 +1 -1
@@ -45,7 +45,7 @@ $here/src/punch-alternating $dir/a _pwrite_byte 0x59 0 $((blksz * nrblks)) $dir/b >> $seqres.full _pwrite_byte 0x59 0 $((blksz * nrblks)) $dir/c >> $seqres.full _pwrite_byte 0x58 0 $((blksz * nrblks)) $dir/a >> $seqres.full -sync +_test_sync # Inject a bmap error and trigger it via exchangerange. filesnap "before commit"
tests/xfs/791 +1 -1
@@ -38,7 +38,7 @@ _pwrite_byte 0x58 0 1m $SCRATCH_MNT/a >> $seqres.full $XFS_IO_PROG -f -c 'truncate 1m' $SCRATCH_MNT/b _pwrite_byte 0x59 64k 64k $SCRATCH_MNT/b >> $seqres.full _pwrite_byte 0x57 768k 64k $SCRATCH_MNT/b >> $seqres.full -sync +_scratch_sync md5sum $SCRATCH_MNT/a | _filter_scratch md5sum $SCRATCH_MNT/b | _filter_scratch
tests/xfs/792 +1 -1
@@ -33,7 +33,7 @@ _scratch_mount # Create original file _pwrite_byte 0x58 0 1m $SCRATCH_MNT/a >> $seqres.full -sync +_scratch_sync md5sum $SCRATCH_MNT/a | _filter_scratch # Test atomic scatter-gather file commits.
Signature · 1 line
2.45.2
PATCH 40/40 fstests: check-parallel
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Runs tests in parallel runner threads. Each runner thread has it's own set of tests to run, and runs a separate instance of check to run those tests.
check-parallel sets up loop devices, mount points, results directories, etc for each instance and divides the tests up between the runner threads.
It currently hard codes the XFS and generic test lists, and then gives each check invocation an explicit list of tests to run. It also passes through exclusions so that test exclude filtering is still done by check.
This is far from ideal, but I didn't want to have to embark on a major refactoring of check to be able to run stuff in parallel. It was quite the challenge just to get all the tests and test infrastructure up to the point where they can run reliably in parallel.
Hence I've left the actual factoring of test selection and setup out of the patchset for the moment. The plan is to factor both the test setup and the test list runner loop out of check and share them between check and check-parallel, hence not requiring check-parallel to run check directly. That is future work, however.
With the current test runner setup, it is not uncommon to see >5000% cpu usage, 150-200kiops and 4-5GB/s of disk bandwidth being used when running 64 runners. This is a serious stress load as it is constantly mounting and unmounting dozens of filesystems, creating and destroying devices, dropping caches, running sync, running CPU hot plug, running page cache migration, etc.
The massive amount of IO that load generates causes qemu hosts to abort (i.e. crash) because they run out of vm map segments. Hence bumping up the max_map_count on the host like so:
echo 1048576 > /proc/sys/vm/max_map_count
is necessary.
There is no significant memory pressure to speak of from running the tests like this. I've seen a maximum of about 50GB of RAM used when running tests like this, so running on a 64p/64GB VM the additional concurrency doesn't really stress memory capacity like it does CPU and IO.
All the runners are executed in private mount namespaces. This is to prevent ephemeral mount namespace clones from taking a reference to every mounted filesystem in the machine and so causing random "device busy after unmount" failures in the tests that are running concurrently with the mount namespace setup and teardown.
A typical pstree -N mnt looks like:
$ pstree -N mnt
[4026531841]
bash
bash───pstree
[0]
sudo───sudo───check-parallel─┬─check-parallel───nsexec───check───311─┬─cut
│ └─md5sum
├─check-parallel───nsexec───check───750─┬─750───sleep
│ └─750.fsstress───4*[750.fsstress───{750.fsstress}]
├─check-parallel───nsexec───check───013───013───sed
├─check-parallel───nsexec───check───251───cp
├─check-parallel───nsexec───check───467───open_by_handle
├─check-parallel───nsexec───check───650─┬─650───sleep
│ └─650.fsstress─┬─61*[650.fsstress───{650.fsstress}]
│ └─2*[650.fsstress]
├─check-parallel───nsexec───check───707
├─check-parallel───nsexec───check───705
├─check-parallel───nsexec───check───416
├─check-parallel───nsexec───check───477───2*[open_by_handle]
├─check-parallel───nsexec───check───140───140
├─check-parallel───nsexec───check───562
├─check-parallel───nsexec───check───415───xfs_io───{xfs_io}
├─check-parallel───nsexec───check───291
├─check-parallel───nsexec───check───017
├─check-parallel───nsexec───check───016
├─check-parallel───nsexec───check───168───2*[168───168]
├─check-parallel───nsexec───check───672───2*[672───672]
├─check-parallel───nsexec───check───170─┬─170───170───170
│ └─170───170
├─check-parallel───nsexec───check───531───122*[t_open_tmpfiles]
├─check-parallel───nsexec───check───387
├─check-parallel───nsexec───check───748
├─check-parallel───nsexec───check───388─┬─388.fsstress───4*[388.fsstress───{388.fsstress}]
│ └─sleep
├─check-parallel───nsexec───check───328───328
├─check-parallel───nsexec───check───352
├─check-parallel───nsexec───check───042
├─check-parallel───nsexec───check───426───open_by_handle
├─check-parallel───nsexec───check───756───2*[open_by_handle]
├─check-parallel───nsexec───check───227
├─check-parallel───nsexec───check───208───aio-dio-invalid───2*[aio-dio-invalid]
├─check-parallel───nsexec───check───746───cp
├─check-parallel───nsexec───check───187───187
├─check-parallel───nsexec───check───027───8*[027]
├─check-parallel───nsexec───check───045───xfs_io───{xfs_io}
├─check-parallel───nsexec───check───044
├─check-parallel───nsexec───check───204
├─check-parallel───nsexec───check───186───186
├─check-parallel───nsexec───check───449
├─check-parallel───nsexec───check───231───su───fsx
├─check-parallel───nsexec───check───509
├─check-parallel───nsexec───check───127───5*[127───fsx]
├─check-parallel───nsexec───check───047
├─check-parallel───nsexec───check───043
├─check-parallel───nsexec───check───475───pkill
├─check-parallel───nsexec───check───299─┬─fio─┬─4*[fio]
│ │ ├─2*[fio───4*[{fio}]]
│ │ └─{fio}
│ └─pgrep
├─check-parallel───nsexec───check───551───aio-dio-write-v
├─check-parallel───nsexec───check───323───aio-last-ref-he───100*[{aio-last-ref-he}]
├─check-parallel───nsexec───check───648───sleep
├─check-parallel───nsexec───check───046
├─check-parallel───nsexec───check───753─┬─753.fsstress───4*[753.fsstress]
│ └─pkill
├─check-parallel───nsexec───check───507───507
├─check-parallel───nsexec───check───629─┬─3*[629───xfs_io───{xfs_io}]
│ └─5*[629]
├─check-parallel───nsexec───check───073───umount
├─check-parallel───nsexec───check───615───615
├─check-parallel───nsexec───check───176───punch-alternati
├─check-parallel───nsexec───check───294
├─check-parallel───nsexec───check───236───236
├─check-parallel───nsexec───check───165─┬─165─┬─165─┬─cut
│ │ │ └─xfs_io───{xfs_io}
│ │ └─165───grep
│ └─165
├─check-parallel───nsexec───check───259───sync
├─check-parallel───nsexec───check───442───442.fsstress───4*[442.fsstress───{442.fsstress}]
├─check-parallel───nsexec───check───558───255*[558]
├─check-parallel───nsexec───check───358───358───358
├─check-parallel───nsexec───check───169───169
└─check-parallel───nsexec───check───297─┬─297.fsstress─┬─284*[297.fsstress───{297.fsstress}]
│ └─716*[297.fsstress]
└─sleepA typical test run looks like:
$ time sudo ./check-parallel /mnt/xfs -s xfs -x dump Runner 63 Failures: xfs/170 Runner 36 Failures: xfs/050 Runner 30 Failures: xfs/273 Runner 29 Failures: generic/135 Runner 25 Failures: generic/603 Tests run: 1140 Failure count: 5
Ten slowest tests - runtime in seconds:
xfs/013 454
generic/707 414
generic/017 398
generic/387 395
generic/748 390
xfs/140 351
generic/562 351
generic/705 347
generic/251 344
xfs/016 343
Cleanup on Aisle 5?
total 0
crw-------. 1 root root 10, 236 Nov 27 09:27 control
lrwxrwxrwx. 1 root root 7 Nov 27 09:27 fast -> ../dm-0/dev/mapper/fast 1.4T 192G 1.2T 14% /mnt/xfs
real 9m29.056s user 0m0.005s sys 0m0.022s
$
Yeah, that runtime is real - under 10 minutes for a full XFS auto group test run. When running this normally (i.e. via check) on this machine, it usually takes just under 4 hours to run the same set of tests. i.e. I can run ./check-parallel roughly 25x times on this machine in the same time it takes to run ./check.
--- check | 7 +- check-parallel | 205 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 208 insertions(+), 4 deletions(-) create mode 100755 check-parallel
check +3 -4
@@ -33,7 +33,7 @@ exclude_tests=() _err_msg="" # start the initialisation work now -iam=check +iam=check.$$ # mkfs.xfs uses the presence of both of these variables to enable formerly # supported tiny filesystem configurations that fstests use for fuzz testing
@@ -460,7 +460,7 @@ fi _wrapup() { - seq="check" + seq="check.$$" check="$RESULT_BASE/check" $interrupt && sect_stop=`_wallclock`
@@ -552,7 +552,6 @@ _wrapup() sum_bad=`expr $sum_bad + ${#bad[*]}` _wipe_counters - rm -f /tmp/*.rawout /tmp/*.out /tmp/*.err /tmp/*.time if ! $OPTIONS_HAVE_SECTIONS; then rm -f $tmp.* fi
@@ -808,7 +807,7 @@ function run_section() init_rc - seq="check" + seq="check.$$" check="$RESULT_BASE/check" # don't leave old full output behind on a clean run
check-parallel new file +205 -0
205 lines not on this page · raw message
Signature · 1 line
2.45.2
PATCH 39/40 fstests: quota grace periods unreliable under load
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Starting the quota grace period doesn't necessary happen predictably when the system is under heavy load. This results in random test failures where grace period timeouts are expected.
--- tests/generic/601 | 7 ++++--- tests/xfs/050 | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-)
tests/generic/601 +4 -3
@@ -52,9 +52,10 @@ $XFS_QUOTA_PROG -x -c "timer -u -i 100 $qa_user" $SCRATCH_MNT # raw ("since epoch") grace expiry get=`repquota -up $SCRATCH_MNT | grep "^$qa_user" | awk '{print $NF}'` -# Either the new expiry must match; or be one second after the set time, to -# deal with the seconds counter incrementing. -if [ "$get" != "$set" ] && [ "$get" -ne "$((set + 1))" ]; then +# Either the new expiry must match or be soon after the set time as there +# may be load related delays on setting the new timer. A 10s "grace" window +# should be enough for everyone. +if [ "$get" != "$set" ] && [ "$get" -gt "$((set + 10))" ]; then echo "set grace to $set but got grace $get" fi
tests/xfs/050 +5 -0
@@ -115,6 +115,11 @@ _exercise() echo echo "*** push past the soft block limit" | tee -a $seqres.full _file_as_id $SCRATCH_MNT/softie $id $type $bsize 300 + + # sync so that the data is actually allocated as soft limit timers + # are not started until block allocation is done. This means the test + # will work even if remount sliently fails due to busy mounts + _scratch_sync _qmount $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \ -c "repquota -birnN -$type" $SCRATCH_DEV |
Signature · 1 line
2.45.2
PATCH 38/40 generic/062: don't leave debug files in $here on failure
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Move them to $seqres.<debug-file> so they don't pollute the source tree that fstests is running from.
--- tests/generic/062 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/generic/062 +1 -1
@@ -196,7 +196,7 @@ echo "*** compare before and after backups" diff $tmp.backup1 $tmp.backup2 if [ $? -ne 0 ]; then echo "urk, failed - creating $seq.backup1 and $seq.backup2" - cp $tmp.backup1 $seq.backup1 && cp $tmp.backup2 $seq.backup2 + cp $tmp.backup1 $seqres.backup1 && cp $tmp.backup2 $seqres.backup2 status=1 exit fi
Signature · 1 line
2.45.2
PATCH 36/40 fstests: capture some failures to seqres.full
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Whilst trying to debug test failures, I found a few places where errors needed to be redirected to $seqres.full rather than /dev/null. This is a collection of all the conversions that haven't been captured by some other bug fix patch.
Note that calling _check_filesystems() after removing the require_test/scratch files means it is a no-op, so I removed that call at the same time as capturing unmount failures after the test has failed.
--- check | 5 ++--- tests/generic/049 | 2 +- tests/generic/603 | 6 +++--- tests/xfs/495 | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-)
check +2 -3
@@ -1004,14 +1004,13 @@ function run_section() if [ $sts -ne 0 ]; then _dump_err_cont "[failed, exit status $sts]" - _test_unmount 2> /dev/null - _scratch_unmount 2> /dev/null + _test_unmount 2>> $seqres.full + _scratch_unmount 2>> $seqres.full rm -f ${RESULT_DIR}/require_test* rm -f ${RESULT_DIR}/require_scratch* # Even though we failed, there may be something interesting in # dmesg which can help debugging. _check_dmesg - (_adjust_oom_score 250; _check_filesystems) tc_status="fail" else # The test apparently passed, so check for corruption
tests/generic/049 +1 -1
@@ -56,7 +56,7 @@ i=1; while [ $i -lt 1000 ] do file=$SCRATCH_MNT/$i - $XFS_IO_PROG -f -c "pwrite -b 32k -S 0xff 0 32k" $file > /dev/null + $XFS_IO_PROG -f -c "pwrite -b 32k -S 0xff 0 32k" $file >> $seqres.full if [ $? -ne 0 ] then echo error creating/writing file $file
tests/generic/603 +3 -3
@@ -77,7 +77,7 @@ test_grace() _filter_xfs_io_error | tee -a $seqres.full repquota -v -$type $SCRATCH_MNT | grep -v "^root" >>$seqres.full 2>&1 # Reset grace time here, make below grace time test more accurate - setquota -$type $qa_user -T $bgrace $igrace $SCRATCH_MNT 2>/dev/null + setquota -$type $qa_user -T $bgrace $igrace $SCRATCH_MNT >>$seqres.full 2>&1 # Now sleep enough grace time and check that softlimit got enforced sleep $((bgrace + 1)) echo "Try to write 1 one more block after grace..."
@@ -89,13 +89,13 @@ test_grace() # And now the softlimit test for inodes # First reset space limits so that we don't have problems with # space reservations on XFS - setquota -$type $qa_user 0 0 3 100 $SCRATCH_MNT + setquota -$type $qa_user 0 0 3 100 $SCRATCH_MNT echo "Create 2 more files, over the inode softlimit..." su $qa_user -c "touch $dir/file3 $dir/file4" 2>&1 >>$seqres.full | \ _filter_scratch | tee -a $seqres.full repquota -v -$type $SCRATCH_MNT | grep -v "^root" >>$seqres.full 2>&1 # Reset grace time here, make below grace time test more accurate - setquota -$type $qa_user -T $bgrace $igrace $SCRATCH_MNT 2>/dev/null + setquota -$type $qa_user -T $bgrace $igrace $SCRATCH_MNT >>$seqres.full 2>&1 # Wait and check grace time enforcement sleep $((igrace+1)) echo "Try to create one more inode after grace..."
tests/xfs/495 +1 -1
@@ -24,7 +24,7 @@ _require_populate_commands _require_xfs_db_command "fuzz" echo "Format and populate" -_scratch_populate_cached nofill > $seqres.full 2>&1 +_scratch_populate_cached nofill >> $seqres.full 2>&1 filter_nbrepair() { grep rebuilding | sed -e 's/directory inode [0-9]*/directory inode XXX/g'
Signature · 1 line
2.45.2
PATCH 34/40 xfs/629: single extent files should be within tolerance
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
The test passes if we have between 2 and 40 extents (despite what the comment says!), with the target being 20. There is absolutely no reason for considering a single extent file a failure - that indicates the filesystem completely defeated the fragmentation behaviour the test was trying to cause. Hence expand the range of "test pass" tolerance to 1-41 extents.
--- tests/xfs/629 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tests/xfs/629 +2 -2
@@ -59,8 +59,8 @@ _scratch_sync for ((n=0; n<nfiles; n++)); do count=$(_count_extents $workfile.$n) - # Acceptible extent count range is 1-40 - _within_tolerance "file.$n extent count" $count 21 19 -v + # Acceptible extent count range is 1-41 + _within_tolerance "file.$n extent count" $count 21 20 -v done status=0
Signature · 1 line
2.45.2
PATCH 33/40 vfstests: some tests require the testdir to be shared
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
This ensures that these tests will run successfully when the parallel check infrastructure makes all the scratch and test mounts private.
--- tests/generic/589 | 2 ++ tests/generic/632 | 2 ++ 2 files changed, 4 insertions(+)
tests/generic/589 +2 -0
@@ -164,7 +164,9 @@ move_test() move_run unbindable private } +_mount --make-shared $TEST_DIR move_test +_mount --make-private $TEST_DIR # success, all done status=0
tests/generic/632 +2 -0
@@ -22,8 +22,10 @@ _begin_fstest auto quick mount _require_test _require_test_program "detached_mounts_propagation" +_mount --make-shared $TEST_DIR $here/src/detached_mounts_propagation $TEST_DIR >> $seqres.full status=$? +_mount --make-private $TEST_DIR echo silence is golden exit
Signature · 1 line
2.45.2
PATCH 23/40 dmesg: reduce noise from other tests
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
dmesg records everything from every test concurrently running, so noise from other tests can cause multiple other tests to fail because they detect something from another test. Update the filter behaviour to minimise this crosstalk problem.
`
--- common/rc | 13 +++++++------ tests/generic/310 | 5 +---- tests/xfs/079 | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-)
common/rc +7 -6
@@ -4591,6 +4591,7 @@ _check_dmesg_filter() grep -E -v -e "BUG: MAX_LOCKDEP_CHAIN_HLOCKS too low" \ -e "BUG: MAX_STACK_TRACE_ENTRIES too low" \ + -e "WARNING: Reset corrupted AGFL" \ $extra_filter }
@@ -4613,18 +4614,18 @@ _check_dmesg() fi rm -f ${RESULT_DIR}/check_dmesg - # default filter is a simple cat command, caller could provide a - # customized filter and pass the name through the first argument, to - # filter out intentional WARNINGs or Oopses - local filter=${1:-_check_dmesg_filter} + # we always filter dmesg for global things that should not cause + # test failures. Custom filters are then applied afterwards. + _dmesg_since_test_start | _check_dmesg_filter > $seqres.dmesg + if [ -n "$1" ]; then + cat $seqres.dmesg | $1 > $seqres.dmesg + fi - _dmesg_since_test_start | $filter >$seqres.dmesg grep -E -q -e "kernel BUG at" \ -e "WARNING:" \ -e "\bBUG:" \ -e "Oops:" \ -e "possible recursive locking detected" \ - -e "Internal error" \ -e "(INFO|ERR): suspicious RCU usage" \ -e "INFO: possible circular locking dependency detected" \ -e "general protection fault:" \
tests/generic/310 +1 -4
@@ -46,7 +46,6 @@ _require_test dmesg -c > /dev/null nr_bug=`dmesg | grep -c "kernel BUG"` -nr_error=`dmesg | grep -wc "error"` nr_null=`dmesg | grep -c "kernel NULL pointer dereference"` nr_warning=`dmesg | grep -c "^WARNING"` nr_lockdep=`dmesg | grep -c "possible recursive locking detected"`
@@ -55,20 +54,18 @@ nr_lockdep=`dmesg | grep -c "possible recursive locking detected"` check_kernel_bug() { new_bug=`dmesg | grep -c "kernel BUG"` - new_error=`dmesg | grep -wc "error"` new_null=`dmesg | grep -c "kernel NULL pointer dereference"` new_warning=`dmesg | grep -c "^WARNING"` new_lockdep=`dmesg | grep -c "possible recursive locking detected"` # no kernel bug is detected - if [ $new_bug -eq $nr_bug -a $new_error -eq $nr_error -a \ + if [ $new_bug -eq $nr_bug -a \ $new_null -eq $nr_null -a $new_warning -eq $nr_warning -a \ $new_lockdep -eq $nr_lockdep ]; then return 0 fi nr_bug=$new_bug - nr_error=$new_error nr_null=$new_null nr_warning=$new_warning nr_lockdep=$new_lockdep
tests/xfs/079 +1 -1
@@ -45,7 +45,7 @@ _try_scratch_mount "-o logbsize=64k" # The mount may not fail on v4 filesystems. Check for CRC mismatch warning # messages to detect failure in this case. -dmesg -c | grep XFS | grep CRC +_dmesg_since_test_start | grep "XFS $(_short_dev $SCRATCH_DEV)" | grep CRC # success, all done status=0
Signature · 1 line
2.45.2
PATCH 20/40 fstests: remove uses of killall where possible
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
there are many unnecessary uses of killall and stale checks for it's existence. Parallel check execution means killall is considered harmful, so get rid of these unneccesary uses.
--- common/config | 1 - common/fuzzy | 6 +++--- doc/requirement-checking.txt | 6 +++--- tests/btrfs/192 | 1 - tests/btrfs/212 | 2 -- tests/generic/270 | 1 - tests/generic/310 | 22 +++++++++++++++++----- tests/generic/751 | 1 - tests/overlay/058 | 12 ++++++++---- tests/xfs/011 | 1 - tests/xfs/013 | 1 - tests/xfs/051 | 1 - tests/xfs/057 | 1 - tests/xfs/070 | 9 +++++---- tests/xfs/079 | 1 - tests/xfs/141 | 1 - tests/xfs/167 | 3 --- tests/xfs/297 | 2 -- tests/xfs/442 | 1 - 19 files changed, 36 insertions(+), 37 deletions(-)
common/config +0 -1
@@ -182,7 +182,6 @@ export CHACL_PROG="$(type -P chacl)" export ATTR_PROG="$(type -P attr)" export QUOTA_PROG="$(type -P quota)" export XFS_QUOTA_PROG="$(type -P xfs_quota)" -export KILLALL_PROG="$(type -P killall)" export INDENT_PROG="$(type -P indent)" export XFS_COPY_PROG="$(type -P xfs_copy)" export FSTRIM_PROG="$(type -P fstrim)"
common/fuzzy +3 -3
@@ -1188,14 +1188,14 @@ _scratch_xfs_stress_scrub_cleanup() { # a race condition that can hang fstests. # # If the xfs_io -c freeze process is asleep waiting for a write lock on - # s_umount or sb_write when the killall signal is delivered, it will + # s_umount or sb_write when the kill signal is delivered, it will # not check for pending signals until after it has frozen the fs. If # even one thread of the stress test processes (xfs_io, fsstress, etc.) - # is waiting for read locks on sb_write when the killall signals are + # is waiting for read locks on sb_write when the kill signals are # delivered, they will block in the kernel until someone thaws the fs, # and the `wait' below will wait forever. # - # Hence we issue the killall, wait for the freezer loop to exit, thaw + # Hence we issue the kill, wait for the freezer loop to exit, thaw # the filesystem, and wait for the rest of the children. if [ -n "$__SCRUB_STRESS_FREEZE_PID" ]; then echo "Waiting for fs freezer $__SCRUB_STRESS_FREEZE_PID to exit at $(date)" >> $seqres.full
doc/requirement-checking.txt +3 -3
@@ -40,11 +40,11 @@ _require_command "$NAME_PROG" name should then be used to refer to the command when executing it. For example: - _require_command "KILLALL_PROG" killall + _require_command "$XFS_DB_PROG" "xfs_db" - to locate the killall command and then: + to locate the xfs_db command and then: - $KILLALL_PROG -q $FSSTRESS_PROG + $XFS_DB_PROG -c "sb 0" -c "print" $SCRATCH_DEV to make use of it.
tests/btrfs/192 +0 -1
@@ -27,7 +27,6 @@ _cleanup() . ./common/dmlogwrites -_require_command "$KILLALL_PROG" killall _require_command "$BLKDISCARD_PROG" blkdiscard _require_btrfs_fs_feature "no_holes" _require_btrfs_mkfs_feature "no-holes"
tests/btrfs/212 +0 -2
@@ -25,8 +25,6 @@ _cleanup() . ./common/filter _require_scratch -_require_command "$KILLALL_PROG" killall - _scratch_mkfs >> $seqres.full _scratch_mount
tests/generic/270 +0 -1
@@ -56,7 +56,6 @@ _workout() _require_quota _require_user _require_scratch -_require_command "$KILLALL_PROG" killall _require_command "$SETCAP_PROG" setcap _require_attrs security
tests/generic/310 +17 -5
@@ -29,14 +29,19 @@ _begin_fstest auto # Override the default cleanup function. _cleanup() { + if [ -n "$readdir_pid" ]; then + pkill --parent "$readdir_pid" t_readdir > /dev/null 2>&1 + kill -9 $readdir_pid > /dev/null 2>&1 + wait + fi rm -rf $TEST_DIR/tmp + rm -f $tmp.* } # Import common functions. . ./common/filter _require_test -_require_command "$KILLALL_PROG" killall dmesg -c > /dev/null
@@ -80,9 +85,12 @@ done _test_read() { - $here/src/t_readdir_1 $SEQ_DIR & + $here/src/t_readdir_1 $SEQ_DIR > /dev/null 2>&1 & + readdir_pid=$! sleep $RUN_TIME - $KILLALL_PROG t_readdir_1 + kill $readdir_pid + unset readdir_pid + wait check_kernel_bug if [ $? -ne 0 ]; then _fatal "kernel bug detected, check dmesg for more infomation."
@@ -91,9 +99,13 @@ _test_read() _test_lseek() { - $here/src/t_readdir_2 $SEQ_DIR & + $here/src/t_readdir_2 $SEQ_DIR > /dev/null 2>&1 & + readdir_pid=$! sleep $RUN_TIME - $KILLALL_PROG t_readdir_2 + kill $readdir_pid + unset readdir_pid + wait + check_kernel_bug if [ $? -ne 0 ]; then _fatal "kernel bug detected, check dmesg for more infomation."
tests/generic/751 +0 -1
@@ -80,7 +80,6 @@ fio_err=$tmp.fio.err _require_test _require_scratch _require_split_huge_pages_knob -_require_command "$KILLALL_PROG" "killall" _fixed_by_git_commit kernel 2a0774c2886d \ "XArray: set the marks correctly when splitting an entry"
tests/overlay/058 +8 -4
@@ -21,8 +21,10 @@ _begin_fstest auto quick exportfs # Override the default cleanup function. _cleanup() { - $KILLALL_PROG -9 open_by_handle >/dev/null 2>&1 - wait + if [ -n "$pids" ]; then + kill -9 $pids >/dev/null 2>&1 + wait + fi cd / rm -f $tmp.* }
@@ -36,7 +38,6 @@ _require_test_program "open_by_handle" # We need to require all features together, because nfs_export cannot # be enabled when index is disabled _require_scratch_overlay_features index nfs_export -_require_command "$KILLALL_PROG" killall # All overlay dirs are on scratch partition lower=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
@@ -89,9 +90,11 @@ test_file_handles $SCRATCH_MNT -rnp -i $tmp.lower_file_handles # overlay dentries in cache _scratch_cycle_mount "index=on,nfs_export=on" test_file_handles $SCRATCH_MNT -rnps -i $tmp.upper_file_handles & +pids=$! # Give the above 1 second to get to sleep loop sleep 1 test_file_handles $SCRATCH_MNT -rnps -i $tmp.lower_file_handles & +pids="$pids $!" # Give the above 1 second to get to sleep loop sleep 1
@@ -105,8 +108,9 @@ test_file_handles $SCRATCH_MNT -rnp -i $tmp.upper_file_handles test_file_handles $SCRATCH_MNT -rnp -i $tmp.lower_file_handles # SIGPIPE avoids Terminated/Killed message from bash -$KILLALL_PROG -q -13 open_by_handle +kill -13 $pids > /dev/null 2>&1 wait +unset pids status=0 exit
tests/xfs/011 +0 -1
@@ -14,7 +14,6 @@ _begin_fstest auto freeze log metadata quick _require_scratch _require_freeze _require_xfs_sysfs $(_short_dev $TEST_DEV)/log -_require_command "$KILLALL_PROG" killall . ./common/filter
tests/xfs/013 +0 -1
@@ -74,7 +74,6 @@ _cleaner() _require_scratch _require_xfs_mkfs_finobt _require_xfs_finobt -_require_command "$KILLALL_PROG" killall _scratch_mkfs_xfs "-m crc=1,finobt=1 -d agcount=2" | \ _filter_mkfs 2>> $seqres.full
tests/xfs/051 +0 -1
@@ -19,7 +19,6 @@ _begin_fstest shutdown auto log metadata _require_scratch _require_dm_target flakey _require_xfs_sysfs debug/log_recovery_delay -_require_command "$KILLALL_PROG" killall echo "Silence is golden."
tests/xfs/057 +0 -1
@@ -42,7 +42,6 @@ _cleanup() _require_xfs_io_error_injection log_item_pin _require_xfs_io_error_injection log_bad_crc _require_scratch -_require_command "$KILLALL_PROG" killall echo "Silence is golden."
tests/xfs/070 +5 -4
@@ -24,10 +24,10 @@ _begin_fstest auto quick repair # Override the default cleanup function. _cleanup() { + [ -n "$repair_pid" ] && kill -9 $repair_pid > /dev/null 2>&1 + wait > /dev/null 2>&1 cd / rm -f $tmp.* - $KILLALL_PROG -9 $XFS_REPAIR_PROG > /dev/null 2>&1 - wait > /dev/null 2>&1 } # Start and monitor an xfs_repair of the scratch device. This test can induce a
@@ -45,7 +45,8 @@ _xfs_repair_noscan() repair_pid=$! # monitor progress for as long as it is running - while [ `pgrep xfs_repair` ]; do + running=`pgrep xfs_repair` + while [ -n "$running" ]; do grep "couldn't verify primary superblock" $tmp.repair \ > /dev/null 2>&1 if [ $? == 0 ]; then
@@ -58,6 +59,7 @@ _xfs_repair_noscan() fi sleep 1 + running=`pgrep xfs_repair` done wait
@@ -72,7 +74,6 @@ _xfs_repair_noscan() # Modify as appropriate. _require_scratch_nocheck -_require_command "$KILLALL_PROG" killall _scratch_mkfs | _filter_mkfs > /dev/null 2> $tmp.mkfs
tests/xfs/079 +0 -1
@@ -23,7 +23,6 @@ _begin_fstest shutdown auto log quick # Modify as appropriate. _require_scratch _require_v2log -_require_command "$KILLALL_PROG" killall echo "Silence is golden."
tests/xfs/141 +0 -1
@@ -20,7 +20,6 @@ _begin_fstest auto log metadata # Modify as appropriate. _require_xfs_io_error_injection "log_bad_crc" _require_scratch -_require_command "$KILLALL_PROG" killall echo "Silence is golden."
tests/xfs/167 +0 -3
@@ -21,10 +21,7 @@ workout() # Import common functions. . ./common/filter - -_require_command "$KILLALL_PROG" killall _require_xfs_io_command "falloc" - _require_scratch _scratch_mkfs_xfs >/dev/null 2>&1 _scratch_mount
tests/xfs/297 +0 -2
@@ -24,10 +24,8 @@ _cleanup() # Import common functions. . ./common/filter - _require_scratch _require_freeze -_require_command "$KILLALL_PROG" killall logblks=$(_scratch_find_xfs_min_logblocks -d agcount=16,su=256k,sw=12 -l su=256k) _scratch_mkfs_xfs -d agcount=16,su=256k,sw=12 -l su=256k,size=${logblks}b >/dev/null 2>&1
tests/xfs/442 +0 -1
@@ -21,7 +21,6 @@ _begin_fstest auto stress clone quota _require_scratch_reflink _require_quota -_require_command "$KILLALL_PROG" "killall" report_quota_blocks() { $XFS_QUOTA_PROG -x -c "report $1" $SCRATCH_MNT | \
Signature · 1 line
2.45.2
PATCH 19/40 xfs/177: remove unused slab object count location checks
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Stale code; we count XFS inodes through the sysfs stats code now so remove it.
--- tests/xfs/177 | 7 ------- 1 file changed, 7 deletions(-)
tests/xfs/177 +0 -7
@@ -58,13 +58,6 @@ dump_debug_info() { echo "round $1 baseline: $baseline_count high: $high_count fresh: $fresh_count post: $post_count end: $end_count" >> $seqres.full } -# Either of these need to be available to monitor slab usage -xfs_ino_objcount_file=/sys/kernel/slab/xfs_inode/objects -slabinfo_file=/proc/slabinfo -if [ ! -r "$xfs_ino_objcount_file" ] && [ ! -r "$slabinfo_file" ]; then - _notrun "Cannot find xfs_inode slab count?" -fi - # Background reclamation of disused xfs inodes is scheduled for ($xfssyncd / 6) # centiseconds after the first inode is tagged for reclamation. It's not great # to encode this implementation detail in a test like this, but there isn't
Signature · 1 line
2.45.2
PATCH 16/40 fstests: use udevadm wait in preference to settle
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
When running lots of tests in parallel, there are lots of filesystems and block devices changing state. This generates a lot of udev events when means the udev event queue is rarely empty. Unfortunately, an empty event queue is what udev settling waits upon. Hence calling UDEV_SETTLE_PROG can mean waiting for a lot of time for other tests to stop generating udev events.
For the majority of cases, what we care about is that udev has performed device node addition or removal, not that there are no udev events pending. Recent(-ish) systemd releases support 'udevadm wait' to wait for a specific file to be created or unlinked rather than waiting for the event that does that work to be completed.
Hence we don't have to wait for the udev event queue to empty, just for the udev event that does the device node manipulation to complete.
Introduce detection of 'udevadm wait' support and a _udev_wait() wrapper function to use it if it is available. If it isn't, the use the existing UDEV_SETTLE_PROG behaviour.
--- common/config | 35 +++++++++++++++++++++++++---------- common/rc | 25 ++++++++++++++++--------- tests/btrfs/291 | 5 +++-- tests/generic/081 | 6 +++--- tests/generic/108 | 7 +++---- tests/generic/459 | 6 +++--- 6 files changed, 53 insertions(+), 31 deletions(-)
common/config +25 -10
@@ -165,7 +165,7 @@ export XFS_MDRESTORE_PROG="$(type -P xfs_mdrestore)" export XFS_ADMIN_PROG="$(type -P xfs_admin)" export XFS_GROWFS_PROG=$(type -P xfs_growfs) export XFS_SPACEMAN_PROG="$(type -P xfs_spaceman)" -export XFS_SCRUB_PROG="$(type -P xfs_scrub)" +#export XFS_SCRUB_PROG="$(type -P xfs_scrub)" export XFS_PARALLEL_REPAIR_PROG="$(type -P xfs_prepair)" export XFS_PARALLEL_REPAIR64_PROG="$(type -P xfs_prepair64)" export __XFSDUMP_PROG="$(type -P xfsdump)"
@@ -236,18 +236,30 @@ export BTRFS_MAP_LOGICAL_PROG=$(type -P btrfs-map-logical) export PARTED_PROG="$(type -P parted)" export XFS_PROPERTY_PROG="$(type -P xfs_property)" -# use 'udevadm settle' or 'udevsettle' to wait for lv to be settled. -# newer systems have udevadm command but older systems like RHEL5 don't. -# But if neither one is available, just set it to "sleep 1" to wait for lv to -# be settled -UDEV_SETTLE_PROG="$(type -P udevadm)" -if [ "$UDEV_SETTLE_PROG" == "" ]; then - # try udevsettle command +# udev wait functions. +# +# This is how we wait for udev to create or remove device nodes after running a +# device create/remove command for logical volumes (e.g. lvm or dm). +# +# We can wait for the udev queue to empty via "settling". This, however, has +# major issues when running tests in parallel - the udev queue takes a long time +# to reach empty state. Hence if we have udev > 2.51 installed we use device +# waiting instead. This waits for the device node to appear/disappear rather +# than waiting for the udev queue to empty. +# +# If none of these methods are available, fall back to a simple delay (sleep 1) +# and hope this is sufficient. +UDEVADM_PROG="$(type -P udevadm)" +if [ -z "$UDEVADM_PROG" ]; then UDEV_SETTLE_PROG="$(type -P udevsettle)" else - # udevadm is available, add 'settle' as subcommand - UDEV_SETTLE_PROG="$UDEV_SETTLE_PROG settle" + UDEV_SETTLE_PROG="$UDEVADM_PROG settle" + $UDEVADM_PROG help | grep -q "Wait for device or device symlink" + if [ $? -eq 0 ]; then + UDEV_WAIT_PROG="$UDEVADM_PROG wait" + fi fi + # neither command is available, use sleep 1 # # Udev events are sent via netlink to userspace through
@@ -258,8 +270,11 @@ fi # exist or always be 0. We check for /proc/net to see CONFIG_NET was enabled. if [[ "$UDEV_SETTLE_PROG" == "" || ! -d /proc/net ]]; then UDEV_SETTLE_PROG="sleep 1" + unset UDEV_WAIT_PROG fi export UDEV_SETTLE_PROG +export UDEVADM_PROG +export UDEV_WAIT_PROG # Set MODPROBE_PATIENT_RM_TIMEOUT_SECONDS to "forever" if you want the patient # modprobe removal to run forever trying to remove a module.
common/rc +16 -9
@@ -5191,22 +5191,29 @@ _require_label_get_max() dummy=$(_label_get_max) } +_udev_wait() +{ + local args="$*" + + if [ -z "$UDEV_WAIT_PROG" ]; then + $UDEV_SETTLE_PROG >/dev/null 2>&1 + else + $UDEV_WAIT_PROG $args + fi +} + _dmsetup_remove() { - $UDEV_SETTLE_PROG >/dev/null 2>&1 - $DMSETUP_PROG remove --retry "$@" >>$seqres.full 2>&1 - $UDEV_SETTLE_PROG >/dev/null 2>&1 + [ $# -le 0 ] && return + + $DMSETUP_PROG remove --deferred "$@" >>$seqres.full 2>&1 + _udev_wait --removed /dev/mapper/$1 } _dmsetup_create() { - # Wait for udev to settle so that the dm creation doesn't fail because - # some udev subprogram opened one of the block devices mentioned in the - # table string w/ O_EXCL. Do it again at the end so that an immediate - # device open won't also fail. - $UDEV_SETTLE_PROG >/dev/null 2>&1 $DMSETUP_PROG create "$@" >>$seqres.full 2>&1 || return 1 - $UDEV_SETTLE_PROG >/dev/null 2>&1 + _udev_wait /dev/mapper/$1 } _require_btime()
tests/btrfs/291 +3 -2
@@ -21,6 +21,7 @@ _cleanup() cd / _log_writes_cleanup &> /dev/null $LVM_PROG vgremove -f -y $vgname >>$seqres.full 2>&1 + _udev_wait --removed /dev/mapper/$vgname-$lvname losetup -d $loop_dev >>$seqres.full 2>&1 rm -f $img _restore_fsverity_signatures
@@ -106,7 +107,7 @@ snap_dev=/dev/mapper/vg_replay-$snapname $LVM_PROG vgcreate -f $vgname $loop_dev >>$seqres.full 2>&1 || _fail "failed to vgcreate $vgname" $LVM_PROG lvcreate -L "$replay_bytes"B -n $lvname $vgname -y >>$seqres.full 2>&1 || \ _fail "failed to lvcreate $lvname" -$UDEV_SETTLE_PROG >>$seqres.full 2>&1 +_udev_wait /dev/mapper/$vgname-$lvname replay_log_prog=$here/src/log-writes/replay-log num_entries=$($replay_log_prog --log $LOGWRITES_DEV --num-entries)
@@ -125,7 +126,7 @@ do $LVM_PROG lvcreate -s -L 4M -n $snapname $vgname/$lvname >>$seqres.full 2>&1 || \ _fail "Failed to create snapshot" - $UDEV_SETTLE_PROG >>$seqres.full 2>&1 + _udev_wait /dev/mapper/$vgname-$snapname orphan=$(count_item $snap_dev ORPHAN) [ $state -eq 0 ] && [ $orphan -gt 0 ] && state=1
tests/generic/081 +3 -3
@@ -38,7 +38,7 @@ _cleanup() $LVM_PROG vgremove -f $vgname >>$seqres.full 2>&1 $LVM_PROG pvremove -f $SCRATCH_DEV >>$seqres.full 2>&1 pv_ret=$? - $UDEV_SETTLE_PROG + _udev_wait --removed /dev/mapper/$vgname-$lvname test $pv_ret -eq 0 && break sleep 2 done
@@ -70,8 +70,8 @@ $LVM_PROG vgcreate -f $vgname $SCRATCH_DEV >>$seqres.full 2>&1 # We use yes pipe instead of 'lvcreate --yes' because old version of lvm # (like 2.02.95 in RHEL6) don't support --yes option yes | $LVM_PROG lvcreate -L ${lvsize}M -n $lvname $vgname >>$seqres.full 2>&1 -# wait for lvcreation to fully complete -$UDEV_SETTLE_PROG >>$seqres.full 2>&1 +_udev_wait /dev/mapper/$vgname-$lvname + # _mkfs_dev exits the test on failure, this can make sure lv is created in # above vgcreate/lvcreate steps
tests/generic/108 +3 -4
@@ -20,8 +20,8 @@ _cleanup() echo running > /sys/block/`_short_dev $SCSI_DEBUG_DEV`/device/state _unmount $SCRATCH_MNT >>$seqres.full 2>&1 $LVM_PROG vgremove -f $vgname >>$seqres.full 2>&1 - $LVM_PROG pvremove -f $SCRATCH_DEV $SCSI_DEBUG_DEV >>$seqres.full 2>&1 - $UDEV_SETTLE_PROG + pvremove -f $SCRATCH_DEV $SCSI_DEBUG_DEV >>$seqres.full 2>&1 + _udev_wait --removed /dev/mapper/$vgname-$lvname _put_scsi_debug_dev rm -f $tmp.* }
@@ -57,8 +57,7 @@ $LVM_PROG vgcreate -f $vgname $SCSI_DEBUG_DEV $SCRATCH_DEV >>$seqres.full 2>&1 # (like 2.02.95 in RHEL6) don't support --yes option yes | $LVM_PROG lvcreate -i 2 -I 4m -L ${lvsize}m -n $lvname $vgname \ >>$seqres.full 2>&1 -# wait for lv creation to fully complete -$UDEV_SETTLE_PROG >>$seqres.full 2>&1 +_udev_wait /dev/mapper/$vgname-$lvname # _mkfs_dev exits the test on failure, this makes sure test lv is created by # above vgcreate/lvcreate operations
tests/generic/459 +3 -3
@@ -31,7 +31,7 @@ _cleanup() _unmount $SCRATCH_MNT >>$seqres.full 2>&1 $LVM_PROG vgremove -ff $vgname >>$seqres.full 2>&1 $LVM_PROG pvremove -ff $SCRATCH_DEV >>$seqres.full 2>&1 - $UDEV_SETTLE_PROG + _udev_wait --removed /dev/mapper/$vgname-$lvname } # Import common functions.
@@ -88,8 +88,7 @@ $LVM_PROG lvcreate --thinpool $poolname --errorwhenfull y \ $LVM_PROG lvcreate --virtualsize $virtsize \ -T $vgname/$poolname \ -n $lvname >>$seqres.full 2>&1 - -$UDEV_SETTLE_PROG &>/dev/null +_udev_wait /dev/mapper/$vgname-$lvname _mkfs_dev /dev/mapper/$vgname-$lvname >>$seqres.full 2>&1 # Running the test over the original volume doesn't reproduce the problem
@@ -97,6 +96,7 @@ _mkfs_dev /dev/mapper/$vgname-$lvname >>$seqres.full 2>&1 # reproducible, so, create a snapshot and run the test over it. $LVM_PROG lvcreate -k n -s $vgname/$lvname \ -n $snapname >>$seqres.full 2>&1 +_udev_wait /dev/mapper/$vgname-$snapname # Catch mount failure so we don't blindly go an freeze the root filesystem # instead of lvm volume.
Signature · 1 line
2.45.2
PATCH 30/40 fstests: don't use directory stacks
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Using bash directory stacking (pushd, popd, etc) seems to be somewhat unreliable. I've been seeing occasional random failures from both pushd and popd commands that cause the test to fail, and there does not appear to be any reason for the failures occurring.
Rather than wasting time chasing ghosts, just get rid of the directory stacking altogether.
--- tests/generic/099 | 8 +++----- tests/generic/109 | 5 +---- tests/generic/135 | 24 +++++++++++------------- tests/generic/707 | 7 ++++--- 4 files changed, 19 insertions(+), 25 deletions(-)
tests/generic/099 +3 -5
@@ -253,15 +253,13 @@ echo "" echo "=== Recursive change ACL ===" rm -fr root mkdir root -pushd root >/dev/null # create an arbitrary little tree -for i in 1 2 3 4 5 6 7 8 9 0 -do +( cd root ; for i in 1 2 3 4 5 6 7 8 9 0; do mkdir -p a/$i mkdir -p b/c$i/$i touch a/$i/mumble -done -popd >/dev/null +done ) + chown -R 12345:54321 root echo "Change #1..." _runas -u 12345 -g 54321 -- chacl -r u::rwx,g::-w-,o::--x root
tests/generic/109 +1 -4
@@ -54,10 +54,7 @@ _scratch_mount >> $seqres.full 2>&1 # Test different directory sizes to test various directory formats for f in 1 2 3 4 5 8 12 18 27 40 60 90 135 202 303 454 681 1020 1530 2295; do mkdir $SCRATCH_MNT/dir$f - pushd $SCRATCH_MNT/dir$f >/dev/null - filldir $f - renamedir - popd >/dev/null + ( cd $SCRATCH_MNT/dir$f ; filldir $f ; renamedir ) done status=0
tests/generic/135 +11 -13
@@ -21,30 +21,28 @@ _scratch_mount cd $SCRATCH_MNT # create file with async I/O -$XFS_IO_PROG -f -c 'pwrite -b 4k -S 0x12 0 4k' async_file > /dev/null +$XFS_IO_PROG -f -c 'pwrite -b 4k -S 0x12 0 4k' $SCRATCH_MNT/async_file > /dev/null # create file with sync I/O -$XFS_IO_PROG -f -s -c 'pwrite -b 4k -S 0x34 0 4k' sync_file > /dev/null +$XFS_IO_PROG -f -s -c 'pwrite -b 4k -S 0x34 0 4k' $SCRATCH_MNT/sync_file > /dev/null # create file with direct I/O -$XFS_IO_PROG -f -d -c 'pwrite -b 4k -S 0x56 0 4k' direct_file > /dev/null +$XFS_IO_PROG -f -d -c 'pwrite -b 4k -S 0x56 0 4k' $SCRATCH_MNT/direct_file > /dev/null # create file, truncate and then dirty again -$XFS_IO_PROG -f -c 'pwrite -b 4k -S 0x78 0 4k' trunc_file > /dev/null -$XFS_IO_PROG -f -c 'truncate 2k' trunc_file > /dev/null -$XFS_IO_PROG -c 'pwrite 1k 0 1k' trunc_file > /dev/null +$XFS_IO_PROG -f -c 'pwrite -b 4k -S 0x78 0 4k' $SCRATCH_MNT/trunc_file > /dev/null +$XFS_IO_PROG -f -c 'truncate 2k' $SCRATCH_MNT/trunc_file > /dev/null +$XFS_IO_PROG -c 'pwrite 1k 0 1k' $SCRATCH_MNT/trunc_file > /dev/null -pushd / > /dev/null _scratch_cycle_mount -popd > /dev/null # check file size and contents -od -Ad -x async_file -od -Ad -x sync_file -od -Ad -x direct_file -od -Ad -x trunc_file +od -Ad -x $SCRATCH_MNT/async_file +od -Ad -x $SCRATCH_MNT/sync_file +od -Ad -x $SCRATCH_MNT/direct_file +od -Ad -x $SCRATCH_MNT/trunc_file -rm -f async_file sync_file direct_file trunc_file +rm -f $SCRATCH_MNT/* status=0 exit
tests/generic/707 +4 -3
@@ -42,7 +42,7 @@ create_files() # We use slightly longer file name to make directory grow faster and # hopefully convert between various types for (( i = 0; i < $files; i++ )); do - touch somewhatlongerfilename$i + echo -n > somewhatlongerfilename$i done }
@@ -50,12 +50,13 @@ for (( i = 0; i <= $moves; i++ )); do mkdir $SCRATCH_MNT/dir$i done +start_dir=$PWD for (( l = 0; l < $loops; l++ )); do mkdir $SCRATCH_MNT/dir0/dir - pushd $SCRATCH_MNT/dir0/dir &>/dev/null + cd $SCRATCH_MNT/dir0/dir create_files & BGPID=$! - popd &>/dev/null + cd $start_dir for (( i = 0; i < $moves; i++ )); do mv $SCRATCH_MNT/dir$i/dir $SCRATCH_MNT/dir$((i+1))/dir done
Signature · 1 line
2.45.2
PATCH 15/40 fstests: mark tests that are unreliable when run in parallel
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Add a group named "unreliable_in_parallel" to mark tests that do not give reliable results when multiple tests are run in parallel. Generally this happens with tests that are reliant on caching in some way, such as generating specific file layouts using buffered IO or expecting inodes to be cached in memory. These are perturbed by other tests running sync(), generating memory pressure, dropping caches, etc.
Hence whether these tests pass or fail is wholly dependent on what tests are running at the same time, and hence randomly fail when nothing has actually gone wrong. Hence they are unreliable as regression tests when running tests in parallel, so we add them to the "unreliable_in_parallel" group and a parallel check can exclude this group.
As tests are updated to be robust against external interference, they can be removed from the unreliable_in_parallel group.
--- doc/group-names.txt | 1 + tests/generic/336 | 7 ++++++- tests/generic/561 | 8 +++++++- tests/xfs/177 | 8 ++++++-- tests/xfs/232 | 6 +++++- tests/xfs/237 | 8 +++++++- tests/xfs/243 | 7 +++++-- tests/xfs/300 | 8 ++++++-- tests/xfs/440 | 6 +++++- tests/xfs/527 | 5 ++++- tests/xfs/631 | 7 ++++++- tests/xfs/802 | 7 ++++++- 12 files changed, 64 insertions(+), 14 deletions(-)
doc/group-names.txt +1 -0
@@ -138,6 +138,7 @@ trim FITRIM ioctl udf UDF functionality tests union tests from the unionmount test suite unlink O_TMPFILE unlinked files +unreliable_in_parallel randomly fail when run in parallel with other tests unshare fallocate FALLOC_FL_UNSHARE_RANGE v2log XFS v2 log format tests verity fsverity
tests/generic/336 +6 -1
@@ -9,8 +9,13 @@ # file F2 from directory B into directory C, fsync inode F1, power fail and # remount the filesystem, file F2 exists and is located only in directory C. # + +# unreliable_in_parallel: external sync operations can change what is synced to +# the log before the flakey device drops writes. hence post-remount file +# contents can be different to what the test expects. + . ./common/preamble -_begin_fstest auto quick metadata log +_begin_fstest auto quick metadata log unreliable_in_parallel # Override the default cleanup function. _cleanup()
tests/generic/561 +7 -1
@@ -7,8 +7,14 @@ # Dedup & random I/O race test, do multi-threads fsstress and dedupe on # same directory/files # + +# unreliable_in_parallel: duperemove is buggy. It can get stuck in endless +# fiemap mapping loops, and this seems to happen a *lot* when the system is +# under heavy load. when they do this, they don't die when they are supposed to +# and so have to be manually killed to end the test. + . ./common/preamble -_begin_fstest auto stress dedupe +_begin_fstest auto stress dedupe unreliable_in_parallel # Override the default cleanup function. _cleanup()
tests/xfs/177 +6 -2
@@ -21,9 +21,13 @@ # Regrettably, there is no way to poke /only/ XFS inode reclamation directly, # so we're stuck with setting xfssyncd_centisecs to a low value and sleeping # while watching the internal inode cache counters. -# + +# unreliable_in_parallel: cache residency is affected by external drop caches +# operations. Hence counting inodes "in cache" often does not reflect what the +# test has actually done. + . ./common/preamble -_begin_fstest auto ioctl +_begin_fstest auto ioctl unreliable_in_parallel _cleanup() {
tests/xfs/232 +5 -1
@@ -12,8 +12,12 @@ # - Wait for the reclaim to run. # - Write more and see how bad fragmentation is. # + +# unreliable_in_parallel: external sync operations affect what happens while +# the test is waiting for COW expiration. + . ./common/preamble -_begin_fstest auto quick clone fiemap prealloc +_begin_fstest auto quick clone fiemap prealloc unreliable_in_parallel # Override the default cleanup function. _cleanup()
tests/xfs/237 +7 -1
@@ -6,8 +6,14 @@ # # Test AIO DIO CoW behavior when the write temporarily fails. # + +# unreliable_in_parallel: external drop caches can co-incide with the error +# table being loaded, so the test being run fails with EIO trying to load the +# inode from disk instead of whatever operation it is supposed to fail on when +# the inode is already cached in memory. + . ./common/preamble -_begin_fstest auto quick clone eio +_begin_fstest auto quick clone eio unreliable_in_parallel # Override the default cleanup function. _cleanup()
tests/xfs/243 +5 -2
@@ -15,9 +15,12 @@ # 5. delalloc # - CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. -# + +# unreliable_in_parallel: external sync can affect the layout of the files being +# created, results in unreliable detection of delalloc extents. + . ./common/preamble -_begin_fstest auto quick clone punch prealloc +_begin_fstest auto quick clone punch prealloc unreliable_in_parallel # Import common functions. . ./common/filter
tests/xfs/300 +6 -2
@@ -5,9 +5,13 @@ # FS QA Test No. 300 # # Test xfs_fsr / exchangerange management of di_forkoff w/ selinux -# + +# unreliable_in_parallel: file layout appears to be perturbed by load related +# timing issues. Not 100% sure, but the backwards write does not reliably +# fragment the source file under heavy external load + . ./common/preamble -_begin_fstest auto fsr +_begin_fstest auto fsr unreliable_in_parallel # Import common functions. . ./common/filter
tests/xfs/440 +5 -1
@@ -8,8 +8,12 @@ # a file that has CoW reservations and no dirty pages. The reservations # should shift over to the new owner, but they do not. # + +# unreliable_in_parallel: external sync(1) and/or drop caches can reclaim inodes +# and free post-eof space, resulting in lower than expected block counts. + . ./common/preamble -_begin_fstest auto quick clone quota +_begin_fstest auto quick clone quota unreliable_in_parallel # Import common functions. . ./common/reflink
tests/xfs/527 +4 -1
@@ -14,8 +14,11 @@ # xfs: fix incorrect root dquot corruption error when switching group/project # quota types +# unreliable_in_parallel: dmesg check can pick up corruptions from other tests. +# Need to filter corruption reports by short scratch dev name. + . ./common/preamble -_begin_fstest auto quick quota +_begin_fstest auto quick quota unreliable_in_parallel # Import common functions. . ./common/quota
tests/xfs/631 +6 -1
@@ -7,8 +7,13 @@ # Post-EOF preallocation defeat test for direct I/O with extent size hints. # +# unreliable_in_parallel: external cache drops can result in the extent size +# being truncated as the inode is evicted from cache between writes. This can +# increase the number of extents significantly beyond what would be expected +# from the extent size hint. + . ./common/preamble -_begin_fstest auto quick prealloc rw +_begin_fstest auto quick prealloc rw unreliable_in_parallel . ./common/filter
tests/xfs/802 +6 -1
@@ -8,8 +8,13 @@ # filesystem, and that we can read the health reports after the fact. IOWs, # this is basic testing for the systemd background services. # + +# unreliable_in_parallel: this appears to try to run scrub services on all +# mounted filesystems - that's aproblem when there are a hundred other test +# filesystems mounted running other tests... + . ./common/preamble -_begin_fstest auto scrub +_begin_fstest auto scrub unreliable_in_parallel _cleanup() {
Signature · 1 line
2.45.2
PATCH 29/40 generic/085: general cleanup for reliability and debugging
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
This test was quite unreliable during development of the parallel check runner. It redirects all errors to /dev/null, so there was no way to debug it when it failed.
Use common mount/unmount helpers, redirect errors to $seqres.full, make sure the cleanup code is always run at test exit and only attempt to kill processes if they are still running during cleanup.
--- tests/generic/085 | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
tests/generic/085 +12 -9
@@ -16,18 +16,20 @@ _begin_fstest auto freeze mount # Override the default cleanup function. _cleanup() { + cleanup_dmdev cd / rm -f $tmp.* - cleanup_dmdev } cleanup_dmdev() { + if [ -n "$pid" ]; then + kill -9 $pid 2>> $seqres.full + wait $pid 2>> $seqres.full + fi # in case it's still suspended and/or mounted - $DMSETUP_PROG resume $lvdev >/dev/null 2>&1 - [ -n "$pid" ] && kill -9 $pid 2>/dev/null - wait $pid - _unmount $lvdev >/dev/null 2>&1 + $DMSETUP_PROG resume $lvdev >> $seqres.full 2>&1 + _unmount -q $SCRATCH_MNT _dmsetup_remove $node }
@@ -64,18 +66,19 @@ setup_dmdev # important, as long as they're racing with each other. So just throw away the # outputs and ignore the results. for ((i=0; i<100; i++)); do - $DMSETUP_PROG suspend $lvdev >/dev/null 2>&1 - $DMSETUP_PROG resume $lvdev >/dev/null 2>&1 + $DMSETUP_PROG suspend $lvdev >> $seqres.full 2>&1 + $DMSETUP_PROG resume $lvdev >> $seqres.full 2>&1 done & pid=$! for ((i=0; i<100; i++)); do - _mount $lvdev $SCRATCH_MNT >/dev/null 2>&1 - _unmount $lvdev >/dev/null 2>&1 + _mount $lvdev $SCRATCH_MNT >> $seqres.full 2>&1 + _unmount $lvdev >> $seqres.full 2>&1 done & pid="$pid $!" wait $pid unset pid +cleanup_dmdev status=0 exit
Signature · 1 line
2.45.2
PATCH 9/40 fstests: per-test dmdelay instances
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
We can't run two tests that use dmdelay at the same time because the device name is the same. hence they interfere with each other. Give dmdelay devices their own per-test names to avoid this problem.
--- common/dmdelay | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
common/dmdelay +11 -9
@@ -7,13 +7,15 @@ DELAY_NONE=0 DELAY_READ=1 +export DELAY_NAME="delay-test.$seq" + _init_delay() { local BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV` - DELAY_DEV=/dev/mapper/delay-test + DELAY_DEV=/dev/mapper/$DELAY_NAME DELAY_TABLE="0 $BLK_DEV_SIZE delay $SCRATCH_DEV 0 0" DELAY_TABLE_RDELAY="0 $BLK_DEV_SIZE delay $SCRATCH_DEV 0 10000 $SCRATCH_DEV 0 0" - _dmsetup_create delay-test --table "$DELAY_TABLE" || \ + _dmsetup_create $DELAY_NAME --table "$DELAY_TABLE" || \ _fatal "failed to create delay device" }
@@ -33,9 +35,9 @@ _cleanup_delay() { # If dmsetup load fails then we need to make sure to do resume here # otherwise the umount will hang - $DMSETUP_PROG resume delay-test > /dev/null 2>&1 + $DMSETUP_PROG resume $DELAY_NAME > /dev/null 2>&1 $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 - _dmsetup_remove delay-test + _dmsetup_remove $DELAY_NAME } # _load_delay_table <table> [lockfs]
@@ -52,15 +54,15 @@ _load_delay_table() # run a suspend/resume cycle to avoid excessive resume delays once a # delay is introduced below - $DMSETUP_PROG suspend $suspend_opt delay-test - $DMSETUP_PROG resume $suspend_opt delay-test + $DMSETUP_PROG suspend $suspend_opt $DELAY_NAME + $DMSETUP_PROG resume $suspend_opt $DELAY_NAME - $DMSETUP_PROG suspend $suspend_opt delay-test + $DMSETUP_PROG suspend $suspend_opt $DELAY_NAME [ $? -ne 0 ] && _fatal "failed to suspend delay-test" - $DMSETUP_PROG load delay-test --table "$table" + $DMSETUP_PROG load $DELAY_NAME --table "$table" [ $? -ne 0 ] && _fatal "failed to load table into delay-test" - $DMSETUP_PROG resume delay-test + $DMSETUP_PROG resume $DELAY_NAME [ $? -ne 0 ] && _fatal "failed to resume delay-test" }
Signature · 1 line
2.45.2
PATCH 27/40 filter: handle mount errors from CONFIG_BLK_DEV_WRITE_MOUNTED=y
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Kernels post 6.x may have CONFIG_BLK_DEV_WRITE_MOUNTED=y which prevents mount from opening the block device on a mounted filesystem. This results in an error such as:
mount: <dev>: Can't open blockdev
which is not the error that callers of _filter_error_mount() are looking for. It is, however, a direct result of the test trying to mount an alreayd mounted filesystem, so it is reflecting the same error case. Hence this mismatch in errors should not fail the test.
Catch this mount error and convert it to the expected "already mounted" error for the tests that exercise this behaviour.
There is also a minor test change here to push mount failure information to $seqres.full in the cases where mount errors occur.
--- common/filter | 8 +++++++- tests/xfs/154 | 1 + 2 files changed, 8 insertions(+), 1 deletion(-)
common/filter +7 -1
@@ -430,6 +430,10 @@ _filter_ro_mount() { # v2.38 and later: # dmesg(1) may have more information after failed mount mount system call # +# Kernels post 6.x may have CONFIG_BLK_DEV_WRITE_MOUNTED=y which prevents mount +# from opening the block device on a mounted filesytsem: +# mount: <dev>: Can't open blockdev +# # This is also true for ESTALE error. So let's remove all the changing parts # and keep the 'prior to v2.21' format: # mount: Structure needs cleaning
@@ -437,7 +441,9 @@ _filter_ro_mount() { _filter_error_mount() { grep -v "dmesg(1) may have more information after failed mount" | \ - sed -e "s/mount:\(.*failed:\)/mount:/" | _filter_ending_dot + sed -e "s/mount:\(.*failed:\)/mount:/" \ + -e "s/mount: SCRATCH_DEV: Can't open blockdev/mount: TEST_DIR\/extra_mnt: SCRATCH_DEV already mounted or mount point busy/" |\ + _filter_ending_dot } # Similar to _filter_error_mount, filter a busy mount output.
tests/xfs/154 +1 -0
@@ -46,6 +46,7 @@ test $? -eq 137 || echo "repair should have been killed??" _check_scratch_xfs_features NEEDSREPAIR _try_scratch_mount &> $tmp.mount res=$? +cat $tmp.mount >> $seqres.full _filter_error_mount < $tmp.mount if [ $res -eq 0 ]; then echo "Should not be able to mount after needsrepair crash"
Signature · 1 line
2.45.2
PATCH 21/40 generic/127: reduce runtime
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
...
generic/127 684
...
This takes a long time to run because it runs 6 individual invocations of fsx sequentially. Make them run concurrently as they can operate on separate files.
...
generic/127 168
...
--- tests/generic/127 | 67 ++++++++++++++++++++++++++----------------- tests/generic/127.out | 6 ---- 2 files changed, 41 insertions(+), 32 deletions(-)
tests/generic/127 +41 -26
@@ -16,7 +16,10 @@ _begin_fstest rw auto # Override the default cleanup function. _cleanup() { - rm -f $tmp.output + [ -n "$fsx_pids" ] && kill $fsx_pids 2> /dev/null + wait + cd / + rm -f $tmp.* } # Import common functions.
@@ -27,7 +30,6 @@ FSX_ARGS="-q -l $FSX_FILE_SIZE -o 65536 -S 191110531 -N 100000" _fsx_lite_nommap() { - echo "=== FSX Light Mode, No Memory Mapping ===" dd if=/dev/zero of=$TEST_DIR/fsx_lite_nommap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1 if ! ltp/fsx $FSX_ARGS -L -R -W $FSX_AVOID $TEST_DIR/fsx_lite_nommap > $tmp.output 2>&1 then
@@ -41,7 +43,6 @@ _fsx_lite_nommap() _fsx_lite_mmap() { - echo "=== FSX Light Mode, Memory Mapping ===" dd if=/dev/zero of=$TEST_DIR/fsx_lite_mmap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1 if ! ltp/fsx $FSX_ARGS -L $FSX_AVOID $TEST_DIR/fsx_lite_mmap > $tmp.output 2>&1 then
@@ -55,42 +56,56 @@ _fsx_lite_mmap() _fsx_std_nommap() { - echo "=== FSX Standard Mode, No Memory Mapping ===" - if ! ltp/fsx $FSX_ARGS -R -W $FSX_AVOID $TEST_DIR/fsx_std_nommap > $tmp.output 2>&1 - then - echo "ltp/fsx $FSX_ARGS -R -W fsx_std_nommap" - cat $tmp.output - return 1 - fi - cat $tmp.output - return 0 + local fname="$TEST_DIR/$1" + + if ! ltp/fsx $FSX_ARGS -R -W $FSX_AVOID $fname > $tmp.output 2>&1 + then + echo "ltp/fsx $FSX_ARGS -R -W fsx_std_nommap" + cat $tmp.output + return 1 + fi + cat $tmp.output + return 0 } _fsx_std_mmap() { - echo "=== FSX Standard Mode, Memory Mapping ===" - if ! ltp/fsx $FSX_ARGS $FSX_AVOID $TEST_DIR/fsx_std_mmap > $tmp.output 2>&1 - then - echo "ltp/fsx $FSX_ARGS fsx_std_mmap" + local fname="$TEST_DIR/$1" + + if ! ltp/fsx $FSX_ARGS $FSX_AVOID $fname > $tmp.output 2>&1 + then + echo "ltp/fsx $FSX_ARGS fsx_std_mmap" + cat $tmp.output + return 1 + fi cat $tmp.output - return 1 - fi - cat $tmp.output - return 0 + return 0 } _require_test -_fsx_lite_nommap || exit -_fsx_lite_mmap || exit +_fsx_lite_nommap & +fsx_pids=$! -_fsx_std_nommap || exit -_fsx_std_mmap || exit +_fsx_lite_mmap & +fsx_pids="$! $fsx_pids" + +_fsx_std_nommap fsx_std_nommap & +fsx_pids="$! $fsx_pids" + +_fsx_std_mmap fsx_std_mmap & +fsx_pids="$! $fsx_pids" #flush cache after write FSX_ARGS="-f $FSX_ARGS" -_fsx_std_nommap || exit -_fsx_std_mmap || exit +_fsx_std_nommap fsx_std_nommap_flush & +fsx_pids="$! $fsx_pids" + +_fsx_std_mmap fsx_std_mmap_flush & +fsx_pids="$! $fsx_pids" + +wait $fsx_pids +unset fsx_pids status=0 _cleanup
tests/generic/127.out +0 -6
@@ -1,13 +1,7 @@ QA output created by 127 -=== FSX Light Mode, No Memory Mapping === All 100000 operations completed A-OK! -=== FSX Light Mode, Memory Mapping === All 100000 operations completed A-OK! -=== FSX Standard Mode, No Memory Mapping === All 100000 operations completed A-OK! -=== FSX Standard Mode, Memory Mapping === All 100000 operations completed A-OK! -=== FSX Standard Mode, No Memory Mapping === All 100000 operations completed A-OK! -=== FSX Standard Mode, Memory Mapping === All 100000 operations completed A-OK!
Signature · 1 line
2.45.2
PATCH 25/40 fstests: scale some tests for high CPU count sanity
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Several tests use lots of processes to stress the filesystem. many of them haven't really considered what this means for running the test on high CPU machines (e.g. >32p) and the potential contention and performance issues this might trigger.
Some of these tests simply need to increase the size of the journal. Some need to run on filesystems with high inherent concurrency (e.g. larger AG count). Some need more efficient/faster file creation. And so on.
This commit is a collection of those sorts of changes to improve runtimes on high CPU count machines.
--- src/aio-dio-regress/aio-last-ref-held-by-io.c | 5 ++++- tests/generic/251 | 5 ++++- tests/generic/323 | 7 +++++-- tests/generic/530 | 2 +- tests/generic/531 | 8 +++++++- tests/xfs/013 | 4 ++-- tests/xfs/076 | 6 +++--- tests/xfs/176 | 6 +++--- tests/xfs/297 | 4 +++- tests/xfs/501 | 2 +- tests/xfs/502 | 2 +- 11 files changed, 34 insertions(+), 17 deletions(-)
src/aio-dio-regress/aio-last-ref-held-by-io.c +4 -1
@@ -85,11 +85,14 @@ aio_test_thread(void *data)/* * Problems have been easier to trigger when spreading the * workload over the available CPUs. +* +* If CPU hotplug is active, this can randomly fail so dump the error +* to stderror so it can be filtered out easily by the caller. */ CPU_ZERO (&cpuset);CPU_SET (mycpu, &cpuset);if (sched_setaffinity (mytid,sizeof (cpuset), &cpuset)) { -printf ("FAILED to set thread %d to run on cpu %ld\n" , +fprintf (stderr,"FAILED to set thread %d to run on cpu %ld\n" , mytid, mycpu); }
tests/generic/251 +4 -1
@@ -175,9 +175,12 @@ nproc=20 # Copy $here to the scratch fs and make coipes of the replica. The fstests # output (and hence $seqres.full) could be in $here, so we need to snapshot # $here before computing file checksums. +# +# $here/* as the files to copy so we avoid any .git directory that might be +# much, much larger than the rest of the fstests source tree we are copying. content=$SCRATCH_MNT/orig mkdir -p $content -cp -axT $here/ $content/ +cp -ax $here/* $content/ mkdir -p $tmp
tests/generic/323 +5 -2
@@ -23,12 +23,15 @@ _require_aiodio aio-last-ref-held-by-io testfile=$TEST_DIR/aio-testfile $XFS_IO_PROG -ftc "pwrite 0 10m" $testfile | _filter_xfs_io -$AIO_TEST 0 100 $testfile +# This can emit cpu affinity setting failures that aren't considered test +# failures but cause golden image failures. Redirect the test output to +# $seqres.full so that it is captured but doesn't directly cause test failures. +$AIO_TEST 0 100 $testfile 2>> $seqres.full if [ $? -ne 0 ]; then exit $status fi -$AIO_TEST 1 100 $testfile +$AIO_TEST 1 100 $testfile 2>> $seqres.full if [ $? -ne 0 ]; then exit $status fi
tests/generic/530 +1 -1
@@ -22,7 +22,7 @@ _require_scratch_shutdown _require_metadata_journaling _require_test_program "t_open_tmpfiles" -_scratch_mkfs >> $seqres.full 2>&1 +_scratch_mkfs "-l size=256m" >> $seqres.full 2>&1 _scratch_mount # Set ULIMIT_NOFILE to min(file-max / 2, 50000 files per LOAD_FACTOR)
tests/generic/531 +7 -1
@@ -21,7 +21,13 @@ _require_scratch _require_xfs_io_command "-T" _require_test_program "t_open_tmpfiles" -_scratch_mkfs >> $seqres.full 2>&1 +# On high CPU count machines, this runs a -lot- of create and unlink +# concurrency. Set the filesytsem up to handle this. +if [ $FSTYP = "xfs" ]; then + _scratch_mkfs "-d agcount=32" >> $seqres.full 2>&1 +else + _scratch_mkfs >> $seqres.full 2>&1 +fi _scratch_mount # Try to load up all the CPUs, two threads per CPU.
tests/xfs/013 +2 -2
@@ -28,7 +28,7 @@ _create() mkdir -p $dir for i in $(seq 0 $count) do - touch $dir/$i 2>&1 | filter_enospc + echo -n > $dir/$i 2>&1 | filter_enospc done }
@@ -42,7 +42,7 @@ _rand_replace() do file=$((RANDOM % count)) rm -f $dir/$file - touch $dir/$file 2>&1 | filter_enospc + echo -n > $dir/$file 2>&1 | filter_enospc done }
tests/xfs/076 +3 -3
@@ -47,10 +47,10 @@ _alloc_inodes() dir=$1 i=0 - while [ true ]; do - touch $dir/$i 2>> $seqres.full || break + ( while [ true ]; do + echo -n > $dir/$i || break i=$((i + 1)) - done + done ) >> $seqres.full 2>&1 }
tests/xfs/176 +3 -3
@@ -68,10 +68,10 @@ _alloc_inodes() dir=$1 i=0 - while [ true ]; do - echo -n > $dir/$i >> $seqres.full 2>&1 || break + ( while [ true ]; do + echo -n > $dir/$i || break i=$((i + 1)) - done + done ) >> $seqres.full 2>&1 } # Find a sparse inode cluster after logend_agno/logend_agino.
tests/xfs/297 +3 -1
@@ -34,7 +34,9 @@ _scratch_mount STRESS_DIR="$SCRATCH_MNT/testdir" mkdir -p $STRESS_DIR -_run_fsstress_bg -d $STRESS_DIR -n 1000 -p 1000 $FSSTRESS_AVOID +# turn off sync as this can lead to near deadlock conditions due to every +# fsstress process lockstepping against freeze on large CPU count machines +_run_fsstress_bg -d $STRESS_DIR -f sync=0 -n 1000 -p 1000 $FSSTRESS_AVOID # Freeze/unfreeze file system randomly echo "Start freeze/unfreeze randomly" | tee -a $seqres.full
tests/xfs/501 +1 -1
@@ -33,7 +33,7 @@ _require_xfs_sysfs debug/log_recovery_delay _require_scratch _require_test_program "t_open_tmpfiles" -_scratch_mkfs >> $seqres.full 2>&1 +_scratch_mkfs "-l size=256m" >> $seqres.full 2>&1 _scratch_mount # Set ULIMIT_NOFILE to min(file-max / 2, 30000 files per LOAD_FACTOR)
tests/xfs/502 +1 -1
@@ -23,7 +23,7 @@ _require_xfs_io_error_injection "iunlink_fallback" _require_scratch _require_test_program "t_open_tmpfiles" -_scratch_mkfs | _filter_mkfs 2> $tmp.mkfs > /dev/null +_scratch_mkfs "-l size=256m" | _filter_mkfs 2> $tmp.mkfs > /dev/null cat $tmp.mkfs >> $seqres.full . $tmp.mkfs
Signature · 1 line
2.45.2
PATCH 28/40 filters: add a filter that accepts EIO instead of other errors
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Running a dm-flakey or dm-error test that loads a table that returns EIO to all IO and then running a command that is expected to fail with a specific error is racy.
If there is memory pressure at the same time that the table is loaded, cached inodes can be turfed from memory and the command then needs to read the inode it is about to act on from disk again. This results in the inode read getting EIO and failing (e.g. xfs_io will return a stat() error) rather than having the desired operation fail.
This results in spurious test failures that look like this:
generic/331 - output mismatch (see /mnt/xfs/runner-41/results-2024-11-20-10:57:31/xfs/generic/331.out.bad)
--- tests/generic/331.out 2022-12-21 15:53:25.487044098 +1100
+++ /mnt/xfs/runner-41/results-2024-11-20-10:57:31/xfs/generic/331.out.bad 2024-11-20 11:02:12.123572607 +1100
@@ -5,7 +5,8 @@
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-331/file1
1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-331/file2
CoW and unmount
-fdatasync: Input/output error
+/mnt/xfs/runner-41/scratch/test-331/file2: Input/output error
+stat: Input/output error
Compare files
...Add a new "flakey EIO filter" that will catch -any- EIO error from the command and change it to the error we expected to see.
--- common/filter | 9 +++++++++ tests/btrfs/160 | 3 ++- tests/generic/252 | 3 ++- tests/generic/329 | 3 ++- tests/generic/331 | 5 +++-- tests/generic/484 | 3 ++- tests/generic/743 | 4 +++- tests/xfs/237 | 3 ++- tests/xfs/240 | 5 +++-- 9 files changed, 28 insertions(+), 10 deletions(-)
common/filter +9 -0
@@ -662,5 +662,14 @@ _filter_trailing_whitespace() sed -E -e "s/\s+$//" } +# Catch -any- EIO error regardless of it's source and replace it with the +# supplied error message. +_filter_flakey_EIO() +{ + local message="$*" + + sed -e "s#.*: Input\/output error#$message#" +} + # make sure this script returns success /bin/true
tests/btrfs/160 +2 -1
@@ -66,7 +66,8 @@ _dmerror_load_working_table # open again and call fsync echo "The following fsync should fail with EIO:" -$XFS_IO_PROG -c fsync $testfile +$XFS_IO_PROG -c fsync $testfile |& \ + _filter_flakey_EIO "fsync: Input/output error" echo "done" # close file
tests/generic/252 +2 -1
@@ -66,7 +66,8 @@ $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full _scratch_sync _dmerror_load_error_table -$AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full +$AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 |& \ + _filter_flakey_EIO "write missed bytes expect 8388608 got 0" _dmerror_load_working_table _dmerror_unmount _dmerror_mount
tests/generic/329 +2 -1
@@ -59,7 +59,8 @@ $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full _scratch_sync _dmerror_load_error_table -$AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full +$AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 |& \ + _filter_flakey_EIO "write missed bytes expect 8388608 got 0" _dmerror_load_working_table _dmerror_unmount _dmerror_mount
tests/generic/331 +3 -2
@@ -59,8 +59,9 @@ $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full _scratch_sync _dmerror_load_error_table -$AIO_TEST -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full -$XFS_IO_PROG -c "fdatasync" $testdir/file2 +$AIO_TEST -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full 2>&1 +$XFS_IO_PROG -c "fdatasync" $testdir/file2 |& \ + _filter_flakey_EIO "fdatasync: Input/output error" _dmerror_load_working_table _dmerror_unmount _dmerror_mount
tests/generic/484 +2 -1
@@ -54,7 +54,8 @@ $XFS_IO_PROG -c "pwrite -W -q 0 $datalen" $testfile _dmerror_load_error_table # rewrite the data and call fdatasync -$XFS_IO_PROG -c "pwrite -w -q 0 $datalen" $testfile +$XFS_IO_PROG -c "pwrite -w -q 0 $datalen" $testfile |& \ + _filter_flakey_EIO "fdatasync: Input/output error" # heal the device error _dmerror_load_working_table
tests/generic/743 +3 -1
@@ -21,6 +21,7 @@ _cleanup() } # Import common functions. +. ./common/filter . ./common/dmerror _fixed_by_kernel_commit 631426ba1d45 \
@@ -55,7 +56,8 @@ _dmerror_mount stat "$SCRATCH_MNT/a" >> $seqres.full echo read with IO errors _dmerror_load_error_table -$TIMEOUT_PROG -s KILL 10s $XFS_IO_PROG -c "mmap -r 0 $filesz" -c "madvise -R 0 $filesz" "$SCRATCH_MNT/a" +$TIMEOUT_PROG -s KILL 10s $XFS_IO_PROG -c "mmap -r 0 $filesz" -c "madvise -R 0 $filesz" "$SCRATCH_MNT/a" |& \ + _filter_flakey_EIO "madvise: Bad address" _dmerror_load_working_table # success, all done
tests/xfs/237 +2 -1
@@ -68,7 +68,8 @@ $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full _scratch_sync _dmerror_load_error_table -$AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full +$AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 |& \ + _filter_flakey_EIO "write missed bytes expect 8388608 got 0" _dmerror_load_working_table _dmerror_unmount _dmerror_mount
tests/xfs/240 +3 -2
@@ -64,8 +64,9 @@ $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full _scratch_sync _dmerror_load_error_table -$AIO_TEST -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full -$XFS_IO_PROG -c "fdatasync" $testdir/file2 +$AIO_TEST -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full 2>&1 +$XFS_IO_PROG -c "fdatasync" $testdir/file2 |& \ + _filter_flakey_EIO "fdatasync: Input/output error" _dmerror_load_working_table _dmerror_unmount _dmerror_mount
Signature · 1 line
2.45.2
PATCH 17/40 xfs/442: rescale load so it's not exponential
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
....
xfs/442 491
....
xfs/442 takes a long time to run because it is scaling the load by the number of processes it is going to run on twice. It scales the number of operations by the number of processes it is going to run, meaning that doubling the number of processes quadruples the runtime.
Reduce it to scale linearly by fixing the number of ops it runs per process.
--- tests/xfs/442 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/xfs/442 +1 -1
@@ -63,7 +63,7 @@ _scratch_mkfs_sized $((1600 * 1048576)) > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 nr_cpus=$((LOAD_FACTOR * 4)) -nr_ops=$((25000 * nr_cpus * TIME_FACTOR)) +nr_ops=$((25000 * TIME_FACTOR)) _run_fsstress -w -d $SCRATCH_MNT -n $nr_ops -p $nr_cpus echo "Check quota before remount"
Signature · 1 line
2.45.2
PATCH 18/40 xfs/176: fix broken setup code
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
The test does not pass the mkfs output through the mkfs filter, so the inode size is not set up correctly. Hence it calculates the CHUNK_SIZE as 0, and it ends up getting stuck in an endless loop throwing ENOSPC errors because the offset never changes.
While there, use 'echo -n' rather than 'touch' to create zero length files much faster.
--- tests/xfs/176 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tests/xfs/176 +2 -2
@@ -21,7 +21,7 @@ _require_scratch_xfs_shrink _require_xfs_io_command "falloc" _require_xfs_io_command "fpunch" -_scratch_mkfs "-d size=50m -m crc=1 -i sparse" | +_scratch_mkfs "-d size=50m -m crc=1 -i sparse" | \ _filter_mkfs > /dev/null 2> $tmp.mkfs . $tmp.mkfs # for isize cat $tmp.mkfs >> $seqres.full
@@ -69,7 +69,7 @@ _alloc_inodes() i=0 while [ true ]; do - touch $dir/$i 2>> $seqres.full || break + echo -n > $dir/$i >> $seqres.full 2>&1 || break i=$((i + 1)) done }
Signature · 1 line
2.45.2
PATCH 31/40 fstests: clean up a couple of dm-flakey tests
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Just little things I've found that should be cleaned up.
--- tests/generic/066 | 3 +++ tests/generic/321 | 4 +++- tests/xfs/051 | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-)
tests/generic/066 +3 -0
@@ -24,6 +24,7 @@ _begin_fstest auto quick attr metadata log _cleanup() { _cleanup_flakey + cd / rm -f $tmp.* }
@@ -88,5 +89,7 @@ _flakey_drop_and_remount echo "xattr names and values after second fsync log replay:" _getfattr --absolute-names --dump $SCRATCH_MNT/foobar | _filter_scratch +_unmount_flakey + status=0 exit
tests/generic/321 +3 -1
@@ -13,6 +13,8 @@ _begin_fstest auto quick metadata log _cleanup() { _cleanup_flakey + cd / + rm -f $tmp.* } # Import common functions.
@@ -57,7 +59,7 @@ _rename_test() $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/bar $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/bar/foo - _flakey_drop_and_remount\ + _flakey_drop_and_remount _ls_l $SCRATCH_MNT | tail -n +2 | awk '{ print $1, $9 }' _ls_l $SCRATCH_MNT/bar | tail -n +2 | awk '{ print $1, $9 }'
tests/xfs/051 +7 -0
@@ -11,6 +11,13 @@ . ./common/preamble _begin_fstest shutdown auto log metadata +_cleanup() +{ + _cleanup_flakey + cd / + rm -f $tmp.* +} + # Import common functions. . ./common/dmflakey
Signature · 1 line
2.45.2
PATCH 22/40 quota: system project quota files need to be shared
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Tests that treat them as exclusively owned end up tripping over other tests that do the same. Fix this by using append and filter techniques to update the files, then using different project quota ids for each test.
--- common/quota | 35 +++++++---------------------------- tests/generic/603 | 8 +++++--- tests/generic/691 | 6 ++++-- 3 files changed, 16 insertions(+), 33 deletions(-)
common/quota +7 -28
@@ -274,7 +274,7 @@ _choose_prid() _qmount() { - _scratch_unmount >/dev/null 2>&1 + _scratch_unmount _try_scratch_mount || _fail "qmount failed" # xfs doesn't need these setups and quotacheck even fails on xfs # redirect the output to $seqres.full for debug purpose and ignore results
@@ -432,39 +432,18 @@ _create_project_quota() mkdir $prjdir chmod ugo+rwx $prjdir - if [ -f /etc/projects -a ! -f $tmp.projects.bk ];then - cat /etc/projects > $tmp.projects.bk - echo >/etc/projects - fi - if [ -f /etc/projid -a ! -f $tmp.projid.bk ];then - cat /etc/projid > $tmp.projid.bk - echo >/etc/projid - fi - - cat >>/etc/projects <<EOF -$id:$prjdir -EOF - cat >>/etc/projid <<EOF -$name:$id -EOF + echo "$id:$prjdir" >> /etc/project + echo "$name:$id" >> /etc/projid $XFS_IO_PROG -r -c "chproj $id" -c "chattr +P" $prjdir } # If you've called _create_project_quota, then use this function in _cleanup _restore_project_quota() { - if [ -f $tmp.projects.bk ];then - cat $tmp.projects.bk > /etc/projects && \ - rm -f $tmp.projects.bk - else - rm -f /etc/projects - fi - if [ -f $tmp.projid.bk ];then - cat $tmp.projid.bk > /etc/projid && \ - rm -f $tmp.projid.bk - else - rm -f /etc/projid - fi + local id=$1 + + sed -i "/^$id:/d" /etc/project + sed -i "/:$id$/d" /etc/projid } # make sure this script returns success
tests/generic/603 +5 -3
@@ -10,10 +10,12 @@ . ./common/preamble _begin_fstest auto quick quota +projid=$seq + # Override the default cleanup function. _cleanup() { - _restore_project_quota + _restore_project_quota $projid cd / rm -f $tmp.* }
@@ -122,8 +124,8 @@ _require_prjquota $SCRATCH_DEV BLOCK_SIZE=$(_get_file_block_size $SCRATCH_MNT) rm -rf $SCRATCH_MNT/t mkdir $SCRATCH_MNT/t -$XFS_IO_PROG -r -c "chproj 100" -c "chattr +P" $SCRATCH_MNT/t -_create_project_quota $SCRATCH_MNT/t 100 $qa_user +$XFS_IO_PROG -r -c "chproj $projid" -c "chattr +P" $SCRATCH_MNT/t +_create_project_quota $SCRATCH_MNT/t $projid $qa_user echo "### Set up different grace timers to each type of quota" UBGRACE=12
tests/generic/691 +4 -2
@@ -16,10 +16,12 @@ . ./common/preamble _begin_fstest auto quota +projid=$seq + # Override the default cleanup function. _cleanup() { - _restore_project_quota + _restore_project_quota $projid cd / rm -r -f $tmp.* }
@@ -65,7 +67,7 @@ exercise() fi _qmount if [ "$type" = "P" ];then - _create_project_quota $SCRATCH_MNT/t 100 $qa_user + _create_project_quota $SCRATCH_MNT/t $projid $qa_user file=$SCRATCH_MNT/t/testfile fi
Signature · 1 line
2.45.2
PATCH 32/40 fstests: clean up termination of various tests
In reply to Dave ChinnerFrom: Dave Chinner <[email protected]>
Accumulated minor fixes to improve reliablity of the termination of various tests when interrupted.
--- tests/generic/084 | 12 +++++++++--- tests/generic/464 | 10 +++++----- tests/generic/650 | 8 ++++---- tests/xfs/013 | 1 + tests/xfs/558 | 1 + 5 files changed, 20 insertions(+), 12 deletions(-)
tests/generic/084 +9 -3
@@ -12,6 +12,15 @@ . ./common/preamble _begin_fstest auto metadata quick +_cleanup() +{ + [ -n "$link_pids" ] && kill $link_pids + [ -n "$open_pid" ] && kill $open_pid + wait + cd / + rm -f $tmp.* +} + # Import common functions. . ./common/filter
@@ -57,9 +66,6 @@ done & sleep 5 kill $! >/dev/null 2>&1 -kill $open_pid $link_pids >/dev/null 2>&1 -wait $open_pid $link_pids - # all done, no oops/hang expected, _check_filesystems checks SCRATCH_DEV after test status=0 exit
tests/generic/464 +5 -5
@@ -66,22 +66,22 @@ _scratch_mount # for each operation and runs for $LOOP_TIME seconds, and check filesystem # consistency after each iteration for i in `seq 1 $LOOP_CNT`; do - rm -f $stop + touch $stop for j in `seq 1 $PROC_CNT`; do - while [ ! -e $stop ]; do + while [ -e $stop ]; do do_write done & - while [ ! -e $stop ]; do + while [ -e $stop ]; do do_append done & - while [ ! -e $stop ]; do + while [ -e $stop ]; do do_writeback done & done sleep $LOOP_TIME - touch $stop + rm -f $stop wait _scratch_unmount
tests/generic/650 +4 -4
@@ -52,8 +52,6 @@ nr_hotplug_cpus="${#hotplug_cpus[@]}" test "$nr_hotplug_cpus" -gt 0 || _notrun "CPU hotplugging not supported" stress_dir="$TEST_DIR/$seq" -rm -r -f "$stress_dir" -mkdir -p "$stress_dir" echo "Silence is golden."
@@ -79,12 +77,14 @@ fsstress_args+=(--duration="$((SOAK_DURATION / 10))") nr_ops=$((2500 * TIME_FACTOR)) fsstress_args+=(-n $nr_ops) for ((i = 0; i < 10; i++)); do - _run_fsstress_bg -w "${fsstress_args[@]}" - _wait_for_fsstress + rm -rf "$stress_dir" + mkdir -p "$stress_dir" + _run_fsstress "${fsstress_args[@]}" _test_cycle_mount done rm -f $sentinel_file +wait # success, all done status=0
tests/xfs/013 +1 -0
@@ -120,6 +120,7 @@ _kill_fsstress # clean out the competing fsstress allocations, then everything else rm -rf $SCRATCH_MNT/fsstress rm -rf $SCRATCH_MNT/dir* +wait _scratch_unmount
tests/xfs/558 +1 -0
@@ -193,6 +193,7 @@ wait_for_errortag & $XFS_IO_PROG -c "pwrite -S 0x56 $((2 * blksz)) $((2 * blksz))" \ -c 'fsync' $SCRATCH_MNT/file >> $seqres.full rm -f $sentryfile +wait cat "$tracefile" >> $seqres.full grep -q iomap_invalid "$tracefile"
Signature · 1 line
2.45.2