Subject: Re: [PATCH net 2/3] netdevsim: fib: Add debugfs knob to simulate route deletion failure

From: David Ahern <[email-masked]>
Date: Thu, 28 Jul 2022 08:51:34 -0600

On 7/28/22 5:45 AM, Ido Schimmel wrote:
> The previous patch ("netdevsim: fib: Fix reference count leak on route
> deletion failure") fixed a reference count leak that happens on route
> deletion failure.
> 
> Such failures can only be simulated by injecting slab allocation
> failures, which cannot be surgically injected.

One option is CONFIG_FAULT_INJECTION, labeling functions with
ALLOW_ERROR_INJECTION and writing tests to set the fail_function. Been
very convenient for testing cleanup paths.

That said, I am not against this option.
> 
> In order to be able to specifically test this scenario, add a debugfs
> knob that allows user space to fail route deletion requests when
> enabled.
> 
> Signed-off-by: Ido Schimmel <[email-masked]>
> Reviewed-by: Amit Cohen <[email-masked]>
> ---
>  drivers/net/netdevsim/fib.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 

Reviewed-by: David Ahern <[email-masked]>