Subject: kern/4297: LKMs "nullfs" and "umapfs" can't be linked
To: None <gnats-bugs@gnats.netbsd.org>
From: Matthias Scheler <tron@lyssa.owl.de>
List: netbsd-bugs
Date: 10/19/1997 21:42:47
>Number:         4297
>Category:       kern
>Synopsis:       LKMs "nullfs" and "umapfs" can't be linked
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 19 12:50:07 1997
>Last-Modified:
>Originator:     Matthias Scheler
>Organization:
Matthias Scheler                                http://home.owl.de/~tron/
>Release:        971015
>Environment:
System: NetBSD lyssa 1.2G NetBSD 1.2G (LYSSA) #0: Thu Oct 16 15:36:04 MEST 1997 tron@lyssa:/src/src/sys/arch/i386/compile/LYSSA i386

>Description:
The loadable kernel modules "nullfs" and "umapfs" can't be linked with
the kernel any more two some wrong symbol references in each of them.

However 
>How-To-Repeat:
Compile a kernel without NULLFS and UMAPFS and to try to load these
filesystems as LKMs.

>Fix:
[Unfortunately this patch only fixes the link problem. There's still another
 problem which causes these two, "portal" and "procfcs" LKM to fail loading.
 I'm still trying to figure out what causes this.]

*** src/sys/lkm/vfs/miscfs/umapfs/lkminit_vfs.c.orig	Tue May 20 13:22:59 1997
--- src/sys/lkm/vfs/miscfs/umapfs/lkminit_vfs.c	Sun Oct 19 20:46:28 1997
***************
*** 49,61 ****
  /*
   * This is the vfsops table for the file system in question
   */
! extern struct vfsops umap_vfsops;
! extern struct vnodeopv_desc umap_vnodeop_opv_desc;
  
  /*
   * declare the filesystem
   */
! MOD_VFS("umapfs", -1, &umap_vfsops);
  
  /*
   * entry point
--- 49,61 ----
  /*
   * This is the vfsops table for the file system in question
   */
! extern struct vfsops umapfs_vfsops;
! extern struct vnodeopv_desc umapfs_vnodeop_opv_desc;
  
  /*
   * declare the filesystem
   */
! MOD_VFS("umapfs", -1, &umapfs_vfsops);
  
  /*
   * entry point
*************** umapfs_lkmentry(lkmtp, cmd, ver)
*** 71,78 ****
  	 * opv_desc is listed in vfs_opv_descs[] in vfs_conf.c.  For
  	 * loaded modules, we have to do it manually.
  	 */
! 	vfs_opv_init_explicit(&umap_vnodeop_opv_desc);
! 	vfs_opv_init_default(&umap_vnodeop_opv_desc);
  
  	DISPATCH(lkmtp, cmd, ver, lkm_nofunc, lkm_nofunc, lkm_nofunc)
  }
--- 71,78 ----
  	 * opv_desc is listed in vfs_opv_descs[] in vfs_conf.c.  For
  	 * loaded modules, we have to do it manually.
  	 */
! 	vfs_opv_init_explicit(&umapfs_vnodeop_opv_desc);
! 	vfs_opv_init_default(&umapfs_vnodeop_opv_desc);
  
  	DISPATCH(lkmtp, cmd, ver, lkm_nofunc, lkm_nofunc, lkm_nofunc)
  }
*** src/sys/lkm/vfs/miscfs/nullfs/lkminit_vfs.c.orig	Tue May 20 13:22:57 1997
--- src/sys/lkm/vfs/miscfs/nullfs/lkminit_vfs.c	Sun Oct 19 20:55:56 1997
***************
*** 49,61 ****
  /*
   * This is the vfsops table for the file system in question
   */
! extern struct vfsops null_vfsops;
! extern struct vnodeopv_desc null_vnodeop_opv_desc;
  
  /*
   * declare the filesystem
   */
! MOD_VFS("nullfs", -1, &null_vfsops);
  
  /*
   * entry point
--- 49,61 ----
  /*
   * This is the vfsops table for the file system in question
   */
! extern struct vfsops nullfs_vfsops;
! extern struct vnodeopv_desc nullfs_vnodeop_opv_desc;
  
  /*
   * declare the filesystem
   */
! MOD_VFS("nullfs", -1, &nullfs_vfsops);
  
  /*
   * entry point
*************** nullfs_lkmentry(lkmtp, cmd, ver)
*** 71,78 ****
  	 * opv_desc is listed in vfs_opv_descs[] in vfs_conf.c.  For
  	 * loaded modules, we have to do it manually.
  	 */
! 	vfs_opv_init_explicit(&null_vnodeop_opv_desc);
! 	vfs_opv_init_default(&null_vnodeop_opv_desc);
  
  	DISPATCH(lkmtp, cmd, ver, lkm_nofunc, lkm_nofunc, lkm_nofunc)
  }
--- 71,78 ----
  	 * opv_desc is listed in vfs_opv_descs[] in vfs_conf.c.  For
  	 * loaded modules, we have to do it manually.
  	 */
! 	vfs_opv_init_explicit(&nullfs_vnodeop_opv_desc);
! 	vfs_opv_init_default(&nullfs_vnodeop_opv_desc);
  
  	DISPATCH(lkmtp, cmd, ver, lkm_nofunc, lkm_nofunc, lkm_nofunc)
  }
>Audit-Trail:
>Unformatted: