kern/159351: [patch] - divide by zero in mountnfs()
Svatopluk Kraus
onwahe at gmail.com
Mon Aug 1 12:10:06 UTC 2011
>Number: 159351
>Category: kern
>Synopsis: [patch] - divide by zero in mountnfs()
>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: Mon Aug 01 12:10:05 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Svatopluk Kraus
>Release: current
>Organization:
>Environment:
>Description:
When nm_wcommitsize is initializing and desiredvnodes is less than 1000 a divide by zero happens.
>How-To-Repeat:
>Fix:
Index: sys/fs/nfsclient/nfs_clvfsops.c
===================================================================
--- sys/fs/nfsclient/nfs_clvfsops.c (revision 224571)
+++ sys/fs/nfsclient/nfs_clvfsops.c (working copy)
@@ -1238,7 +1238,7 @@
nmp->nm_rsize = NFS_RSIZE;
nmp->nm_readdirsize = NFS_READDIRSIZE;
}
- nmp->nm_wcommitsize = hibufspace / (desiredvnodes / 1000);
+ nmp->nm_wcommitsize = hibufspace / (desiredvnodes / 1000 + 1);
nmp->nm_numgrps = NFS_MAXGRPS;
nmp->nm_readahead = NFS_DEFRAHEAD;
nmp->nm_tprintf_delay = nfs_tprintf_delay;
Index: sys/nfsclient/nfs_vfsops.c
===================================================================
--- sys/nfsclient/nfs_vfsops.c (revision 224571)
+++ sys/nfsclient/nfs_vfsops.c (working copy)
@@ -1244,7 +1244,7 @@
nmp->nm_wsize = NFS_WSIZE;
nmp->nm_rsize = NFS_RSIZE;
}
- nmp->nm_wcommitsize = hibufspace / (desiredvnodes / 1000);
+ nmp->nm_wcommitsize = hibufspace / (desiredvnodes / 1000 + 1);
nmp->nm_readdirsize = NFS_READDIRSIZE;
nmp->nm_numgrps = NFS_MAXGRPS;
nmp->nm_readahead = NFS_DEFRAHEAD;
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list