2019-10-03 00:32:41

by Steve French

[permalink] [raw]
Subject: nsdeps not working on modules in 5.4-rc1

Following the instructions in Documentation/namespaces to autogenerate
the namespace changes to avoid the multiple build warnings in 5.4-rc1
for my module ... I am not able to get nsdeps to work. For example
in my module directory (fs/cifs) trying to build with nsdeps:

make -C /usr/src/linux-headers-`uname -r` M=`pwd` modules nsdeps

gets the error "cat: ./modules.order: No such file or directory"

This is on Ubuntu 18, running current 5.4-rc1 kernel. It looks like
it is looking for modules.order in the wrong directory (it is present
in fs/cifs - but it looks like it is looking for it in /usr/src where
of course it won't be found)

I am trying to remove the hundreds of new warnings introduced by
namespaces in 5.4-rc1 when building my module e.g.

WARNING: module cifs uses symbol __fscache_acquire_cookie from
namespace .o: $(deps_/home/sfrench/cifs-2.6/fs/cifs/cache.o), but does
not import it.
--
Thanks,

Steve


2019-10-03 00:32:55

by Steve French

[permalink] [raw]
Subject: Re: nsdeps not working on modules in 5.4-rc1

And running the build differently, from the root of the git tree
(5.4-rc1) rather than using the Ubuntu 5.4-rc1 headers also fails

e.g. "make M=fs/cifs modules nsdeps"

...
LD [M] fs/cifs/cifs.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: module cifs uses symbol sigprocmask from namespace
_fs/cifs/cache.o), but does not import it.
...
WARNING: module cifs uses symbol posix_test_lock from namespace
cifs/cache.o), but does not import it.
CC [M] fs/cifs/cifs.mod.o
LD [M] fs/cifs/cifs.ko
Building modules, stage 2.
MODPOST 1 modules
./scripts/nsdeps: 34: local: ./fs/cifs/cifsfs.c: bad variable name
make: *** [Makefile:1710: nsdeps] Error 2

On Wed, Oct 2, 2019 at 6:45 PM Steve French <[email protected]> wrote:
>
> Following the instructions in Documentation/namespaces to autogenerate
> the namespace changes to avoid the multiple build warnings in 5.4-rc1
> for my module ... I am not able to get nsdeps to work. For example
> in my module directory (fs/cifs) trying to build with nsdeps:
>
> make -C /usr/src/linux-headers-`uname -r` M=`pwd` modules nsdeps
>
> gets the error "cat: ./modules.order: No such file or directory"
>
> This is on Ubuntu 18, running current 5.4-rc1 kernel. It looks like
> it is looking for modules.order in the wrong directory (it is present
> in fs/cifs - but it looks like it is looking for it in /usr/src where
> of course it won't be found)
>
> I am trying to remove the hundreds of new warnings introduced by
> namespaces in 5.4-rc1 when building my module e.g.
>
> WARNING: module cifs uses symbol __fscache_acquire_cookie from
> namespace .o: $(deps_/home/sfrench/cifs-2.6/fs/cifs/cache.o), but does
> not import it.
> --
> Thanks,
>
> Steve



--
Thanks,

Steve

2019-10-03 10:45:35

by Matthias Maennich

[permalink] [raw]
Subject: Re: nsdeps not working on modules in 5.4-rc1

Hi Steve!

On Wed, Oct 02, 2019 at 06:54:26PM -0500, Steve French wrote:
>And running the build differently, from the root of the git tree
>(5.4-rc1) rather than using the Ubuntu 5.4-rc1 headers also fails
>
>e.g. "make M=fs/cifs modules nsdeps"
>
>...
> LD [M] fs/cifs/cifs.o
> Building modules, stage 2.
> MODPOST 1 modules
>WARNING: module cifs uses symbol sigprocmask from namespace
>_fs/cifs/cache.o), but does not import it.
>...
>WARNING: module cifs uses symbol posix_test_lock from namespace
>cifs/cache.o), but does not import it.
> CC [M] fs/cifs/cifs.mod.o
> LD [M] fs/cifs/cifs.ko
> Building modules, stage 2.
> MODPOST 1 modules
>./scripts/nsdeps: 34: local: ./fs/cifs/cifsfs.c: bad variable name
>make: *** [Makefile:1710: nsdeps] Error 2

Thanks for reporting this. It appears to me you hit a bug that was
recently discovered: when building with `make M=some/subdirectory`,
modpost is misbehaving. Can you try whether this patch series solves
your problems:
https://lore.kernel.org/lkml/[email protected]/
In particular patch 2/6 out of the series.

Cheers,
Matthias

>On Wed, Oct 2, 2019 at 6:45 PM Steve French <[email protected]> wrote:
>>
>> Following the instructions in Documentation/namespaces to autogenerate
>> the namespace changes to avoid the multiple build warnings in 5.4-rc1
>> for my module ... I am not able to get nsdeps to work. For example
>> in my module directory (fs/cifs) trying to build with nsdeps:
>>
>> make -C /usr/src/linux-headers-`uname -r` M=`pwd` modules nsdeps
>>
>> gets the error "cat: ./modules.order: No such file or directory"
>>
>> This is on Ubuntu 18, running current 5.4-rc1 kernel. It looks like
>> it is looking for modules.order in the wrong directory (it is present
>> in fs/cifs - but it looks like it is looking for it in /usr/src where
>> of course it won't be found)
>>
>> I am trying to remove the hundreds of new warnings introduced by
>> namespaces in 5.4-rc1 when building my module e.g.
>>
>> WARNING: module cifs uses symbol __fscache_acquire_cookie from
>> namespace .o: $(deps_/home/sfrench/cifs-2.6/fs/cifs/cache.o), but does
>> not import it.
>> --
>> Thanks,
>>
>> Steve
>
>
>
>--
>Thanks,
>
>Steve

2019-10-03 15:17:59

by Steve French

[permalink] [raw]
Subject: Re: nsdeps not working on modules in 5.4-rc1

On Thu, Oct 3, 2019 at 5:43 AM Matthias Maennich <[email protected]> wrote:
>
> Hi Steve!
>
> On Wed, Oct 02, 2019 at 06:54:26PM -0500, Steve French wrote:
> >And running the build differently, from the root of the git tree
> >(5.4-rc1) rather than using the Ubuntu 5.4-rc1 headers also fails
> >
> >e.g. "make M=fs/cifs modules nsdeps"
> >
> >...
> > LD [M] fs/cifs/cifs.o
> > Building modules, stage 2.
> > MODPOST 1 modules
> >WARNING: module cifs uses symbol sigprocmask from namespace
> >_fs/cifs/cache.o), but does not import it.
> >...
> >WARNING: module cifs uses symbol posix_test_lock from namespace
> >cifs/cache.o), but does not import it.
> > CC [M] fs/cifs/cifs.mod.o
> > LD [M] fs/cifs/cifs.ko
> > Building modules, stage 2.
> > MODPOST 1 modules
> >./scripts/nsdeps: 34: local: ./fs/cifs/cifsfs.c: bad variable name
> >make: *** [Makefile:1710: nsdeps] Error 2
>
> Thanks for reporting this. It appears to me you hit a bug that was
> recently discovered: when building with `make M=some/subdirectory`,
> modpost is misbehaving. Can you try whether this patch series solves
> your problems:
> https://lore.kernel.org/lkml/[email protected]/
> In particular patch 2/6 out of the series.
>
> Cheers,
> Matthias


Applying just patch 2 and doing "make" from the root of the git tree
(5.4-rc1), at the tail end of the build I got

...
Kernel: arch/x86/boot/bzImage is ready (#87)
Building modules, stage 2.
MODPOST 5340 modules
free(): invalid pointer
Aborted (core dumped)
make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 134
make: *** [Makefile:1303: modules] Error 2

With patch 2 and doing make M=fs/cifs nsdeps from the root of the git tree I get

$ make M=fs/cifs nsdeps
Building modules, stage 2.
MODPOST 1 modules
Building modules, stage 2.
MODPOST 1 modules
./scripts/nsdeps: 34: local: ./fs/cifs/cifsfs.c: bad variable name
make: *** [Makefile:1710: nsdeps] Error 2


--
Thanks,

Steve

2019-10-03 15:25:34

by Masahiro Yamada

[permalink] [raw]
Subject: Re: nsdeps not working on modules in 5.4-rc1

Hi Steve,

On Fri, Oct 4, 2019 at 12:15 AM Steve French <[email protected]> wrote:
>
> On Thu, Oct 3, 2019 at 5:43 AM Matthias Maennich <[email protected]> wrote:
> >
> > Hi Steve!
> >
> > On Wed, Oct 02, 2019 at 06:54:26PM -0500, Steve French wrote:
> > >And running the build differently, from the root of the git tree
> > >(5.4-rc1) rather than using the Ubuntu 5.4-rc1 headers also fails
> > >
> > >e.g. "make M=fs/cifs modules nsdeps"
> > >
> > >...
> > > LD [M] fs/cifs/cifs.o
> > > Building modules, stage 2.
> > > MODPOST 1 modules
> > >WARNING: module cifs uses symbol sigprocmask from namespace
> > >_fs/cifs/cache.o), but does not import it.
> > >...
> > >WARNING: module cifs uses symbol posix_test_lock from namespace
> > >cifs/cache.o), but does not import it.
> > > CC [M] fs/cifs/cifs.mod.o
> > > LD [M] fs/cifs/cifs.ko
> > > Building modules, stage 2.
> > > MODPOST 1 modules
> > >./scripts/nsdeps: 34: local: ./fs/cifs/cifsfs.c: bad variable name
> > >make: *** [Makefile:1710: nsdeps] Error 2
> >
> > Thanks for reporting this. It appears to me you hit a bug that was
> > recently discovered: when building with `make M=some/subdirectory`,
> > modpost is misbehaving. Can you try whether this patch series solves
> > your problems:
> > https://lore.kernel.org/lkml/[email protected]/
> > In particular patch 2/6 out of the series.
> >
> > Cheers,
> > Matthias
>
>
> Applying just patch 2 and doing "make" from the root of the git tree
> (5.4-rc1), at the tail end of the build I got
>
> ...
> Kernel: arch/x86/boot/bzImage is ready (#87)
> Building modules, stage 2.
> MODPOST 5340 modules
> free(): invalid pointer
> Aborted (core dumped)


Right.

Since 2/6 depends on 1/6,
applying only the second one does not work.




> make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 134
> make: *** [Makefile:1303: modules] Error 2
>
> With patch 2 and doing make M=fs/cifs nsdeps from the root of the git tree I get
>
> $ make M=fs/cifs nsdeps
> Building modules, stage 2.
> MODPOST 1 modules
> Building modules, stage 2.
> MODPOST 1 modules
> ./scripts/nsdeps: 34: local: ./fs/cifs/cifsfs.c: bad variable name
> make: *** [Makefile:1710: nsdeps] Error 2
>
>
> --
> Thanks,
>
> Steve



--
Best Regards
Masahiro Yamada

2019-10-03 16:11:24

by Steve French

[permalink] [raw]
Subject: Re: nsdeps not working on modules in 5.4-rc1

On Thu, Oct 3, 2019 at 10:24 AM Masahiro Yamada
<[email protected]> wrote:
>
> Hi Steve,
>
> On Fri, Oct 4, 2019 at 12:15 AM Steve French <[email protected]> wrote:
> >
> > On Thu, Oct 3, 2019 at 5:43 AM Matthias Maennich <[email protected]> wrote:
> > >
> > > Hi Steve!
> > >
> > > On Wed, Oct 02, 2019 at 06:54:26PM -0500, Steve French wrote:
> > > >And running the build differently, from the root of the git tree
> > > >(5.4-rc1) rather than using the Ubuntu 5.4-rc1 headers also fails
> > > >
> > > >e.g. "make M=fs/cifs modules nsdeps"
> > > >
> > > >...
> > > > LD [M] fs/cifs/cifs.o
> > > > Building modules, stage 2.
> > > > MODPOST 1 modules
> > > >WARNING: module cifs uses symbol sigprocmask from namespace
> > > >_fs/cifs/cache.o), but does not import it.
> > > >...
> > > >WARNING: module cifs uses symbol posix_test_lock from namespace
> > > >cifs/cache.o), but does not import it.
> > > > CC [M] fs/cifs/cifs.mod.o
> > > > LD [M] fs/cifs/cifs.ko
> > > > Building modules, stage 2.
> > > > MODPOST 1 modules
> > > >./scripts/nsdeps: 34: local: ./fs/cifs/cifsfs.c: bad variable name
> > > >make: *** [Makefile:1710: nsdeps] Error 2
> > >
> > > Thanks for reporting this. It appears to me you hit a bug that was
> > > recently discovered: when building with `make M=some/subdirectory`,
> > > modpost is misbehaving. Can you try whether this patch series solves
> > > your problems:
> > > https://lore.kernel.org/lkml/[email protected]/
> > > In particular patch 2/6 out of the series.
> > >
> > > Cheers,
> > > Matthias
> >
> >
> > Applying just patch 2 and doing "make" from the root of the git tree
> > (5.4-rc1), at the tail end of the build I got
> >
> > ...
> > Kernel: arch/x86/boot/bzImage is ready (#87)
> > Building modules, stage 2.
> > MODPOST 5340 modules
> > free(): invalid pointer
> > Aborted (core dumped)
>
>
> Right.
>
> Since 2/6 depends on 1/6,
> applying only the second one does not work.

Applying both 1 and 2 I get the following error doing make (although
it makes it a long way into the build)

<snip>
WARNING: drivers/usb/storage/usb-storage: 'USB_STORAGE' exported
twice. Previous export was in drivers/usb/storage/usb-storage.ko
ERROR: "usb_stor_set_xfer_buf" [drivers/usb/storage/ums-usbat.ko] undefined!
ERROR: "usb_stor_access_xfer_buf" [drivers/usb/storage/ums-usbat.ko] undefined!
ERROR: "usb_stor_post_reset" [drivers/usb/storage/ums-usbat.ko] undefined!
ERROR: "usb_stor_disconnect" [drivers/usb/storage/ums-usbat.ko] undefined!
<snip>
ERROR: "usb_stor_adjust_quirks" [drivers/usb/storage/uas.ko] undefined!
ERROR: "usb_stor_sense_invalidCDB" [drivers/usb/storage/uas.ko] undefined!
WARNING: "USB_STORAGE" [drivers/usb/storage/usb-storage] is a static
EXPORT_SYMBOL_GPL
make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
make: *** [Makefile:1303: modules] Error 2

Running "make M=fs/cifs nsdeps" I still get the error

Building modules, stage 2.
MODPOST 1 modules
./scripts/nsdeps: 34: local: ./fs/cifs/cifsfs.c: bad variable name
make: *** [Makefile:1710: nsdeps] Error 2



--
Thanks,

Steve

2019-10-04 08:06:55

by Masahiro Yamada

[permalink] [raw]
Subject: Re: nsdeps not working on modules in 5.4-rc1

Hi Steve,

On Fri, Oct 4, 2019 at 1:07 AM Steve French <[email protected]> wrote:
>
> On Thu, Oct 3, 2019 at 10:24 AM Masahiro Yamada
> <[email protected]> wrote:
> >
> > Hi Steve,
> >
> > On Fri, Oct 4, 2019 at 12:15 AM Steve French <[email protected]> wrote:
> > >
> > > On Thu, Oct 3, 2019 at 5:43 AM Matthias Maennich <[email protected]> wrote:
> > > >
> > > > Hi Steve!
> > > >
> > > > On Wed, Oct 02, 2019 at 06:54:26PM -0500, Steve French wrote:
> > > > >And running the build differently, from the root of the git tree
> > > > >(5.4-rc1) rather than using the Ubuntu 5.4-rc1 headers also fails
> > > > >
> > > > >e.g. "make M=fs/cifs modules nsdeps"
> > > > >
> > > > >...
> > > > > LD [M] fs/cifs/cifs.o
> > > > > Building modules, stage 2.
> > > > > MODPOST 1 modules
> > > > >WARNING: module cifs uses symbol sigprocmask from namespace
> > > > >_fs/cifs/cache.o), but does not import it.
> > > > >...
> > > > >WARNING: module cifs uses symbol posix_test_lock from namespace
> > > > >cifs/cache.o), but does not import it.
> > > > > CC [M] fs/cifs/cifs.mod.o
> > > > > LD [M] fs/cifs/cifs.ko
> > > > > Building modules, stage 2.
> > > > > MODPOST 1 modules
> > > > >./scripts/nsdeps: 34: local: ./fs/cifs/cifsfs.c: bad variable name
> > > > >make: *** [Makefile:1710: nsdeps] Error 2
> > > >
> > > > Thanks for reporting this. It appears to me you hit a bug that was
> > > > recently discovered: when building with `make M=some/subdirectory`,
> > > > modpost is misbehaving. Can you try whether this patch series solves
> > > > your problems:
> > > > https://lore.kernel.org/lkml/[email protected]/
> > > > In particular patch 2/6 out of the series.
> > > >
> > > > Cheers,
> > > > Matthias
> > >
> > >
> > > Applying just patch 2 and doing "make" from the root of the git tree
> > > (5.4-rc1), at the tail end of the build I got
> > >
> > > ...
> > > Kernel: arch/x86/boot/bzImage is ready (#87)
> > > Building modules, stage 2.
> > > MODPOST 5340 modules
> > > free(): invalid pointer
> > > Aborted (core dumped)
> >
> >
> > Right.
> >
> > Since 2/6 depends on 1/6,
> > applying only the second one does not work.
>
> Applying both 1 and 2 I get the following error doing make (although
> it makes it a long way into the build)
>
> <snip>
> WARNING: drivers/usb/storage/usb-storage: 'USB_STORAGE' exported
> twice. Previous export was in drivers/usb/storage/usb-storage.ko
> ERROR: "usb_stor_set_xfer_buf" [drivers/usb/storage/ums-usbat.ko] undefined!
> ERROR: "usb_stor_access_xfer_buf" [drivers/usb/storage/ums-usbat.ko] undefined!
> ERROR: "usb_stor_post_reset" [drivers/usb/storage/ums-usbat.ko] undefined!
> ERROR: "usb_stor_disconnect" [drivers/usb/storage/ums-usbat.ko] undefined!
> <snip>
> ERROR: "usb_stor_adjust_quirks" [drivers/usb/storage/uas.ko] undefined!
> ERROR: "usb_stor_sense_invalidCDB" [drivers/usb/storage/uas.ko] undefined!
> WARNING: "USB_STORAGE" [drivers/usb/storage/usb-storage] is a static
> EXPORT_SYMBOL_GPL
> make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
> make: *** [Makefile:1303: modules] Error 2


Hmm, I do not see those error.
I was able to build the kernel successfully.
(I asked the 0-day bot to test whole of my patch set
in case I am missing something.)


Could you share the steps to reproduce the errors and your .config file?






> Running "make M=fs/cifs nsdeps" I still get the error

Sorry, I do not understand why you are doing this.


>
> Building modules, stage 2.
> MODPOST 1 modules
> ./scripts/nsdeps: 34: local: ./fs/cifs/cifsfs.c: bad variable name
> make: *** [Makefile:1710: nsdeps] Error 2
>
>
>
> --
> Thanks,
>
> Steve



--
Best Regards
Masahiro Yamada

2019-10-04 08:09:47

by Steve French

[permalink] [raw]
Subject: Re: nsdeps not working on modules in 5.4-rc1

On Thu, Oct 3, 2019 at 10:41 PM Masahiro Yamada
<[email protected]> wrote:
>
> Hi Steve,
>
> On Fri, Oct 4, 2019 at 1:07 AM Steve French <[email protected]> wrote:
> >
> > On Thu, Oct 3, 2019 at 10:24 AM Masahiro Yamada
> > <[email protected]> wrote:
> > >
> > > Hi Steve,
> > >
> > > On Fri, Oct 4, 2019 at 12:15 AM Steve French <[email protected]> wrote:
> > > >
> > > > On Thu, Oct 3, 2019 at 5:43 AM Matthias Maennich <[email protected]> wrote:
> > > > >
> > > > > Hi Steve!
> > > > >
> > > > > On Wed, Oct 02, 2019 at 06:54:26PM -0500, Steve French wrote:
> > > > > >And running the build differently, from the root of the git tree
> > > > > >(5.4-rc1) rather than using the Ubuntu 5.4-rc1 headers also fails
> > > > > >
> > > > > >e.g. "make M=fs/cifs modules nsdeps"
> > > > > >
> > > > > >...
> > > > > > LD [M] fs/cifs/cifs.o
> > > > > > Building modules, stage 2.
> > > > > > MODPOST 1 modules
> > > > > >WARNING: module cifs uses symbol sigprocmask from namespace
> > > > > >_fs/cifs/cache.o), but does not import it.
> > > > > >...
> > > > > >WARNING: module cifs uses symbol posix_test_lock from namespace
> > > > > >cifs/cache.o), but does not import it.
> > > > > > CC [M] fs/cifs/cifs.mod.o
> > > > > > LD [M] fs/cifs/cifs.ko
> > > > > > Building modules, stage 2.
> > > > > > MODPOST 1 modules
> > > > > >./scripts/nsdeps: 34: local: ./fs/cifs/cifsfs.c: bad variable name
> > > > > >make: *** [Makefile:1710: nsdeps] Error 2
> > > > >
> > > > > Thanks for reporting this. It appears to me you hit a bug that was
> > > > > recently discovered: when building with `make M=some/subdirectory`,
> > > > > modpost is misbehaving. Can you try whether this patch series solves
> > > > > your problems:
> > > > > https://lore.kernel.org/lkml/[email protected]/
> > > > > In particular patch 2/6 out of the series.
> > > > >
> > > > > Cheers,
> > > > > Matthias
> > > >
> > > >
> > > > Applying just patch 2 and doing "make" from the root of the git tree
> > > > (5.4-rc1), at the tail end of the build I got
> > > >
> > > > ...
> > > > Kernel: arch/x86/boot/bzImage is ready (#87)
> > > > Building modules, stage 2.
> > > > MODPOST 5340 modules
> > > > free(): invalid pointer
> > > > Aborted (core dumped)
> > >
> > >
> > > Right.
> > >
> > > Since 2/6 depends on 1/6,
> > > applying only the second one does not work.
> >
> > Applying both 1 and 2 I get the following error doing make (although
> > it makes it a long way into the build)
> >
> > <snip>
> > WARNING: drivers/usb/storage/usb-storage: 'USB_STORAGE' exported
> > twice. Previous export was in drivers/usb/storage/usb-storage.ko
> > ERROR: "usb_stor_set_xfer_buf" [drivers/usb/storage/ums-usbat.ko] undefined!
> > ERROR: "usb_stor_access_xfer_buf" [drivers/usb/storage/ums-usbat.ko] undefined!
> > ERROR: "usb_stor_post_reset" [drivers/usb/storage/ums-usbat.ko] undefined!
> > ERROR: "usb_stor_disconnect" [drivers/usb/storage/ums-usbat.ko] undefined!
> > <snip>
> > ERROR: "usb_stor_adjust_quirks" [drivers/usb/storage/uas.ko] undefined!
> > ERROR: "usb_stor_sense_invalidCDB" [drivers/usb/storage/uas.ko] undefined!
> > WARNING: "USB_STORAGE" [drivers/usb/storage/usb-storage] is a static
> > EXPORT_SYMBOL_GPL
> > make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
> > make: *** [Makefile:1303: modules] Error 2
>
>
> Hmm, I do not see those error.
> I was able to build the kernel successfully.
> (I asked the 0-day bot to test whole of my patch set
> in case I am missing something.)
>
>
> Could you share the steps to reproduce the errors and your .config file?

From the root of git tree - at exactly 5.4-rc1

~/cifs-2.6$ make nsdeps
CALL scripts/checksyscalls.sh
CALL scripts/atomic/check-atomics.sh
DESCEND objtool
CHK include/generated/compile.h
CHK kernel/kheaders_data.tar.xz
Building modules, stage 2.
MODPOST 5340 modules
Building modules, stage 2.
MODPOST 5340 modules
./scripts/nsdeps: 34: local: ./fs/cifs/cifsfs.c: bad variable name
make: *** [Makefile:1710: nsdeps] Error 2

I get the same error doing "rm fs/cifs/*.o" and repeating the "make
nsdeps" command

I will send you the .config

2019-10-04 08:13:30

by Steve French

[permalink] [raw]
Subject: Re: nsdeps not working on modules in 5.4-rc1

ok - so to sum up, it sounds like you are saying the 350 false
positives (see attached file) that happen on building cifs.ko .will be
fixed by a
future change to modpost? This is a typical module build ...
download and install current kernel package (in this case Ubuntu
5.4-rc1). which saves huge amount of build time, then build just the
module of interest (in my case cifs.ko)

cd fs/cifs
make C=1 -C /usr/src/linux-headers-`uname -r` M=`pwd` modules

If nsdeps is not needed to fixup some namespace issue then shouldn't
be a problem, just trying to avoid the distraction of 300+
warning messages every time I build just this one module. Is there a
workaround?

On Thu, Oct 3, 2019 at 11:51 PM Masahiro Yamada
<[email protected]> wrote:
>
> Hi Steve,
>
> On Fri, Oct 4, 2019 at 1:28 PM Steve French <[email protected]> wrote:
> >
> > On Thu, Oct 3, 2019 at 10:41 PM Masahiro Yamada
> > <[email protected]> wrote:
> > >
> > > Hi Steve,
> > >
> > > On Fri, Oct 4, 2019 at 1:07 AM Steve French <[email protected]> wrote:
> > > >
> > > > On Thu, Oct 3, 2019 at 10:24 AM Masahiro Yamada
> > > > <[email protected]> wrote:
> > > > >
> > > > > Hi Steve,
> > > > >
> > > > > On Fri, Oct 4, 2019 at 12:15 AM Steve French <[email protected]> wrote:
> > > > > >
> > > > > > On Thu, Oct 3, 2019 at 5:43 AM Matthias Maennich <[email protected]> wrote:
> > > > > > >
> > > > > > > Hi Steve!
> > > > > > >
> > > > > > > On Wed, Oct 02, 2019 at 06:54:26PM -0500, Steve French wrote:
> > > > > > > >And running the build differently, from the root of the git tree
> > > > > > > >(5.4-rc1) rather than using the Ubuntu 5.4-rc1 headers also fails
> > > > > > > >
> > > > > > > >e.g. "make M=fs/cifs modules nsdeps"
> > > > > > > >
> > > > > > > >...
> > > > > > > > LD [M] fs/cifs/cifs.o
> > > > > > > > Building modules, stage 2.
> > > > > > > > MODPOST 1 modules
> > > > > > > >WARNING: module cifs uses symbol sigprocmask from namespace
> > > > > > > >_fs/cifs/cache.o), but does not import it.
> > > > > > > >...
> > > > > > > >WARNING: module cifs uses symbol posix_test_lock from namespace
> > > > > > > >cifs/cache.o), but does not import it.
> > > > > > > > CC [M] fs/cifs/cifs.mod.o
> > > > > > > > LD [M] fs/cifs/cifs.ko
> > > > > > > > Building modules, stage 2.
> > > > > > > > MODPOST 1 modules
> > > > > > > >./scripts/nsdeps: 34: local: ./fs/cifs/cifsfs.c: bad variable name
> > > > > > > >make: *** [Makefile:1710: nsdeps] Error 2
> > > > > > >
> > > > > > > Thanks for reporting this. It appears to me you hit a bug that was
> > > > > > > recently discovered: when building with `make M=some/subdirectory`,
> > > > > > > modpost is misbehaving. Can you try whether this patch series solves
> > > > > > > your problems:
> > > > > > > https://lore.kernel.org/lkml/[email protected]/
> > > > > > > In particular patch 2/6 out of the series.
> > > > > > >
> > > > > > > Cheers,
> > > > > > > Matthias
> > > > > >
> > > > > >
> > > > > > Applying just patch 2 and doing "make" from the root of the git tree
> > > > > > (5.4-rc1), at the tail end of the build I got
> > > > > >
> > > > > > ...
> > > > > > Kernel: arch/x86/boot/bzImage is ready (#87)
> > > > > > Building modules, stage 2.
> > > > > > MODPOST 5340 modules
> > > > > > free(): invalid pointer
> > > > > > Aborted (core dumped)
> > > > >
> > > > >
> > > > > Right.
> > > > >
> > > > > Since 2/6 depends on 1/6,
> > > > > applying only the second one does not work.
> > > >
> > > > Applying both 1 and 2 I get the following error doing make (although
> > > > it makes it a long way into the build)
> > > >
> > > > <snip>
> > > > WARNING: drivers/usb/storage/usb-storage: 'USB_STORAGE' exported
> > > > twice. Previous export was in drivers/usb/storage/usb-storage.ko
> > > > ERROR: "usb_stor_set_xfer_buf" [drivers/usb/storage/ums-usbat.ko] undefined!
> > > > ERROR: "usb_stor_access_xfer_buf" [drivers/usb/storage/ums-usbat.ko] undefined!
> > > > ERROR: "usb_stor_post_reset" [drivers/usb/storage/ums-usbat.ko] undefined!
> > > > ERROR: "usb_stor_disconnect" [drivers/usb/storage/ums-usbat.ko] undefined!
> > > > <snip>
> > > > ERROR: "usb_stor_adjust_quirks" [drivers/usb/storage/uas.ko] undefined!
> > > > ERROR: "usb_stor_sense_invalidCDB" [drivers/usb/storage/uas.ko] undefined!
> > > > WARNING: "USB_STORAGE" [drivers/usb/storage/usb-storage] is a static
> > > > EXPORT_SYMBOL_GPL
> > > > make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
> > > > make: *** [Makefile:1303: modules] Error 2
> > >
> > >
> > > Hmm, I do not see those error.
> > > I was able to build the kernel successfully.
> > > (I asked the 0-day bot to test whole of my patch set
> > > in case I am missing something.)
> > >
> > >
> > > Could you share the steps to reproduce the errors and your .config file?
> >
> > From the root of git tree - at exactly 5.4-rc1
> >
> > ~/cifs-2.6$ make nsdeps
> > CALL scripts/checksyscalls.sh
> > CALL scripts/atomic/check-atomics.sh
> > DESCEND objtool
> > CHK include/generated/compile.h
> > CHK kernel/kheaders_data.tar.xz
> > Building modules, stage 2.
> > MODPOST 5340 modules
> > Building modules, stage 2.
> > MODPOST 5340 modules
> > ./scripts/nsdeps: 34: local: ./fs/cifs/cifsfs.c: bad variable name
> > make: *** [Makefile:1710: nsdeps] Error 2
> >
> > I get the same error doing "rm fs/cifs/*.o" and repeating the "make
> > nsdeps" command
> >
> > I will send you the .config
>
>
>
> You need to clarify your problem.
>
> In the first post from you, you pointed out
> "hundreds of new warnings introduced by namespaces in 5.4-rc1 when
> building my module"
>
> So, 1/6 and 2/6 should address that problem.
> https://lore.kernel.org/patchwork/patch/1133628/
> https://lore.kernel.org/patchwork/patch/1133626/
>
>
> Then, in the previous email ("Applying both 1 and 2 I get the
> following error doing make")
> it looks like you were talking about in-kernel building
> instead of the external module.
>
>
> Then, in this email, you are talking about "make nsdeps".
> "make nsdeps" obviously does not support M=.
>
>
> I am afraid you are mixing up different issues,
> which is so confusing. (and I am afraid you were too confused)
>
> Currently, the namespace is used only by USB_STORAGE.
> So, it should not be a problem for your module.
>
> To sum up, you do not need to run nsdeps at all.
> The hundreds of false-positive warnings came from the modpost bug,
> and should be fixed soon.
>
>
> --
> Best Regards
> Masahiro Yamada



--
Thanks,

Steve


Attachments:
out (55.97 kB)

2019-10-04 08:13:59

by Masahiro Yamada

[permalink] [raw]
Subject: Re: nsdeps not working on modules in 5.4-rc1

Hi Steve,

On Fri, Oct 4, 2019 at 1:28 PM Steve French <[email protected]> wrote:
>
> On Thu, Oct 3, 2019 at 10:41 PM Masahiro Yamada
> <[email protected]> wrote:
> >
> > Hi Steve,
> >
> > On Fri, Oct 4, 2019 at 1:07 AM Steve French <[email protected]> wrote:
> > >
> > > On Thu, Oct 3, 2019 at 10:24 AM Masahiro Yamada
> > > <[email protected]> wrote:
> > > >
> > > > Hi Steve,
> > > >
> > > > On Fri, Oct 4, 2019 at 12:15 AM Steve French <[email protected]> wrote:
> > > > >
> > > > > On Thu, Oct 3, 2019 at 5:43 AM Matthias Maennich <[email protected]> wrote:
> > > > > >
> > > > > > Hi Steve!
> > > > > >
> > > > > > On Wed, Oct 02, 2019 at 06:54:26PM -0500, Steve French wrote:
> > > > > > >And running the build differently, from the root of the git tree
> > > > > > >(5.4-rc1) rather than using the Ubuntu 5.4-rc1 headers also fails
> > > > > > >
> > > > > > >e.g. "make M=fs/cifs modules nsdeps"
> > > > > > >
> > > > > > >...
> > > > > > > LD [M] fs/cifs/cifs.o
> > > > > > > Building modules, stage 2.
> > > > > > > MODPOST 1 modules
> > > > > > >WARNING: module cifs uses symbol sigprocmask from namespace
> > > > > > >_fs/cifs/cache.o), but does not import it.
> > > > > > >...
> > > > > > >WARNING: module cifs uses symbol posix_test_lock from namespace
> > > > > > >cifs/cache.o), but does not import it.
> > > > > > > CC [M] fs/cifs/cifs.mod.o
> > > > > > > LD [M] fs/cifs/cifs.ko
> > > > > > > Building modules, stage 2.
> > > > > > > MODPOST 1 modules
> > > > > > >./scripts/nsdeps: 34: local: ./fs/cifs/cifsfs.c: bad variable name
> > > > > > >make: *** [Makefile:1710: nsdeps] Error 2
> > > > > >
> > > > > > Thanks for reporting this. It appears to me you hit a bug that was
> > > > > > recently discovered: when building with `make M=some/subdirectory`,
> > > > > > modpost is misbehaving. Can you try whether this patch series solves
> > > > > > your problems:
> > > > > > https://lore.kernel.org/lkml/[email protected]/
> > > > > > In particular patch 2/6 out of the series.
> > > > > >
> > > > > > Cheers,
> > > > > > Matthias
> > > > >
> > > > >
> > > > > Applying just patch 2 and doing "make" from the root of the git tree
> > > > > (5.4-rc1), at the tail end of the build I got
> > > > >
> > > > > ...
> > > > > Kernel: arch/x86/boot/bzImage is ready (#87)
> > > > > Building modules, stage 2.
> > > > > MODPOST 5340 modules
> > > > > free(): invalid pointer
> > > > > Aborted (core dumped)
> > > >
> > > >
> > > > Right.
> > > >
> > > > Since 2/6 depends on 1/6,
> > > > applying only the second one does not work.
> > >
> > > Applying both 1 and 2 I get the following error doing make (although
> > > it makes it a long way into the build)
> > >
> > > <snip>
> > > WARNING: drivers/usb/storage/usb-storage: 'USB_STORAGE' exported
> > > twice. Previous export was in drivers/usb/storage/usb-storage.ko
> > > ERROR: "usb_stor_set_xfer_buf" [drivers/usb/storage/ums-usbat.ko] undefined!
> > > ERROR: "usb_stor_access_xfer_buf" [drivers/usb/storage/ums-usbat.ko] undefined!
> > > ERROR: "usb_stor_post_reset" [drivers/usb/storage/ums-usbat.ko] undefined!
> > > ERROR: "usb_stor_disconnect" [drivers/usb/storage/ums-usbat.ko] undefined!
> > > <snip>
> > > ERROR: "usb_stor_adjust_quirks" [drivers/usb/storage/uas.ko] undefined!
> > > ERROR: "usb_stor_sense_invalidCDB" [drivers/usb/storage/uas.ko] undefined!
> > > WARNING: "USB_STORAGE" [drivers/usb/storage/usb-storage] is a static
> > > EXPORT_SYMBOL_GPL
> > > make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
> > > make: *** [Makefile:1303: modules] Error 2
> >
> >
> > Hmm, I do not see those error.
> > I was able to build the kernel successfully.
> > (I asked the 0-day bot to test whole of my patch set
> > in case I am missing something.)
> >
> >
> > Could you share the steps to reproduce the errors and your .config file?
>
> From the root of git tree - at exactly 5.4-rc1
>
> ~/cifs-2.6$ make nsdeps
> CALL scripts/checksyscalls.sh
> CALL scripts/atomic/check-atomics.sh
> DESCEND objtool
> CHK include/generated/compile.h
> CHK kernel/kheaders_data.tar.xz
> Building modules, stage 2.
> MODPOST 5340 modules
> Building modules, stage 2.
> MODPOST 5340 modules
> ./scripts/nsdeps: 34: local: ./fs/cifs/cifsfs.c: bad variable name
> make: *** [Makefile:1710: nsdeps] Error 2
>
> I get the same error doing "rm fs/cifs/*.o" and repeating the "make
> nsdeps" command
>
> I will send you the .config



You need to clarify your problem.

In the first post from you, you pointed out
"hundreds of new warnings introduced by namespaces in 5.4-rc1 when
building my module"

So, 1/6 and 2/6 should address that problem.
https://lore.kernel.org/patchwork/patch/1133628/
https://lore.kernel.org/patchwork/patch/1133626/


Then, in the previous email ("Applying both 1 and 2 I get the
following error doing make")
it looks like you were talking about in-kernel building
instead of the external module.


Then, in this email, you are talking about "make nsdeps".
"make nsdeps" obviously does not support M=.


I am afraid you are mixing up different issues,
which is so confusing. (and I am afraid you were too confused)

Currently, the namespace is used only by USB_STORAGE.
So, it should not be a problem for your module.

To sum up, you do not need to run nsdeps at all.
The hundreds of false-positive warnings came from the modpost bug,
and should be fixed soon.


--
Best Regards
Masahiro Yamada

2019-10-04 10:52:07

by Matthias Maennich

[permalink] [raw]
Subject: Re: nsdeps not working on modules in 5.4-rc1

Hi Steve,

On Fri, Oct 04, 2019 at 12:01:20AM -0500, Steve French wrote:
>ok - so to sum up, it sounds like you are saying the 350 false
>positives (see attached file) that happen on building cifs.ko .will be
>fixed by a
>future change to modpost? This is a typical module build ...

Yes, the reason for you to see these false positive warnings is a bug in
modpost. The patch series we were referring to addresses this problem
(and some others). I do not believe you need to run nsdeps to fixup
anything in fs/cifs at this time.

>download and install current kernel package (in this case Ubuntu
>5.4-rc1). which saves huge amount of build time, then build just the
>module of interest (in my case cifs.ko)
>
> cd fs/cifs
> make C=1 -C /usr/src/linux-headers-`uname -r` M=`pwd` modules
>
>If nsdeps is not needed to fixup some namespace issue then shouldn't
>be a problem, just trying to avoid the distraction of 300+
>warning messages every time I build just this one module. Is there a
>workaround?

Sorry for the noise this creates. The only known workaround is to
locally apply the complete patch series.

Cheers,
Matthias

>On Thu, Oct 3, 2019 at 11:51 PM Masahiro Yamada
><[email protected]> wrote:
>>
>> Hi Steve,
>>
>> On Fri, Oct 4, 2019 at 1:28 PM Steve French <[email protected]> wrote:
>> >
>> > On Thu, Oct 3, 2019 at 10:41 PM Masahiro Yamada
>> > <[email protected]> wrote:
>> > >
>> > > Hi Steve,
>> > >
>> > > On Fri, Oct 4, 2019 at 1:07 AM Steve French <[email protected]> wrote:
>> > > >
>> > > > On Thu, Oct 3, 2019 at 10:24 AM Masahiro Yamada
>> > > > <[email protected]> wrote:
>> > > > >
>> > > > > Hi Steve,
>> > > > >
>> > > > > On Fri, Oct 4, 2019 at 12:15 AM Steve French <[email protected]> wrote:
>> > > > > >
>> > > > > > On Thu, Oct 3, 2019 at 5:43 AM Matthias Maennich <[email protected]> wrote:
>> > > > > > >
>> > > > > > > Hi Steve!
>> > > > > > >
>> > > > > > > On Wed, Oct 02, 2019 at 06:54:26PM -0500, Steve French wrote:
>> > > > > > > >And running the build differently, from the root of the git tree
>> > > > > > > >(5.4-rc1) rather than using the Ubuntu 5.4-rc1 headers also fails
>> > > > > > > >
>> > > > > > > >e.g. "make M=fs/cifs modules nsdeps"
>> > > > > > > >
>> > > > > > > >...
>> > > > > > > > LD [M] fs/cifs/cifs.o
>> > > > > > > > Building modules, stage 2.
>> > > > > > > > MODPOST 1 modules
>> > > > > > > >WARNING: module cifs uses symbol sigprocmask from namespace
>> > > > > > > >_fs/cifs/cache.o), but does not import it.
>> > > > > > > >...
>> > > > > > > >WARNING: module cifs uses symbol posix_test_lock from namespace
>> > > > > > > >cifs/cache.o), but does not import it.
>> > > > > > > > CC [M] fs/cifs/cifs.mod.o
>> > > > > > > > LD [M] fs/cifs/cifs.ko
>> > > > > > > > Building modules, stage 2.
>> > > > > > > > MODPOST 1 modules
>> > > > > > > >./scripts/nsdeps: 34: local: ./fs/cifs/cifsfs.c: bad variable name
>> > > > > > > >make: *** [Makefile:1710: nsdeps] Error 2
>> > > > > > >
>> > > > > > > Thanks for reporting this. It appears to me you hit a bug that was
>> > > > > > > recently discovered: when building with `make M=some/subdirectory`,
>> > > > > > > modpost is misbehaving. Can you try whether this patch series solves
>> > > > > > > your problems:
>> > > > > > > https://lore.kernel.org/lkml/[email protected]/
>> > > > > > > In particular patch 2/6 out of the series.
>> > > > > > >
>> > > > > > > Cheers,
>> > > > > > > Matthias
>> > > > > >
>> > > > > >
>> > > > > > Applying just patch 2 and doing "make" from the root of the git tree
>> > > > > > (5.4-rc1), at the tail end of the build I got
>> > > > > >
>> > > > > > ...
>> > > > > > Kernel: arch/x86/boot/bzImage is ready (#87)
>> > > > > > Building modules, stage 2.
>> > > > > > MODPOST 5340 modules
>> > > > > > free(): invalid pointer
>> > > > > > Aborted (core dumped)
>> > > > >
>> > > > >
>> > > > > Right.
>> > > > >
>> > > > > Since 2/6 depends on 1/6,
>> > > > > applying only the second one does not work.
>> > > >
>> > > > Applying both 1 and 2 I get the following error doing make (although
>> > > > it makes it a long way into the build)
>> > > >
>> > > > <snip>
>> > > > WARNING: drivers/usb/storage/usb-storage: 'USB_STORAGE' exported
>> > > > twice. Previous export was in drivers/usb/storage/usb-storage.ko
>> > > > ERROR: "usb_stor_set_xfer_buf" [drivers/usb/storage/ums-usbat.ko] undefined!
>> > > > ERROR: "usb_stor_access_xfer_buf" [drivers/usb/storage/ums-usbat.ko] undefined!
>> > > > ERROR: "usb_stor_post_reset" [drivers/usb/storage/ums-usbat.ko] undefined!
>> > > > ERROR: "usb_stor_disconnect" [drivers/usb/storage/ums-usbat.ko] undefined!
>> > > > <snip>
>> > > > ERROR: "usb_stor_adjust_quirks" [drivers/usb/storage/uas.ko] undefined!
>> > > > ERROR: "usb_stor_sense_invalidCDB" [drivers/usb/storage/uas.ko] undefined!
>> > > > WARNING: "USB_STORAGE" [drivers/usb/storage/usb-storage] is a static
>> > > > EXPORT_SYMBOL_GPL
>> > > > make[1]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
>> > > > make: *** [Makefile:1303: modules] Error 2
>> > >
>> > >
>> > > Hmm, I do not see those error.
>> > > I was able to build the kernel successfully.
>> > > (I asked the 0-day bot to test whole of my patch set
>> > > in case I am missing something.)
>> > >
>> > >
>> > > Could you share the steps to reproduce the errors and your .config file?
>> >
>> > From the root of git tree - at exactly 5.4-rc1
>> >
>> > ~/cifs-2.6$ make nsdeps
>> > CALL scripts/checksyscalls.sh
>> > CALL scripts/atomic/check-atomics.sh
>> > DESCEND objtool
>> > CHK include/generated/compile.h
>> > CHK kernel/kheaders_data.tar.xz
>> > Building modules, stage 2.
>> > MODPOST 5340 modules
>> > Building modules, stage 2.
>> > MODPOST 5340 modules
>> > ./scripts/nsdeps: 34: local: ./fs/cifs/cifsfs.c: bad variable name
>> > make: *** [Makefile:1710: nsdeps] Error 2
>> >
>> > I get the same error doing "rm fs/cifs/*.o" and repeating the "make
>> > nsdeps" command
>> >
>> > I will send you the .config
>>
>>
>>
>> You need to clarify your problem.
>>
>> In the first post from you, you pointed out
>> "hundreds of new warnings introduced by namespaces in 5.4-rc1 when
>> building my module"
>>
>> So, 1/6 and 2/6 should address that problem.
>> https://lore.kernel.org/patchwork/patch/1133628/
>> https://lore.kernel.org/patchwork/patch/1133626/
>>
>>
>> Then, in the previous email ("Applying both 1 and 2 I get the
>> following error doing make")
>> it looks like you were talking about in-kernel building
>> instead of the external module.
>>
>>
>> Then, in this email, you are talking about "make nsdeps".
>> "make nsdeps" obviously does not support M=.
>>
>>
>> I am afraid you are mixing up different issues,
>> which is so confusing. (and I am afraid you were too confused)
>>
>> Currently, the namespace is used only by USB_STORAGE.
>> So, it should not be a problem for your module.
>>
>> To sum up, you do not need to run nsdeps at all.
>> The hundreds of false-positive warnings came from the modpost bug,
>> and should be fixed soon.
>>
>>
>> --
>> Best Regards
>> Masahiro Yamada
>
>
>
>--
>Thanks,
>
>Steve