Messages in this thread Patch in this message | | | Date | Sun, 08 Aug 2004 21:19:35 +0200 | From | Manfred Spraul <> | 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); } | |