Re: [vserver] linux 3.10.21 and patch-3.10.19-vs2.3.6.8.diff

From: Corey Wright <undefined_at_pobox.com>
Date: Sat 30 Nov 2013 - 15:37:09 GMT
Message-Id: <20131130093709.1e24002418b9b520b9390c0f@pobox.com>

On Sat, 30 Nov 2013 09:42:32 +0100
Herbert Poetzl <herbert@13thfloor.at> wrote:

> On Fri, Nov 29, 2013 at 07:28:27PM -0600, Corey Wright wrote:
> > applying patch-3.10.19-vs2.3.6.8.diff to linux-3.10.21 fails:
>
> > patching file ipc/shm.c
> > Hunk #2 FAILED at 210.
> > Hunk #3 FAILED at 219.
> > Hunk #4 succeeded at 499 (offset 3 lines).
> > Hunk #5 succeeded at 576 (offset 3 lines).
> > 2 out of 5 hunks FAILED -- saving rejects to file ipc/shm.c.rej
>
> > the failure is due to this commit in 3.10.21:
>
> > http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?h=linux-3.10.y&id=b444df2f5791fb1ddf7d6b771ee32e30cc29dad9
>
> > the attached patch fixes the failure (and Makefile's EXTRAVERSION, too).
>
> > instructions:
> > 1. download linux-3.10.21 (or patch linux-3.10.20, etc)
> > 2. apply patch-3.10.19-vs2.3.6.8.diff
> > 3. apply the attached patch-3.10.19-21-vs2.3.6.8.diff
>
> > i've built and tested the resulting kernel against testme.sh
> > and testfs.sh in virtualbox (and will put into production in 24
> > hours if no bugs are reported in linux-3.10.21).
>
> Thanks! Appreciated!
>
> I've uploaded an updated patch for 3.10.21, please
> compare it to your results and let me know if there
> are any differences.

no functional differences based on my analysis.

the only formatting difference is you keep all the declarations together in
shm_destroy() (adding "struct vx_info *vxi" and "int numpages" right after
upstream's "struct file *shm_file"), but since the added declarations have
non-trivial initialization (and break c89), i decided to take full advantage
of c99 and just keep all the linux-vserver changes together (and there
doesn't appear to be any interaction between the upstream changes with
shp->shm_file and the linux-vserver patch with shp->shm_perm.xid and
shp->shm_segsz, so the order doesn't matter).

thanks for the official 3.10.21 patch.

corey

--
undefined@pobox.com
> Thanks again,
> Herbert
> 
> > corey
> > --
> > undefined@pobox.com
> 
> > diff -urNpd a/linux-3.10.21-vs2.3.6.8/ipc/shm.c b/linux-3.10.21-vs2.3.6.8/ipc/shm.c
> > --- a/linux-3.10.21-vs2.3.6.8/ipc/shm.c	2013-11-29 15:47:58.000000000 -0600
> > +++ b/linux-3.10.21-vs2.3.6.8/ipc/shm.c	2013-11-29 16:21:32.000000000 -0600
> > @@ -214,7 +214,13 @@ static void shm_destroy(struct ipc_names
> 
> >  	shm_file = shp->shm_file;
> >  	shp->shm_file = NULL;
> > -	ns->shm_tot -= (shp->shm_segsz + PAGE_SIZE - 1) >> PAGE_SHIFT;
> > +
> > +	struct vx_info *vxi = lookup_vx_info(shp->shm_perm.xid);
> > +	int numpages = (shp->shm_segsz + PAGE_SIZE - 1) >> PAGE_SHIFT;
> > +
> > +	vx_ipcshm_sub(vxi, shp, numpages);
> > +	ns->shm_tot -= numpages;
> > +
> >  	shm_rmid(ns, shp);
> >  	shm_unlock(shp);
> >  	if (!is_file_hugepages(shm_file))
> > @@ -222,6 +228,7 @@ static void shm_destroy(struct ipc_names
> >  	else if (shp->mlock_user)
> >  		user_shm_unlock(file_inode(shm_file)->i_size, shp->mlock_user);
> >  	fput(shm_file);
> > +	put_vx_info(vxi);
> >  	ipc_rcu_putref(shp, shm_rcu_free);
> >  }
> 
> > diff -urNpd a/linux-3.10.21-vs2.3.6.8/Makefile b/linux-3.10.21-vs2.3.6.8/Makefile
> > --- a/linux-3.10.21-vs2.3.6.8/Makefile	2013-11-29 15:38:14.000000000 -0600
> > +++ b/linux-3.10.21-vs2.3.6.8/Makefile	2013-11-29 15:50:03.000000000 -0600
> > @@ -1,7 +1,7 @@
> >  VERSION = 3
> >  PATCHLEVEL = 10
> >  SUBLEVEL = 21
> > -EXTRAVERSION =
> > +EXTRAVERSION = -vs2.3.6.8
> >  NAME = TOSSUG Baby Fish
> 
> >  # *DOCUMENTATION*
Received on Sat Nov 30 15:37:19 2013
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Sat 30 Nov 2013 - 15:37:19 GMT by hypermail 2.1.8