Subject: linux 3.10.47 and patch-3.10.43-vs2.3.6.8.diff
From: Corey Wright <undefined@pobox.com>
Date: Mon, 7 Jul 2014 16:09:21 -0500
Mon, 7 Jul 2014 16:09:21 -0500
applying patch-3.10.43-vs2.3.6.8.diff to linux 3.10.47 fails.

the upstream change of calling syscall_tracepoint_update() within copy_process
() [1] invalidates the patch context and causes the patch hunk to fail:

patching file kernel/fork.c
Hunk #9 FAILED at 1495.
1 out of 9 hunks FAILED -- saving rejects to file kernel/fork.c.rej

[1]
http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/kernel/fork.c?h=linux-3.10.y&id=e6bc60b8fb412b38db86bc1351f2ce40ad31d0e0

the attached patch adjusts the patch context and fixes Makefile's
EXTRAVERSION, too.  from my novice kernel analysis it doesn't appear to
matter which comes first, the call to syscall_tracepoint_update() or the
failed hunk (assuming CONFIG_TRACEPOINTS & CONFIG_HAVE_SYSCALL_TRACEPOINTS
are defined, otherwise it for sure doesn't matter as syscall_tracepoint_update
() is an empty function and should get optimized out; see
include/trace/syscall.h), but verification would be appreciated (and i placed
syscall_tracepoint_update() before the failed hunk).

instructions:
1. acquire linux-3.10.47
2. apply patch-3.10.43-vs2.3.6.8.diff
3. apply the attached patch-3.10.43-47-vs2.3.6.8.diff

i've successfully built the resulting kernel and tested it in virtualbox
against testme.sh and testfs.sh and started a vserver.

corey
--
undefined@pobox.com


diff -urNpd a/linux-3.10.47-vs2.3.6.8/kernel/fork.c b/linux-3.10.47-vs2.3.6.8/kernel/fork.c
--- a/linux-3.10.47-vs2.3.6.8/kernel/fork.c	2014-07-07 00:11:50.000000000 -0500
+++ b/linux-3.10.47-vs2.3.6.8/kernel/fork.c	2014-07-07 00:13:37.000000000 -0500
@@ -1496,6 +1496,18 @@ static struct task_struct *copy_process(
 	total_forks++;
 	spin_unlock(&current->sighand->siglock);
 	syscall_tracepoint_update(p);
+
+	/* p is copy of current */
+	vxi = p->vx_info;
+	if (vxi) {
+		claim_vx_info(vxi, p);
+		atomic_inc(&vxi->cvirt.nr_threads);
+		atomic_inc(&vxi->cvirt.total_forks);
+		vx_nproc_inc(p);
+	}
+	nxi = p->nx_info;
+	if (nxi)
+		claim_nx_info(nxi, p);
 	write_unlock_irq(&tasklist_lock);
 
 	proc_fork_connector(p);
diff -urNpd a/linux-3.10.47-vs2.3.6.8/Makefile b/linux-3.10.47-vs2.3.6.8/Makefile
--- a/linux-3.10.47-vs2.3.6.8/Makefile	2014-07-06 23:40:19.000000000 -0500
+++ b/linux-3.10.47-vs2.3.6.8/Makefile	2014-07-07 00:09:44.000000000 -0500
@@ -1,7 +1,7 @@
 VERSION = 3
 PATCHLEVEL = 10
 SUBLEVEL = 47
-EXTRAVERSION =
+EXTRAVERSION = -vs2.3.6.8
 NAME = TOSSUG Baby Fish
 
 # *DOCUMENTATION*