lkml.org 
[lkml]   [2004]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] remove magic +1 from shm segment count
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>
--- 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);
}

\
 
 \ /
  Last update: 2005-03-22 14:05    [W:0.033 / U:2.980 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site