Skip to content

Commit

Permalink
Restore shmid as inode# to fix /proc/pid/maps ABI breakage
Browse files Browse the repository at this point in the history
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 <pbadari@us.ibm.com>
Cc: "Albert Cahalan" <acahalan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Badari Pulavarty authored and Linus Torvalds committed Jun 16, 2007
1 parent dd08c40 commit 30475cc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ipc/shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 30475cc

Please sign in to comment.