Description
Description
I'm trying to understand btrfs and the interaction between it and userspace.
During the process I used sudo modprobe btrfs
to load btrfs as kernel module into my kernel, it works fine because it consumes the module from /lib/modules/
.
However when I'm trying to make some changes to btrfs code and compile it into module again, I will face the following issue while trying to insert it into kernel.
$ sudo dmesg
...
[237568.020605] module btrfs: .gnu.linkonce.this_module section size must match the kernel's built struct module size at run time
Which turns out that my self-compiled kernel module's size doesn't match what the kernel expected. ( we can know from Link ).
As the definition of struct module
is tagged with ____cacheline_aligned __randomize_layout
, so the size would possibly change between different built, even using exact same kernel config.
I want to know what's a proper workflow when trying to use/test my self-compiled btrfs , does it have to be , recompile the whole kernel -> boot the machine with new kernel -> use the module under /lib/modules/ , everytime ? Maybe there're some better workflow for development ?
I would love to know if you're so kind to share with me, thanks.