[PATCH] generic/558: limit the number of spawned subprocesses

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



When I run the test 558 on bcachefs, it works like a fork-bomb and kills
the machine. The reason is that the "while" loop spawns "create_file"
subprocesses faster than they are able to complete.

This patch fixes the crash by limiting the number of subprocesses to 128.

Signed-off-by: Mikulas Patocka <mpatocka@xxxxxxxxxx>

---
 tests/generic/558 |    1 +
 1 file changed, 1 insertion(+)

Index: xfstests-dev/tests/generic/558
===================================================================
--- xfstests-dev.orig/tests/generic/558
+++ xfstests-dev/tests/generic/558
@@ -48,6 +48,7 @@ echo "Create $((loop * file_per_dir)) fi
 while [ $i -lt $loop ]; do
 	create_file $SCRATCH_MNT/testdir $file_per_dir $i >>$seqres.full 2>&1 &
 	let i=$i+1
+	if [ $((i % 128)) = 0 ]; then wait; fi
 done
 wait
 




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux