kern/75542: Inconsistent naming of a tunable and weird code in
sysvshm module
Sergiy Vyshnevetskiy
serg at vostok.net
Mon Dec 27 07:10:14 PST 2004
>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 at 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:
More information about the freebsd-bugs
mailing list