Re: [PATCH v8 05/12] test_sysfs: add support to use kernfs failure injection

Luis Chamberlain
2021-10-11T20:56:29Z

On Tue, Oct 05, 2021 at 12:51:33PM -0700, Kees Cook wrote:
> On Mon, Sep 27, 2021 at 09:37:58AM -0700, Luis Chamberlain wrote:
> > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> > index a29b7d398c4e..176b822654e5 100644
> > --- a/lib/Kconfig.debug
> > +++ b/lib/Kconfig.debug
> > @@ -2358,6 +2358,9 @@ config TEST_SYSFS
> > depends on SYSFS
> > depends on NET
> > depends on BLOCK
> > + select FAULT_INJECTION
> > + select FAULT_INJECTION_DEBUG_FS
> > + select FAIL_KERNFS_KNOBS
>
> I don't like seeing "select" for user-configurable CONFIGs -- things
> tend to end up weird. This should simply be:
>
> depends on FAIL_KERNFS_KNOBS

Sure.

> > diff --git a/lib/test_sysfs.c b/lib/test_sysfs.c
> > index 2043ca494af8..c6e62de61403 100644
> > --- a/lib/test_sysfs.c
> > +++ b/lib/test_sysfs.c
> > @@ -38,6 +38,11 @@
> > #include <linux/rtnetlink.h>
> > #include <linux/genhd.h>
> > #include <linux/blkdev.h>
> > +#include <linux/kernfs.h>
> > +
> > +#ifdef CONFIG_FAIL_KERNFS_KNOBS
>
> This isn't an optional config here (and following)?

Sure with the above change this is no longer needed. Removed all that
ifdef'ery.

Luis