[CRIU] Re: [PATCH 1/2] ipc: add new flag for preset shmem id on creation

Cyrill Gorcunov gorcunov at openvz.org
Fri Feb 3 11:55:14 EST 2012


On Fri, Feb 03, 2012 at 08:06:05PM +0400, Cyrill Gorcunov wrote:
> On Thu, Feb 02, 2012 at 05:07:49PM +0400, Stanislav Kinsbursky wrote:
> > This patch is required for checkpoint/restore of IPC shared memory segments.
> > 
> ...
> > diff --git a/ipc/util.c b/ipc/util.c
> > index 75261a3..9078560 100644
> > --- a/ipc/util.c
> > +++ b/ipc/util.c
> > @@ -264,7 +264,7 @@ int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size)
> >  	rcu_read_lock();
> >  	spin_lock(&new->lock);
> >  
> > -	err = idr_get_new(&ids->ipcs_idr, new, &id);
> > +	err = idr_get_new_above(&ids->ipcs_idr, new, ipcid_to_idx(new->id), &id);
> 
> Stas, I somehow don't understand this change. Why idr_get_new_above is called
> now and does it mean we choose _not_ first free id but some new one greater
> than some minimum?
> 

Anyway, I've pushed both patches to our kernel repo into crtools-3.3-rc2 branch.

	Cyrill


More information about the CRIU mailing list