Date: Mon, 27 Dec 2004 15:01:38 GMT From: Sergiy Vyshnevetskiy <serg@vostok.net> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/75542: Inconsistent naming of a tunable and weird code in sysvshm module Message-ID: <200412271501.iBRF1c41073800@www.freebsd.org> Resent-Message-ID: <200412271510.iBRFADDB067075@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 75542 >Category: kern >Synopsis: Inconsistent naming of a tunable and weird code in sysvshm module >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Dec 27 15:10:13 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Sergiy Vyshnevetskiy >Release: 5-stable >Organization: >Environment: FreeBSD serg.vostok.net 5.3-STABLE FreeBSD 5.3-STABLE #0: Mon Dec 6 11:01:12 EET 2004 root@serg.vostok.net:/usr/5/src/sys/i386/compile/SERG i386 >Description: kern.ipc.shmmaxpgs tunable is accessible as kern.ipc.shmall with sysctl. Meaningless code near it's definition. >How-To-Repeat: Remove options SYSVSHM from your kernel configuration file. Recompile kernel and reboot. Load sysvshm module. You will have to use kern.ipc.shmmaxpgs tunable but will see it as kern.ipc.shmall in sysctl output. >Fix: --- sys/kern/sysv_shm.c.orig Fri Dec 3 17:02:20 2004 +++ sys/kern/sysv_shm.c Fri Dec 3 17:04:58 2004 @@ -863,12 +863,8 @@ { int i; - TUNABLE_INT_FETCH("kern.ipc.shmmaxpgs", &shminfo.shmall); - for (i = PAGE_SIZE; i > 0; i--) { - shminfo.shmmax = shminfo.shmall * PAGE_SIZE; - if (shminfo.shmmax >= shminfo.shmall) - break; - } + TUNABLE_INT_FETCH("kern.ipc.shmall", &shminfo.shmall); + shminfo.shmmax = shminfo.shmall * PAGE_SIZE; TUNABLE_INT_FETCH("kern.ipc.shmmin", &shminfo.shmmin); TUNABLE_INT_FETCH("kern.ipc.shmmni", &shminfo.shmmni); TUNABLE_INT_FETCH("kern.ipc.shmseg", &shminfo.shmseg); >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200412271501.iBRF1c41073800>