Linux nfs client kernel module compilation and insmod failing

353 Views Asked by At

I am trying to make changes in the nfsv3 client fs kernel module in linux. I am able to compile the kernel modules.

sureshbabu@sureshbabu-virtual-machine:~/linux-hwe-5.11-5.11.0$ make -C . M=./fs/nfs
make: Entering directory '/home/sureshbabu/linux-hwe-5.11-5.11.0'
  CC [M]  fs/nfs/filelayout/filelayout.o
  CC [M]  fs/nfs/filelayout/filelayoutdev.o
  LD [M]  fs/nfs/filelayout/nfs_layout_nfsv41_files.o
  CC [M]  fs/nfs/blocklayout/blocklayout.o
  CC [M]  fs/nfs/blocklayout/dev.o
  CC [M]  fs/nfs/blocklayout/extent_tree.o
  CC [M]  fs/nfs/blocklayout/rpc_pipefs.o
  LD [M]  fs/nfs/blocklayout/blocklayoutdriver.o
  CC [M]  fs/nfs/flexfilelayout/flexfilelayout.o
  CC [M]  fs/nfs/flexfilelayout/flexfilelayoutdev.o
  LD [M]  fs/nfs/flexfilelayout/nfs_layout_flexfiles.o
  CC [M]  fs/nfs/client.o
  CC [M]  fs/nfs/dir.o
  CC [M]  fs/nfs/file.o
  CC [M]  fs/nfs/getroot.o
  CC [M]  fs/nfs/inode.o
  CC [M]  fs/nfs/super.o
  CC [M]  fs/nfs/io.o
  CC [M]  fs/nfs/direct.o
  CC [M]  fs/nfs/pagelist.o
  CC [M]  fs/nfs/read.o
  CC [M]  fs/nfs/symlink.o
  CC [M]  fs/nfs/unlink.o
  CC [M]  fs/nfs/write.o
  CC [M]  fs/nfs/namespace.o
  CC [M]  fs/nfs/mount_clnt.o
  CC [M]  fs/nfs/nfstrace.o
  CC [M]  fs/nfs/export.o
  CC [M]  fs/nfs/sysfs.o
  CC [M]  fs/nfs/fs_context.o
  CC [M]  fs/nfs/sysctl.o
  CC [M]  fs/nfs/fscache.o
  CC [M]  fs/nfs/fscache-index.o
  LD [M]  fs/nfs/nfs.o
  CC [M]  fs/nfs/nfs2super.o
  CC [M]  fs/nfs/proc.o
  CC [M]  fs/nfs/nfs2xdr.o
  LD [M]  fs/nfs/nfsv2.o
  CC [M]  fs/nfs/nfs3super.o
  CC [M]  fs/nfs/nfs3client.o
  CC [M]  fs/nfs/nfs3proc.o
  CC [M]  fs/nfs/nfs3xdr.o
  CC [M]  fs/nfs/nfs3acl.o
  LD [M]  fs/nfs/nfsv3.o
  CC [M]  fs/nfs/nfs4proc.o
  CC [M]  fs/nfs/nfs4xdr.o
  CC [M]  fs/nfs/nfs4state.o
  CC [M]  fs/nfs/nfs4renewd.o
  CC [M]  fs/nfs/nfs4super.o
  CC [M]  fs/nfs/nfs4file.o
  CC [M]  fs/nfs/delegation.o
  CC [M]  fs/nfs/nfs4idmap.o
  CC [M]  fs/nfs/callback.o
  CC [M]  fs/nfs/callback_xdr.o
  CC [M]  fs/nfs/callback_proc.o
  CC [M]  fs/nfs/nfs4namespace.o
  CC [M]  fs/nfs/nfs4getroot.o
  CC [M]  fs/nfs/nfs4client.o
  CC [M]  fs/nfs/nfs4session.o
  CC [M]  fs/nfs/dns_resolve.o
  CC [M]  fs/nfs/nfs4trace.o
  CC [M]  fs/nfs/nfs4sysctl.o
  CC [M]  fs/nfs/pnfs.o
  CC [M]  fs/nfs/pnfs_dev.o
  CC [M]  fs/nfs/pnfs_nfs.o
  CC [M]  fs/nfs/nfs42proc.o
  CC [M]  fs/nfs/nfs42xattr.o
  LD [M]  fs/nfs/nfsv4.o
  MODPOST fs/nfs/Module.symvers
  CC [M]  fs/nfs/blocklayout/blocklayoutdriver.mod.o
  LD [M]  fs/nfs/blocklayout/blocklayoutdriver.ko
  CC [M]  fs/nfs/filelayout/nfs_layout_nfsv41_files.mod.o
  LD [M]  fs/nfs/filelayout/nfs_layout_nfsv41_files.ko
  CC [M]  fs/nfs/flexfilelayout/nfs_layout_flexfiles.mod.o
  LD [M]  fs/nfs/flexfilelayout/nfs_layout_flexfiles.ko
  CC [M]  fs/nfs/nfs.mod.o
  LD [M]  fs/nfs/nfs.ko
  CC [M]  fs/nfs/nfsv2.mod.o
  LD [M]  fs/nfs/nfsv2.ko
  CC [M]  fs/nfs/nfsv3.mod.o
  LD [M]  fs/nfs/nfsv3.ko
  CC [M]  fs/nfs/nfsv4.mod.o
  LD [M]  fs/nfs/nfsv4.ko
make: Leaving directory '/home/sureshbabu/linux-hwe-5.11-5.11.0'
sureshbabu@sureshbabu-virtual-machine:~/linux-hwe-5.11-5.11.0$ sudo insmod ./fs/nfs/nfs.ko 
insmod: ERROR: could not insert module ./fs/nfs/nfs.ko: Invalid module format

Dmesg error:

[635761.547511] module: x86/modules: Skipping invalid relocation target, existing value is nonzero for type 1, loc 0000000099c593ab, val ffffffffc08ac356

0

There are 0 best solutions below