Date: Mon, 1 Aug 2011 12:00:27 GMT From: Svatopluk Kraus <onwahe@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/159351: [patch] - divide by zero in mountnfs() Message-ID: <201108011200.p71C0RTS075176@red.freebsd.org> Resent-Message-ID: <201108011210.p71CA5AB074528@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108011200.p71C0RTS075176>