Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Dec 2001 21:20:49 +0100
From:      Dimitry Andric <dim@xs4all.nl>
To:        freebsd-stable@freebsd.org
Subject:   Can't link smbfs statically into kernel
Message-ID:  <136964834.20011223212049@xs4all.nl>

next in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

After seeing that smbfs and its corresponding tools have (finally!)
made it into 4.5-PRERELEASE, I wanted to try getting rid of the smbfs
module again, by statically linking it into the kernel. I updated
kernel + world to -PRERELEASE, and added the following lines to my
kernel config:

  options         NETSMB                  #SMB/CIFS requester
  options         NETSMBCRYPTO            #encrypted password support for SMB
  options         LIBMCHAIN               #mbuf management library
  options         LIBICONV                #Kernel side iconv library

However, this causes mount_smbfs to fail:

  % sudo mount_smbfs //luser@winbox/share /mnt
  module_register: module dev_netsmb already exists!
  linker_file_sysinit "smbfs.ko" failed to register! 17
  mount_smbfs: vfsload(smbfs): File exists

It is caused by mount_smbfs not being able to find smbfs as a
configured filesystem, via getvfsbyname(3). (This seems like a bug to
me.) Then it of course tries to load smbfs, via vfsload(3), which
fails too, because it is already present.

Even though mount_smbfs gives this error, there still seems to be a
smbfs LKM loaded anyway, which can't be unloaded anymore:

  % kldstat
  Id Refs Address    Size     Name
   1    3 0xc0100000 1fb1bc   kernel
   2    1 0xc0984000 14000    linux.ko
   3    1 0xc0a14000 1a000    smbfs.ko
  % sudo kldunload smbfs
  linkerunload: attempt to unload file that was loaded by the kernel
  kldunload: can't unload file: Device busy

But smbfs isn't part of the list of vfs's:

  % vfslist
  index 1: msdos (refcount 0, flags 0x0)
  index 2: nfs (refcount 0, flags 0x20000)
  index 3: procfs (refcount 1, flags 0x80000)
  index 4: mfs (refcount 0, flags 0x0)
  index 5: ufs (refcount 5, flags 0x0)
  index 6: cd9660 (refcount 0, flags 0x40000)

Is there any way to statically link smbfs into the kernel, or is it
"module-only"? If that is the case, please remove the NETSMB option
from LINT, which could perhaps minimize confusions about it.

Cheers,
- --
Dimitry Andric <dim@xs4all.nl>
PGP Key: http://www.xs4all.nl/~dim/dim.asc
Fingerprint: 7AB462D2CE35FC6D42394FCDB05EA30A2E2096A3
Lbh ner abj va ivbyngvba bs gur QZPN

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5i
Comment: http://www.gn.apc.org/duncan/stoa_cover.htm

iQA/AwUBPCYumrBeowouIJajEQKdHgCg8rR08EDaq+waaLmmvzViQzTM05sAn2Jb
xU8Tjn9lR+vFes2HLY2yf51d
=4DD3
-----END PGP SIGNATURE-----


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?136964834.20011223212049>