kern/51389: smbfs fails to work on SMP kernels.

Steve M Passe smp at timing.com
Thu Apr 24 10:40:21 PDT 2003


>Number:         51389
>Category:       kern
>Synopsis:       smbfs fails to work on SMP kernels.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 24 10:40:19 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Steve M Passe
>Release:        FreeBSD 4.8-RC i386
>Organization:
Timing Solutions Corp.
>Environment:
System: FreeBSD 4.8-RC FreeBSD 4.8-RC #0: Wed Mar 5 11:15:07 MST 2003 /usr/src/sys/compile/LOCAL_MP i386

$FreeBSD: src/sys/netsmb/smb_subr.c,v 1.1.2.2 2001/09/03 08:55:11 bp Exp $

>Description:
The function smb_checksmp() contains the following lines, causing smbfs
to fail on an SMP enabled kernel:

#ifndef	SMP
	if (ncpu > 1) {
		printf("error: module compiled without SMP support\n");
		return EPERM;
	}
#else
	if (ncpu < 2) {
		printf("warning: only one CPU active on in SMP kernel ?\n");
	}
#endif

Specifically, the define of 'SMP' found in opt_global.h doesn't appear to be
passed thru to kmod builds.  The "#ifndef SMP" path is compiled, ncpu is found
to be greater than 1 at runtime, and EPERM is returned.

>How-To-Repeat:
Build an SMP enabled kernel/modules with smbfs.ko, attempt to mount an SMB file
system.

>Fix:
Either arrange for module builds to get opt_global.h included in their builds,
or drop the need for smbfs to care about SMP/UP.

I defined 'SMP' one line above the offending lines, rebuilt smbfs.ko, and have
been using it for several days now without problem.


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list