[RFC v14-rc2][PATCH 4/7] sysvipc-shm: restart

Matt Helsley matthltc at us.ibm.com
Thu Apr 2 20:42:58 PDT 2009


On Tue, Mar 31, 2009 at 01:32:29AM -0400, Oren Laadan wrote:
> Like chekcpoint, restart of sysvipc shared memory is also performed in
> two steps: first, the entire ipc namespace is restored as a whole, by
> restoring each shm object read from the checkpoint image. The shmem's
> file pointer is registered in the objhash. Second, for each vma that
> refers to ipc shared memory, we use the objref to find the file in the
> objhash, and use that file in calling do_mmap_pgoff().
> 
> Handling of shm objects that have been deleted (via IPC_RMID) is left
> to a later patch in this series.
> 
> Handling of ipc shm mappings that are locked (via SHM_MLOCK) is also
> not restored at the moment.
> 
> Signed-off-by: Oren Laadan <orenl at cs.columbia.edu>
> ---
>  checkpoint/rstr_mem.c      |   23 ++++++
>  checkpoint/util_ipc.c      |    2 +-
>  include/linux/checkpoint.h |    3 +
>  ipc/ckpt_shm.c             |  167 +++++++++++++++++++++++++++++++++++++++++++-
>  4 files changed, 193 insertions(+), 2 deletions(-)

<snip>
 
> diff --git a/ipc/ckpt_shm.c b/ipc/ckpt_shm.c
> index 6a9382a..ee9b77a 100644
> --- a/ipc/ckpt_shm.c
> +++ b/ipc/ckpt_shm.c
> @@ -14,6 +14,7 @@
>  #include <linux/hugetlb.h>
>  #include <linux/rwsem.h>
>  #include <linux/sched.h>
> +#include <linux/file.h>
>  #include <linux/syscalls.h>
>  #include <linux/nsproxy.h>
>  #include <linux/ipc_namespace.h>
> @@ -45,7 +46,10 @@ static int cr_fill_ipc_shm_hdr(struct cr_ctx *ctx,
>  	hh->shm_cprid = shp->shm_cprid;
>  	hh->shm_lprid = shp->shm_lprid;
> 
> -	hh->mlock_uid = (shp->mlock_user ? shp->mlock_user->uid : UINT_MAX);
> +	if (shp->mlock_user)
> +		hh->mlock_uid = shp->mlock_user->uid;
> +	else
> +		hh->mlock_uid = (unsigned int) -1;

I think this hunk should be merged with the patch introducing the conditional
expression rather than appear in this patch.

Cheers,
	-Matt Helsley


More information about the Containers mailing list