From: Badari Pulavarty Date: Sat, 16 Jun 2007 17:15:59 +0000 (-0700) Subject: Restore shmid as inode# to fix /proc/pid/maps ABI breakage X-Git-Tag: v2.6.22-rc5~18 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=30475cc12a50816f290828fb7e3cd7036cd622df;p=karo-tx-linux.git Restore shmid as inode# to fix /proc/pid/maps ABI breakage shmid used to be stored as inode# for shared memory segments. Some of the proc-ps tools use this from /proc/pid/maps. Recent cleanups to newseg() changed it. This patch sets inode number back to shared memory id to fix breakage. Signed-off-by: Badari Pulavarty Cc: "Albert Cahalan" Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/ipc/shm.c b/ipc/shm.c index 4fefbad7096d..02faa54dbf5a 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -397,6 +397,11 @@ static int newseg (struct ipc_namespace *ns, key_t key, int shmflg, size_t size) shp->shm_nattch = 0; shp->id = shm_buildid(ns, id, shp->shm_perm.seq); shp->shm_file = file; + /* + * shmid gets reported as "inode#" in /proc/pid/maps. + * proc-ps tools use this. Changing this will break them. + */ + file->f_dentry->d_inode->i_ino = shp->id; ns->shm_tot += numpages; shm_unlock(shp);