kern/94830: [patch] mount_nfs causes a fatal trap 18 if the value of desiredvnodes is below 1000

Fabian Keil freebsd-listen at fabiankeil.de
Wed Mar 22 14:10:20 UTC 2006


>Number:         94830
>Category:       kern
>Synopsis:       [patch] mount_nfs causes a fatal trap 18 if the value of desiredvnodes is below 1000
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 22 14:10:18 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Fabian Keil
>Release:        RELENG_6
>Organization:
>Environment:
FreeBSD samba.local 6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #8: Wed Mar 22 12:39:08 CET 2006     fk at TP51.local:/usr/obj/usr/src/sys/CASABLANCA  i386
>Description:
On a Pentium 90 with 16 MB RAM FreeBSD sets desiredvnodes to 926,
this leads to a panic (Fatal trap 18: integer divide fault while in
kernel mode) if mount_nfs is used.

The panic is caused by line 826 in /usr/src/sys/nfsclient/nfs_vfsops.c:
nmp->nm_wcommitsize = hibufspace / (desiredvnodes / 1000);

desiredvnodes is an integer value, if it is divided by a value
bigger than itself the result is zero.

Kernel configuration:
http://www.fabiankeil.de/tmp/casablanca/CASABLANCA

dmesg:
http://www.fabiankeil.de/tmp/casablanca/dmesg.boot

kgdb backtrace:
http://www.fabiankeil.de/tmp/casablanca/backtrace.txt
>How-To-Repeat:
Use mount_nfs on a machine with a desiredvnodes value below 1000
(or set sysctl kern.maxvnodes to a value below 1000 yourself).
>Fix:
Increase kern.maxvnodes by hand or let
http://www.fabiankeil.de/sourcecode/nfs_vfsops.c.patch
do the job.

I'm not sure if ignoring the kernel's calculations is the right
thing to do, but so far I didn't experience any ill side effects.
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list