Re: [PATCH] fault-inject: use a shared initialization helper for the random state
From: Andrew Morton
Date: Thu Nov 12 2026 - 21:33:15 EST
On Thu, 12 Nov 2026 23:46:34 +0900 Sang-Heon Jeon <ekffu200098@xxxxxxxxx> wrote:
> fault_rnd_state can be seeded from setup_fault_attr(),
> fault_create_debugfs_attr() and fault_config_init(), and each of them
> uses its own guard. Configuring fault injection in more than one way
> leads to useless reseeding.
>
> To prevent this, use a shared initialization helper fault_random_init()
> in all three places. So fault_rnd_state is seeded only once per boot.
Thanks, that looks nice.
Generally, fault-injection doesn't see to get used very much, and the
huge number of AI-generated you-messed-up-error-handling reports we're
receiving show the cost of that.
syskaller can use it and those people have shown some
interesting/useful results from its use.
I have a side-project going where I get the LLM to drive patch testing
on a local test machine. The AI looks at the patches, figures out test
plans then controls their execution. One of the many things I'm
telling it do is to fault-inject every error path which the patchset(s)
add. It seems to do this quite well. So I'm a big user of
fault-injection now.
I'm hoping that I can also make it use kcov: use coverage
instrumentation to verify that all code which the patchset added or
altered has been runtime testing.
But oh my, it's soooooooooo slooooooooooooow. It does really
impressive testing, but I need to make it run 10x faster :(