* [PATCH] remove magic +1 from shm segment count
@ 2004-08-08 19:19 Manfred Spraul
0 siblings, 0 replies; only message in thread
From: Manfred Spraul @ 2004-08-08 19:19 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 509 bytes --]
Hi,
Michael Kerrisk found a bug in the shm accounting code:
sysv shm allows to create SHMMNI+1 shared memory segments, instead of
SHMMNI segments. The +1 is probably from the first shared anonymous
mapping implementation that used the sysv code to implement shared anon
mappings.
The implementation got replaced, it's now the other way around (sysv
uses the shared anon code), but the +1 remained.
Andrew - could you add the patch to your tree?
Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
[-- Attachment #2: patch-ipcshm-count --]
[-- Type: text/plain, Size: 317 bytes --]
--- 2.6/ipc/shm.c 2004-08-07 11:14:24.000000000 +0200
+++ build-2.6/ipc/shm.c 2004-08-08 21:10:02.156421648 +0200
@@ -78,7 +78,7 @@
static inline int shm_addid(struct shmid_kernel *shp)
{
- return ipc_addid(&shm_ids, &shp->shm_perm, shm_ctlmni+1);
+ return ipc_addid(&shm_ids, &shp->shm_perm, shm_ctlmni);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-08-08 19:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-08 19:19 [PATCH] remove magic +1 from shm segment count Manfred Spraul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox