[CRIU] Re: [PATCH] IPC: set IPC_PRIVATE key always on semctl syscall

Pavel Emelyanov xemul at parallels.com
Thu Aug 9 07:55:48 EDT 2012


On 08/09/2012 03:48 PM, Stanislav Kinsbursky wrote:
> IPC_PRIVATE key is equal to zero. And there could be more than one object with
> such key. So no need to check either this key is used already. Just asssign it
> to IPC object.
> ---
>  ipc/util.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/ipc/util.c b/ipc/util.c
> index 7b1a2d8..d1e2f25 100644
> --- a/ipc/util.c
> +++ b/ipc/util.c
> @@ -779,7 +779,7 @@ int ipc_update_key(struct ipc_ids *ids, struct ipc64_perm *in,
>  		    struct kern_ipc_perm *out)
>  {
>  
> -	if (out->key != in->key) {
> +	if (in->key && out->key != in->key) {
>  		/*
>  		 * Check for existent segment with the same key.
>  		 * Note: ipc_ids.rw_mutex is taken for write already.
> 

Ack.

Cyrill, when you will be pushing this to github, take this series as well:
http://patchwork.ozlabs.org/patch/176013/
http://patchwork.ozlabs.org/patch/176014/
http://patchwork.ozlabs.org/patch/176015/
http://patchwork.ozlabs.org/patch/176016/
http://patchwork.ozlabs.org/patch/176017/


More information about the CRIU mailing list