Re: [PATCH v2] fault-inject: rust: add a Rust API for fault-injection

From: Miguel Ojeda

Date: Sat Jun 06 2026 - 08:59:02 EST


Hi Andreas,

Some quick comments scanning your patch diagonally since I was here
for something else.

On Fri, Jun 5, 2026 at 3:27 PM Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
>
> #include <linux/ethtool.h>
> #include <linux/fdtable.h>
> +#include <linux/fault-inject.h>
> #include <linux/file.h>

Please keep them sorted :)

> +// SAFETY: FaultConfig can be used from any task.

`FaultConfig`

> + // SAFETY: By type invariant, self is always valid.

`self`

> + /// Returns `true` if the operation should fail.

[`true`]

> + // INVARIANT: `self.inner` is initialized in ffi_init.

I was going to say `ffi_init`, but there is no such call here. Isn't
it getting initialized by the C side? I guess this got copy-pasted
from somewhere else?

Cheers,
Miguel