]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commit
generic/558: avoid forkbombs on filesystems with many free inodes
authorDarrick J. Wong <djwong@kernel.org>
Wed, 19 Jul 2023 01:10:47 +0000 (18:10 -0700)
committerZorro Lang <zlang@kernel.org>
Sun, 23 Jul 2023 04:56:22 +0000 (12:56 +0800)
commitd28912bad3c00b3a0303d1b62fbbe97c44c578a8
tree2c58f09e3c7090d5f4ddc37cbcb44d730cfeee5d
parent1cd6b612992a59d1a20bcd2c1f072e79ccd6dd60
generic/558: avoid forkbombs on filesystems with many free inodes

Mikulas reported that this test became a forkbomb on his system when he
tested it with bcachefs.  Unlike XFS and ext4, which have large inodes
consuming hundreds of bytes, bcachefs has very tiny ones.  Therefore, it
reports a large number of free inodes on a freshly mounted 1GB fs (~15
million), which causes this test to try to create 15000 processes.

There's really no reason to do that -- all this test wanted to do was to
exhaust the number of inodes as quickly as possible using all available
CPUs, and then it ran xfs_repair to try to reproduce a bug.  Set the
number of subshells to 4x the CPU count and spread the work among them
instead of forking thousands of processes.

Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Tested-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/558