diff mbox series

tools/testing/nvdimm: Fix compilation failure without CONFIG_DEV_DAX_PMEM_COMPAT

Message ID 20200123154720.12097-1-jack@suse.cz (mailing list archive)
State Mainlined
Commit c0e71d602053e4e7637e4bc7d0bc9603ea77a33f
Headers show
Series tools/testing/nvdimm: Fix compilation failure without CONFIG_DEV_DAX_PMEM_COMPAT | expand

Commit Message

Jan Kara Jan. 23, 2020, 3:47 p.m. UTC
When a kernel is configured without CONFIG_DEV_DAX_PMEM_COMPAT, the
compilation of tools/testing/nvdimm fails with:

  Building modules, stage 2.
  MODPOST 11 modules
ERROR: "dax_pmem_compat_test" [tools/testing/nvdimm/test/nfit_test.ko] undefined!

Fix the problem by calling dax_pmem_compat_test() only if the kernel has
the required functionality.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 tools/testing/nvdimm/test/nfit.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jan Kara Feb. 10, 2020, 11:28 a.m. UTC | #1
On Thu 23-01-20 16:47:20, Jan Kara wrote:
> When a kernel is configured without CONFIG_DEV_DAX_PMEM_COMPAT, the
> compilation of tools/testing/nvdimm fails with:
> 
>   Building modules, stage 2.
>   MODPOST 11 modules
> ERROR: "dax_pmem_compat_test" [tools/testing/nvdimm/test/nfit_test.ko] undefined!
> 
> Fix the problem by calling dax_pmem_compat_test() only if the kernel has
> the required functionality.
> 
> Signed-off-by: Jan Kara <jack@suse.cz>

Ping?

								Honza

> ---
>  tools/testing/nvdimm/test/nfit.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c
> index bf6422a6af7f..a8ee5c4d41eb 100644
> --- a/tools/testing/nvdimm/test/nfit.c
> +++ b/tools/testing/nvdimm/test/nfit.c
> @@ -3164,7 +3164,9 @@ static __init int nfit_test_init(void)
>  	mcsafe_test();
>  	dax_pmem_test();
>  	dax_pmem_core_test();
> +#ifdef CONFIG_DEV_DAX_PMEM_COMPAT
>  	dax_pmem_compat_test();
> +#endif
>  
>  	nfit_test_setup(nfit_test_lookup, nfit_test_evaluate_dsm);
>  
> -- 
> 2.16.4
>
Jeff Moyer Feb. 12, 2020, 2:04 p.m. UTC | #2
Jan Kara <jack@suse.cz> writes:

> When a kernel is configured without CONFIG_DEV_DAX_PMEM_COMPAT, the
> compilation of tools/testing/nvdimm fails with:
>
>   Building modules, stage 2.
>   MODPOST 11 modules
> ERROR: "dax_pmem_compat_test" [tools/testing/nvdimm/test/nfit_test.ko] undefined!
>
> Fix the problem by calling dax_pmem_compat_test() only if the kernel has
> the required functionality.
>
> Signed-off-by: Jan Kara <jack@suse.cz>

What's the motivation?  Is this just to fix randconfig builds?  The
reason I ask is that the test suite will expect to be able to find the
dax_pmem_compat module, so it doesn't make sense to me to disable those
tests only in the kernel as you'll hit a problem when running the tests
anyway.

But, I understand if you want to prevent build bots from hitting
compilation failures due to this.

-Jeff

> ---
>  tools/testing/nvdimm/test/nfit.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c
> index bf6422a6af7f..a8ee5c4d41eb 100644
> --- a/tools/testing/nvdimm/test/nfit.c
> +++ b/tools/testing/nvdimm/test/nfit.c
> @@ -3164,7 +3164,9 @@ static __init int nfit_test_init(void)
>  	mcsafe_test();
>  	dax_pmem_test();
>  	dax_pmem_core_test();
> +#ifdef CONFIG_DEV_DAX_PMEM_COMPAT
>  	dax_pmem_compat_test();
> +#endif
>  
>  	nfit_test_setup(nfit_test_lookup, nfit_test_evaluate_dsm);
Dan Williams Feb. 12, 2020, 8:49 p.m. UTC | #3
On Wed, Feb 12, 2020 at 6:04 AM Jeff Moyer <jmoyer@redhat.com> wrote:
>
> Jan Kara <jack@suse.cz> writes:
>
> > When a kernel is configured without CONFIG_DEV_DAX_PMEM_COMPAT, the
> > compilation of tools/testing/nvdimm fails with:
> >
> >   Building modules, stage 2.
> >   MODPOST 11 modules
> > ERROR: "dax_pmem_compat_test" [tools/testing/nvdimm/test/nfit_test.ko] undefined!
> >
> > Fix the problem by calling dax_pmem_compat_test() only if the kernel has
> > the required functionality.
> >
> > Signed-off-by: Jan Kara <jack@suse.cz>
>
> What's the motivation?  Is this just to fix randconfig builds?  The
> reason I ask is that the test suite will expect to be able to find the
> dax_pmem_compat module, so it doesn't make sense to me to disable those
> tests only in the kernel as you'll hit a problem when running the tests
> anyway.

Yeah, at a minimum you'd also need to go fix up nfit_test_init() to
not check for the dax_pmem_compat module:

https://github.com/pmem/ndctl/blob/master/test/core.c#L119

> But, I understand if you want to prevent build bots from hitting
> compilation failures due to this.

Hmm, build bots would only hit what's covered by
CONFIG_NVDIMM_TEST_BUILD, and that's only building
tools/testing/nvdimm/test/iomap.c.

Jan, were you just looking to use nfit_test outside of running the
ndctl test suites? Or was this just a drive-by compilation test?
Jan Kara Feb. 13, 2020, 8:58 p.m. UTC | #4
On Wed 12-02-20 12:49:41, Dan Williams wrote:
> On Wed, Feb 12, 2020 at 6:04 AM Jeff Moyer <jmoyer@redhat.com> wrote:
> >
> > Jan Kara <jack@suse.cz> writes:
> >
> > > When a kernel is configured without CONFIG_DEV_DAX_PMEM_COMPAT, the
> > > compilation of tools/testing/nvdimm fails with:
> > >
> > >   Building modules, stage 2.
> > >   MODPOST 11 modules
> > > ERROR: "dax_pmem_compat_test" [tools/testing/nvdimm/test/nfit_test.ko] undefined!
> > >
> > > Fix the problem by calling dax_pmem_compat_test() only if the kernel has
> > > the required functionality.
> > >
> > > Signed-off-by: Jan Kara <jack@suse.cz>
> >
> > What's the motivation?  Is this just to fix randconfig builds?  The
> > reason I ask is that the test suite will expect to be able to find the
> > dax_pmem_compat module, so it doesn't make sense to me to disable those
> > tests only in the kernel as you'll hit a problem when running the tests
> > anyway.
> 
> Yeah, at a minimum you'd also need to go fix up nfit_test_init() to
> not check for the dax_pmem_compat module:
> 
> https://github.com/pmem/ndctl/blob/master/test/core.c#L119

OK.

> > But, I understand if you want to prevent build bots from hitting
> > compilation failures due to this.
> 
> Hmm, build bots would only hit what's covered by
> CONFIG_NVDIMM_TEST_BUILD, and that's only building
> tools/testing/nvdimm/test/iomap.c.
> 
> Jan, were you just looking to use nfit_test outside of running the
> ndctl test suites? Or was this just a drive-by compilation test?

The problem is following: We build our distro kernels without
CONFIG_DEV_DAX_PMEM_COMPAT because we don't need that functionality. And
Jing Han (from Intel ;) is now complaining that he cannot compile and run
the ndctl testsuite on our kernels... It seems stupid to enable that config
option for all distro users just to be able to run the testsuite but OTOH
it would be neat to be able to run the testsuite with stock distro
config.

								Honza
Dan Williams Feb. 14, 2020, 4:13 p.m. UTC | #5
On Fri, Feb 14, 2020 at 1:42 AM Jan Kara <jack@suse.cz> wrote:
>
> On Wed 12-02-20 12:49:41, Dan Williams wrote:
> > On Wed, Feb 12, 2020 at 6:04 AM Jeff Moyer <jmoyer@redhat.com> wrote:
> > >
> > > Jan Kara <jack@suse.cz> writes:
> > >
> > > > When a kernel is configured without CONFIG_DEV_DAX_PMEM_COMPAT, the
> > > > compilation of tools/testing/nvdimm fails with:
> > > >
> > > >   Building modules, stage 2.
> > > >   MODPOST 11 modules
> > > > ERROR: "dax_pmem_compat_test" [tools/testing/nvdimm/test/nfit_test.ko] undefined!
> > > >
> > > > Fix the problem by calling dax_pmem_compat_test() only if the kernel has
> > > > the required functionality.
> > > >
> > > > Signed-off-by: Jan Kara <jack@suse.cz>
> > >
> > > What's the motivation?  Is this just to fix randconfig builds?  The
> > > reason I ask is that the test suite will expect to be able to find the
> > > dax_pmem_compat module, so it doesn't make sense to me to disable those
> > > tests only in the kernel as you'll hit a problem when running the tests
> > > anyway.
> >
> > Yeah, at a minimum you'd also need to go fix up nfit_test_init() to
> > not check for the dax_pmem_compat module:
> >
> > https://github.com/pmem/ndctl/blob/master/test/core.c#L119
>
> OK.
>
> > > But, I understand if you want to prevent build bots from hitting
> > > compilation failures due to this.
> >
> > Hmm, build bots would only hit what's covered by
> > CONFIG_NVDIMM_TEST_BUILD, and that's only building
> > tools/testing/nvdimm/test/iomap.c.
> >
> > Jan, were you just looking to use nfit_test outside of running the
> > ndctl test suites? Or was this just a drive-by compilation test?
>
> The problem is following: We build our distro kernels without
> CONFIG_DEV_DAX_PMEM_COMPAT because we don't need that functionality. And
> Jing Han (from Intel ;) is now complaining that he cannot compile and run
> the ndctl testsuite on our kernels... It seems stupid to enable that config
> option for all distro users just to be able to run the testsuite but OTOH
> it would be neat to be able to run the testsuite with stock distro
> config.

Sounds good, minus the fact that Jing and I were not on the same page.
I'll send the ndctl fixup.
Jan Kara Feb. 17, 2020, 8:16 a.m. UTC | #6
On Fri 14-02-20 08:13:59, Dan Williams wrote:
> On Fri, Feb 14, 2020 at 1:42 AM Jan Kara <jack@suse.cz> wrote:
> > > > But, I understand if you want to prevent build bots from hitting
> > > > compilation failures due to this.
> > >
> > > Hmm, build bots would only hit what's covered by
> > > CONFIG_NVDIMM_TEST_BUILD, and that's only building
> > > tools/testing/nvdimm/test/iomap.c.
> > >
> > > Jan, were you just looking to use nfit_test outside of running the
> > > ndctl test suites? Or was this just a drive-by compilation test?
> >
> > The problem is following: We build our distro kernels without
> > CONFIG_DEV_DAX_PMEM_COMPAT because we don't need that functionality. And
> > Jing Han (from Intel ;) is now complaining that he cannot compile and run
> > the ndctl testsuite on our kernels... It seems stupid to enable that config
> > option for all distro users just to be able to run the testsuite but OTOH
> > it would be neat to be able to run the testsuite with stock distro
> > config.
> 
> Sounds good, minus the fact that Jing and I were not on the same page.
> I'll send the ndctl fixup.

Thanks!

								Honza
diff mbox series

Patch

diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c
index bf6422a6af7f..a8ee5c4d41eb 100644
--- a/tools/testing/nvdimm/test/nfit.c
+++ b/tools/testing/nvdimm/test/nfit.c
@@ -3164,7 +3164,9 @@  static __init int nfit_test_init(void)
 	mcsafe_test();
 	dax_pmem_test();
 	dax_pmem_core_test();
+#ifdef CONFIG_DEV_DAX_PMEM_COMPAT
 	dax_pmem_compat_test();
+#endif
 
 	nfit_test_setup(nfit_test_lookup, nfit_test_evaluate_dsm);