diff options
author | Badari Pulavarty <pbadari@us.ibm.com> | 2007-06-16 13:15:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-06-16 16:16:15 -0400 |
commit | 30475cc12a50816f290828fb7e3cd7036cd622df (patch) | |
tree | 3195db2642d29568057a11a62889a9a8b67a9cfe /ipc/shm.c | |
parent | dd08c40e3e23f868eb0e49f638eb208736ec7e66 (diff) |
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 <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>
Diffstat (limited to 'ipc/shm.c')
-rw-r--r-- | ipc/shm.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -397,6 +397,11 @@ static int newseg (struct ipc_namespace *ns, key_t key, int shmflg, size_t size) | |||
397 | shp->shm_nattch = 0; | 397 | shp->shm_nattch = 0; |
398 | shp->id = shm_buildid(ns, id, shp->shm_perm.seq); | 398 | shp->id = shm_buildid(ns, id, shp->shm_perm.seq); |
399 | shp->shm_file = file; | 399 | shp->shm_file = file; |
400 | /* | ||
401 | * shmid gets reported as "inode#" in /proc/pid/maps. | ||
402 | * proc-ps tools use this. Changing this will break them. | ||
403 | */ | ||
404 | file->f_dentry->d_inode->i_ino = shp->id; | ||
400 | 405 | ||
401 | ns->shm_tot += numpages; | 406 | ns->shm_tot += numpages; |
402 | shm_unlock(shp); | 407 | shm_unlock(shp); |