[packages/kernel/LINUX_4_9] - rel 2; this kernel supports vserver again
arekm
arekm at pld-linux.org
Sun Jan 14 17:41:11 CET 2018
commit cc23e8532699ebdfc0c000d1fcba80df5ce5f232
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sun Jan 14 17:41:01 2018 +0100
- rel 2; this kernel supports vserver again
kernel-vserver-2.3.patch | 6650 ++++++++++++++++++++++------------------------
kernel.spec | 10 +-
2 files changed, 3145 insertions(+), 3515 deletions(-)
---
diff --git a/kernel.spec b/kernel.spec
index 7414b542..78d0b1fb 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -31,7 +31,7 @@
%bcond_without aufs # aufs4 support
-%bcond_with vserver # support for VServer
+%bcond_without vserver # support for VServer
%bcond_with rt # real-time kernel (CONFIG_PREEMPT_RT) for low latencies
@@ -71,7 +71,7 @@
%define have_pcmcia 0
%endif
-%define rel 1
+%define rel 2
%define basever 4.9
%define postver .76
@@ -187,8 +187,8 @@ Patch59: kernel-rndis_host-wm5.patch
# http://patches.aircrack-ng.org/hostap-kernel-2.6.18.patch
Patch85: kernel-hostap.patch
-%define vserver_patch 3.18.5-vs2.3.7.3
-# http://vserver.13thfloor.at/Experimental/patch-3.18.5-vs2.3.7.3.diff
+%define vserver_patch 4.9.76-vs2.3.9.5
+# http://vserver.13thfloor.at/Experimental/patch-4.9.76-vs2.3.9.5.diff
# note there are additional patches from above url:
# - *fix* are real fixes (we want these)
# - *feat* are new features/tests (we don't want these)
@@ -309,7 +309,7 @@ Conflicts: reiserfsprogs < 3.6.3
Conflicts: rpm < 4.4.2-0.2
Conflicts: udev < 1:081
Conflicts: util-linux < 2.10o
-Conflicts: util-vserver < 0.30.216
+Conflicts: util-vserver < 0.30.216-1.pre3126.3
Conflicts: xfsprogs < 2.6.0
%if %{without pae}
ExclusiveArch: i686 pentium3 pentium4 athlon
diff --git a/kernel-vserver-2.3.patch b/kernel-vserver-2.3.patch
index 1f7aa6f1..5ca43d91 100644
--- a/kernel-vserver-2.3.patch
+++ b/kernel-vserver-2.3.patch
@@ -1,6 +1,6 @@
-diff -NurpP --minimal linux-3.18.5/Documentation/vserver/debug.txt linux-3.18.5-vs2.3.7.3/Documentation/vserver/debug.txt
---- linux-3.18.5/Documentation/vserver/debug.txt 1970-01-01 00:00:00.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/Documentation/vserver/debug.txt 2015-01-19 10:57:45.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/Documentation/vserver/debug.txt linux-4.9.76-vs2.3.9.5/Documentation/vserver/debug.txt
+--- linux-4.9.76/Documentation/vserver/debug.txt 1970-01-01 00:00:00.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/Documentation/vserver/debug.txt 2018-01-10 02:50:49.000000000 +0000
@@ -0,0 +1,154 @@
+
+debug_cvirt:
@@ -35,12 +35,12 @@ diff -NurpP --minimal linux-3.18.5/Documentation/vserver/debug.txt linux-3.18.5-
+ "vroot[%d]_get_real_bdev: dev=%p[%lu,%d:%d]"
+ "vroot[%d]_set_dev: dev=%p[%lu,%d:%d]"
+ "vroot_get_real_bdev not set"
-+ 1 2 "cow_break_link(�%s�)"
-+ "temp copy �%s�"
++ 1 2 "cow_break_link(?%s?)"
++ "temp copy ?%s?"
+ 2 4 "dentry_open(new): %p"
+ "dentry_open(old): %p"
+ "lookup_create(new): %p"
-+ "old path �%s�"
++ "old path ?%s?"
+ "path_lookup(old): %d"
+ "vfs_create(new): %d"
+ "vfs_rename: %d"
@@ -108,7 +108,7 @@ diff -NurpP --minimal linux-3.18.5/Documentation/vserver/debug.txt linux-3.18.5-
+
+debug_tag:
+
-+ 7 80 "dx_parse_tag(�%s�): %d:#%d"
++ 7 80 "dx_parse_tag(?%s?): %d:#%d"
+ "dx_propagate_tag(%p[#%lu.%d]): %d,%d"
+
+debug_xid:
@@ -156,10 +156,10 @@ diff -NurpP --minimal linux-3.18.5/Documentation/vserver/debug.txt linux-3.18.5-
+ m 2^m "vx_acc_page[%5d,%s,%2d]: %5d%s"
+ "vx_acc_pages[%5d,%s,%2d]: %5d += %5d"
+ "vx_pages_avail[%5d,%s,%2d]: %5ld > %5d + %5d"
-diff -NurpP --minimal linux-3.18.5/arch/alpha/Kconfig linux-3.18.5-vs2.3.7.3/arch/alpha/Kconfig
---- linux-3.18.5/arch/alpha/Kconfig 2014-06-12 13:00:27.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/alpha/Kconfig 2015-01-19 10:57:45.000000000 +0000
-@@ -740,6 +740,8 @@ config DUMMY_CONSOLE
+diff -NurpP --minimal linux-4.9.76/arch/alpha/Kconfig linux-4.9.76-vs2.3.9.5/arch/alpha/Kconfig
+--- linux-4.9.76/arch/alpha/Kconfig 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/alpha/Kconfig 2018-01-10 02:50:49.000000000 +0000
+@@ -743,6 +743,8 @@ config DUMMY_CONSOLE
depends on VGA_HOSE
default y
@@ -168,9 +168,9 @@ diff -NurpP --minimal linux-3.18.5/arch/alpha/Kconfig linux-3.18.5-vs2.3.7.3/arc
source "security/Kconfig"
source "crypto/Kconfig"
-diff -NurpP --minimal linux-3.18.5/arch/alpha/kernel/systbls.S linux-3.18.5-vs2.3.7.3/arch/alpha/kernel/systbls.S
---- linux-3.18.5/arch/alpha/kernel/systbls.S 2015-01-16 22:18:10.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/alpha/kernel/systbls.S 2015-01-19 10:57:45.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/arch/alpha/kernel/systbls.S linux-4.9.76-vs2.3.9.5/arch/alpha/kernel/systbls.S
+--- linux-4.9.76/arch/alpha/kernel/systbls.S 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/alpha/kernel/systbls.S 2018-01-10 02:50:49.000000000 +0000
@@ -446,7 +446,7 @@ sys_call_table:
.quad sys_stat64 /* 425 */
.quad sys_lstat64
@@ -180,10 +180,10 @@ diff -NurpP --minimal linux-3.18.5/arch/alpha/kernel/systbls.S linux-3.18.5-vs2.
.quad sys_ni_syscall /* sys_mbind */
.quad sys_ni_syscall /* sys_get_mempolicy */
.quad sys_ni_syscall /* sys_set_mempolicy */
-diff -NurpP --minimal linux-3.18.5/arch/alpha/kernel/traps.c linux-3.18.5-vs2.3.7.3/arch/alpha/kernel/traps.c
---- linux-3.18.5/arch/alpha/kernel/traps.c 2014-01-22 20:38:10.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/alpha/kernel/traps.c 2015-01-19 10:57:45.000000000 +0000
-@@ -175,7 +175,8 @@ die_if_kernel(char * str, struct pt_regs
+diff -NurpP --minimal linux-4.9.76/arch/alpha/kernel/traps.c linux-4.9.76-vs2.3.9.5/arch/alpha/kernel/traps.c
+--- linux-4.9.76/arch/alpha/kernel/traps.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/alpha/kernel/traps.c 2018-01-10 02:50:49.000000000 +0000
+@@ -174,7 +174,8 @@ die_if_kernel(char * str, struct pt_regs
#ifdef CONFIG_SMP
printk("CPU %d ", hard_smp_processor_id());
#endif
@@ -193,10 +193,10 @@ diff -NurpP --minimal linux-3.18.5/arch/alpha/kernel/traps.c linux-3.18.5-vs2.3.
dik_show_regs(regs, r9_15);
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
dik_show_trace((unsigned long *)(regs+1));
-diff -NurpP --minimal linux-3.18.5/arch/arm/Kconfig linux-3.18.5-vs2.3.7.3/arch/arm/Kconfig
---- linux-3.18.5/arch/arm/Kconfig 2015-01-17 02:39:30.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/arm/Kconfig 2015-01-19 10:57:45.000000000 +0000
-@@ -2170,6 +2170,8 @@ source "fs/Kconfig"
+diff -NurpP --minimal linux-4.9.76/arch/arm/Kconfig linux-4.9.76-vs2.3.9.5/arch/arm/Kconfig
+--- linux-4.9.76/arch/arm/Kconfig 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/arm/Kconfig 2018-01-10 02:50:49.000000000 +0000
+@@ -2199,6 +2199,8 @@ source "fs/Kconfig"
source "arch/arm/Kconfig.debug"
@@ -205,9 +205,9 @@ diff -NurpP --minimal linux-3.18.5/arch/arm/Kconfig linux-3.18.5-vs2.3.7.3/arch/
source "security/Kconfig"
source "crypto/Kconfig"
-diff -NurpP --minimal linux-3.18.5/arch/arm/kernel/calls.S linux-3.18.5-vs2.3.7.3/arch/arm/kernel/calls.S
---- linux-3.18.5/arch/arm/kernel/calls.S 2015-01-17 02:39:31.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/arm/kernel/calls.S 2015-01-19 10:57:45.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/arch/arm/kernel/calls.S linux-4.9.76-vs2.3.9.5/arch/arm/kernel/calls.S
+--- linux-4.9.76/arch/arm/kernel/calls.S 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/arm/kernel/calls.S 2018-01-10 02:50:49.000000000 +0000
@@ -322,7 +322,7 @@
/* 310 */ CALL(sys_request_key)
CALL(sys_keyctl)
@@ -217,24 +217,24 @@ diff -NurpP --minimal linux-3.18.5/arch/arm/kernel/calls.S linux-3.18.5-vs2.3.7.
CALL(sys_ioprio_set)
/* 315 */ CALL(sys_ioprio_get)
CALL(sys_inotify_init)
-diff -NurpP --minimal linux-3.18.5/arch/arm/kernel/traps.c linux-3.18.5-vs2.3.7.3/arch/arm/kernel/traps.c
---- linux-3.18.5/arch/arm/kernel/traps.c 2015-01-17 02:39:31.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/arm/kernel/traps.c 2015-01-19 10:57:45.000000000 +0000
-@@ -250,8 +250,8 @@ static int __die(const char *str, int er
+diff -NurpP --minimal linux-4.9.76/arch/arm/kernel/traps.c linux-4.9.76-vs2.3.9.5/arch/arm/kernel/traps.c
+--- linux-4.9.76/arch/arm/kernel/traps.c 2018-01-13 21:28:37.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/arm/kernel/traps.c 2018-01-10 02:50:49.000000000 +0000
+@@ -278,8 +278,8 @@ static int __die(const char *str, int er
print_modules();
__show_regs(regs);
-- printk(KERN_EMERG "Process %.*s (pid: %d, stack limit = 0x%p)\n",
-- TASK_COMM_LEN, tsk->comm, task_pid_nr(tsk), end_of_stack(tsk));
-+ printk(KERN_EMERG "Process %.*s (pid: %d:#%u, stack limit = 0x%p)\n",
-+ TASK_COMM_LEN, tsk->comm, task_pid_nr(tsk), tsk->xid, end_of_stack(tsk));
+- pr_emerg("Process %.*s (pid: %d, stack limit = 0x%p)\n",
+- TASK_COMM_LEN, tsk->comm, task_pid_nr(tsk), end_of_stack(tsk));
++ pr_emerg("Process %.*s (pid: %d:%u, stack limit = 0x%p)\n",
++ TASK_COMM_LEN, tsk->comm, task_pid_nr(tsk), tsk->xid, end_of_stack(tsk));
if (!user_mode(regs) || in_interrupt()) {
dump_mem(KERN_EMERG, "Stack: ", regs->ARM_sp,
-diff -NurpP --minimal linux-3.18.5/arch/cris/Kconfig linux-3.18.5-vs2.3.7.3/arch/cris/Kconfig
---- linux-3.18.5/arch/cris/Kconfig 2014-06-12 13:00:42.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/cris/Kconfig 2015-01-19 10:57:45.000000000 +0000
-@@ -556,6 +556,8 @@ source "fs/Kconfig"
+diff -NurpP --minimal linux-4.9.76/arch/cris/Kconfig linux-4.9.76-vs2.3.9.5/arch/cris/Kconfig
+--- linux-4.9.76/arch/cris/Kconfig 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/cris/Kconfig 2018-01-10 02:50:49.000000000 +0000
+@@ -583,6 +583,8 @@ source "fs/Kconfig"
source "arch/cris/Kconfig.debug"
@@ -243,10 +243,10 @@ diff -NurpP --minimal linux-3.18.5/arch/cris/Kconfig linux-3.18.5-vs2.3.7.3/arch
source "security/Kconfig"
source "crypto/Kconfig"
-diff -NurpP --minimal linux-3.18.5/arch/ia64/Kconfig linux-3.18.5-vs2.3.7.3/arch/ia64/Kconfig
---- linux-3.18.5/arch/ia64/Kconfig 2015-01-16 22:18:19.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/ia64/Kconfig 2015-01-19 10:57:45.000000000 +0000
-@@ -636,6 +636,8 @@ source "fs/Kconfig"
+diff -NurpP --minimal linux-4.9.76/arch/ia64/Kconfig linux-4.9.76-vs2.3.9.5/arch/ia64/Kconfig
+--- linux-4.9.76/arch/ia64/Kconfig 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/ia64/Kconfig 2018-01-10 02:50:49.000000000 +0000
+@@ -602,6 +602,8 @@ source "fs/Kconfig"
source "arch/ia64/Kconfig.debug"
@@ -255,10 +255,10 @@ diff -NurpP --minimal linux-3.18.5/arch/ia64/Kconfig linux-3.18.5-vs2.3.7.3/arch
source "security/Kconfig"
source "crypto/Kconfig"
-diff -NurpP --minimal linux-3.18.5/arch/ia64/kernel/entry.S linux-3.18.5-vs2.3.7.3/arch/ia64/kernel/entry.S
---- linux-3.18.5/arch/ia64/kernel/entry.S 2015-01-17 02:39:35.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/ia64/kernel/entry.S 2015-01-19 10:57:45.000000000 +0000
-@@ -1706,7 +1706,7 @@ sys_call_table:
+diff -NurpP --minimal linux-4.9.76/arch/ia64/kernel/entry.S linux-4.9.76-vs2.3.9.5/arch/ia64/kernel/entry.S
+--- linux-4.9.76/arch/ia64/kernel/entry.S 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/ia64/kernel/entry.S 2018-01-10 02:50:49.000000000 +0000
+@@ -1697,7 +1697,7 @@ sys_call_table:
data8 sys_mq_notify
data8 sys_mq_getsetattr
data8 sys_kexec_load
@@ -267,9 +267,9 @@ diff -NurpP --minimal linux-3.18.5/arch/ia64/kernel/entry.S linux-3.18.5-vs2.3.7
data8 sys_waitid // 1270
data8 sys_add_key
data8 sys_request_key
-diff -NurpP --minimal linux-3.18.5/arch/ia64/kernel/ptrace.c linux-3.18.5-vs2.3.7.3/arch/ia64/kernel/ptrace.c
---- linux-3.18.5/arch/ia64/kernel/ptrace.c 2015-01-17 02:39:35.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/ia64/kernel/ptrace.c 2015-01-19 10:57:45.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/arch/ia64/kernel/ptrace.c linux-4.9.76-vs2.3.9.5/arch/ia64/kernel/ptrace.c
+--- linux-4.9.76/arch/ia64/kernel/ptrace.c 2018-01-13 21:28:38.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/ia64/kernel/ptrace.c 2018-01-10 02:50:49.000000000 +0000
@@ -21,6 +21,7 @@
#include <linux/regset.h>
#include <linux/elf.h>
@@ -278,9 +278,9 @@ diff -NurpP --minimal linux-3.18.5/arch/ia64/kernel/ptrace.c linux-3.18.5-vs2.3.
#include <asm/pgtable.h>
#include <asm/processor.h>
-diff -NurpP --minimal linux-3.18.5/arch/ia64/kernel/traps.c linux-3.18.5-vs2.3.7.3/arch/ia64/kernel/traps.c
---- linux-3.18.5/arch/ia64/kernel/traps.c 2015-01-17 02:39:35.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/ia64/kernel/traps.c 2015-01-19 10:57:45.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/arch/ia64/kernel/traps.c linux-4.9.76-vs2.3.9.5/arch/ia64/kernel/traps.c
+--- linux-4.9.76/arch/ia64/kernel/traps.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/ia64/kernel/traps.c 2018-01-10 02:50:49.000000000 +0000
@@ -60,8 +60,9 @@ die (const char *str, struct pt_regs *re
put_cpu();
@@ -305,9 +305,9 @@ diff -NurpP --minimal linux-3.18.5/arch/ia64/kernel/traps.c linux-3.18.5-vs2.3.7
}
}
}
-diff -NurpP --minimal linux-3.18.5/arch/m32r/kernel/traps.c linux-3.18.5-vs2.3.7.3/arch/m32r/kernel/traps.c
---- linux-3.18.5/arch/m32r/kernel/traps.c 2013-07-14 17:00:26.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/m32r/kernel/traps.c 2015-01-19 10:57:45.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/arch/m32r/kernel/traps.c linux-4.9.76-vs2.3.9.5/arch/m32r/kernel/traps.c
+--- linux-4.9.76/arch/m32r/kernel/traps.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/m32r/kernel/traps.c 2018-01-10 02:50:49.000000000 +0000
@@ -184,8 +184,9 @@ static void show_registers(struct pt_reg
} else {
printk("SPI: %08lx\n", sp);
@@ -320,10 +320,10 @@ diff -NurpP --minimal linux-3.18.5/arch/m32r/kernel/traps.c linux-3.18.5-vs2.3.7
/*
* When in-kernel, we also print out the stack and code at the
-diff -NurpP --minimal linux-3.18.5/arch/m68k/Kconfig linux-3.18.5-vs2.3.7.3/arch/m68k/Kconfig
---- linux-3.18.5/arch/m68k/Kconfig 2014-06-12 13:00:43.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/m68k/Kconfig 2015-01-19 10:57:45.000000000 +0000
-@@ -159,6 +159,8 @@ source "fs/Kconfig"
+diff -NurpP --minimal linux-4.9.76/arch/m68k/Kconfig linux-4.9.76-vs2.3.9.5/arch/m68k/Kconfig
+--- linux-4.9.76/arch/m68k/Kconfig 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/m68k/Kconfig 2018-01-10 02:50:49.000000000 +0000
+@@ -163,6 +163,8 @@ source "fs/Kconfig"
source "arch/m68k/Kconfig.debug"
@@ -332,10 +332,10 @@ diff -NurpP --minimal linux-3.18.5/arch/m68k/Kconfig linux-3.18.5-vs2.3.7.3/arch
source "security/Kconfig"
source "crypto/Kconfig"
-diff -NurpP --minimal linux-3.18.5/arch/mips/Kconfig linux-3.18.5-vs2.3.7.3/arch/mips/Kconfig
---- linux-3.18.5/arch/mips/Kconfig 2015-01-17 02:39:35.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/mips/Kconfig 2015-01-19 10:57:45.000000000 +0000
-@@ -2712,6 +2712,8 @@ source "fs/Kconfig"
+diff -NurpP --minimal linux-4.9.76/arch/mips/Kconfig linux-4.9.76-vs2.3.9.5/arch/mips/Kconfig
+--- linux-4.9.76/arch/mips/Kconfig 2018-01-13 21:28:38.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/mips/Kconfig 2018-01-10 02:50:49.000000000 +0000
+@@ -3189,6 +3189,8 @@ source "fs/Kconfig"
source "arch/mips/Kconfig.debug"
@@ -344,10 +344,10 @@ diff -NurpP --minimal linux-3.18.5/arch/mips/Kconfig linux-3.18.5-vs2.3.7.3/arch
source "security/Kconfig"
source "crypto/Kconfig"
-diff -NurpP --minimal linux-3.18.5/arch/mips/kernel/ptrace.c linux-3.18.5-vs2.3.7.3/arch/mips/kernel/ptrace.c
---- linux-3.18.5/arch/mips/kernel/ptrace.c 2015-01-17 02:39:36.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/mips/kernel/ptrace.c 2015-01-19 10:57:45.000000000 +0000
-@@ -29,6 +29,7 @@
+diff -NurpP --minimal linux-4.9.76/arch/mips/kernel/ptrace.c linux-4.9.76-vs2.3.9.5/arch/mips/kernel/ptrace.c
+--- linux-4.9.76/arch/mips/kernel/ptrace.c 2018-01-13 21:28:38.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/mips/kernel/ptrace.c 2018-01-10 02:50:49.000000000 +0000
+@@ -30,6 +30,7 @@
#include <linux/audit.h>
#include <linux/seccomp.h>
#include <linux/ftrace.h>
@@ -355,7 +355,7 @@ diff -NurpP --minimal linux-3.18.5/arch/mips/kernel/ptrace.c linux-3.18.5-vs2.3.
#include <asm/byteorder.h>
#include <asm/cpu.h>
-@@ -544,6 +545,9 @@ long arch_ptrace(struct task_struct *chi
+@@ -687,6 +688,9 @@ long arch_ptrace(struct task_struct *chi
void __user *datavp = (void __user *) data;
unsigned long __user *datalp = (void __user *) data;
@@ -365,10 +365,10 @@ diff -NurpP --minimal linux-3.18.5/arch/mips/kernel/ptrace.c linux-3.18.5-vs2.3.
switch (request) {
/* when I and D space are separate, these will need to be fixed. */
case PTRACE_PEEKTEXT: /* read word at location addr. */
-diff -NurpP --minimal linux-3.18.5/arch/mips/kernel/scall32-o32.S linux-3.18.5-vs2.3.7.3/arch/mips/kernel/scall32-o32.S
---- linux-3.18.5/arch/mips/kernel/scall32-o32.S 2015-01-17 02:39:36.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/mips/kernel/scall32-o32.S 2015-01-19 10:57:45.000000000 +0000
-@@ -501,7 +501,7 @@ EXPORT(sys_call_table)
+diff -NurpP --minimal linux-4.9.76/arch/mips/kernel/scall32-o32.S linux-4.9.76-vs2.3.9.5/arch/mips/kernel/scall32-o32.S
+--- linux-4.9.76/arch/mips/kernel/scall32-o32.S 2018-01-13 21:28:38.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/mips/kernel/scall32-o32.S 2018-01-10 02:50:49.000000000 +0000
+@@ -511,7 +511,7 @@ EXPORT(sys_call_table)
PTR sys_mq_timedreceive
PTR sys_mq_notify /* 4275 */
PTR sys_mq_getsetattr
@@ -377,10 +377,10 @@ diff -NurpP --minimal linux-3.18.5/arch/mips/kernel/scall32-o32.S linux-3.18.5-v
PTR sys_waitid
PTR sys_ni_syscall /* available, was setaltroot */
PTR sys_add_key /* 4280 */
-diff -NurpP --minimal linux-3.18.5/arch/mips/kernel/scall64-64.S linux-3.18.5-vs2.3.7.3/arch/mips/kernel/scall64-64.S
---- linux-3.18.5/arch/mips/kernel/scall64-64.S 2015-01-17 02:39:36.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/mips/kernel/scall64-64.S 2015-01-19 10:57:45.000000000 +0000
-@@ -355,7 +355,7 @@ EXPORT(sys_call_table)
+diff -NurpP --minimal linux-4.9.76/arch/mips/kernel/scall64-64.S linux-4.9.76-vs2.3.9.5/arch/mips/kernel/scall64-64.S
+--- linux-4.9.76/arch/mips/kernel/scall64-64.S 2018-01-13 21:28:38.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/mips/kernel/scall64-64.S 2018-01-10 02:50:49.000000000 +0000
+@@ -348,7 +348,7 @@ EXPORT(sys_call_table)
PTR sys_mq_timedreceive
PTR sys_mq_notify
PTR sys_mq_getsetattr /* 5235 */
@@ -389,10 +389,10 @@ diff -NurpP --minimal linux-3.18.5/arch/mips/kernel/scall64-64.S linux-3.18.5-vs
PTR sys_waitid
PTR sys_ni_syscall /* available, was setaltroot */
PTR sys_add_key
-diff -NurpP --minimal linux-3.18.5/arch/mips/kernel/scall64-n32.S linux-3.18.5-vs2.3.7.3/arch/mips/kernel/scall64-n32.S
---- linux-3.18.5/arch/mips/kernel/scall64-n32.S 2015-01-17 02:39:36.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/mips/kernel/scall64-n32.S 2015-01-19 10:57:45.000000000 +0000
-@@ -348,7 +348,7 @@ EXPORT(sysn32_call_table)
+diff -NurpP --minimal linux-4.9.76/arch/mips/kernel/scall64-n32.S linux-4.9.76-vs2.3.9.5/arch/mips/kernel/scall64-n32.S
+--- linux-4.9.76/arch/mips/kernel/scall64-n32.S 2018-01-13 21:28:38.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/mips/kernel/scall64-n32.S 2018-01-10 02:50:49.000000000 +0000
+@@ -343,7 +343,7 @@ EXPORT(sysn32_call_table)
PTR compat_sys_mq_timedreceive
PTR compat_sys_mq_notify
PTR compat_sys_mq_getsetattr
@@ -401,10 +401,10 @@ diff -NurpP --minimal linux-3.18.5/arch/mips/kernel/scall64-n32.S linux-3.18.5-v
PTR compat_sys_waitid
PTR sys_ni_syscall /* available, was setaltroot */
PTR sys_add_key
-diff -NurpP --minimal linux-3.18.5/arch/mips/kernel/scall64-o32.S linux-3.18.5-vs2.3.7.3/arch/mips/kernel/scall64-o32.S
---- linux-3.18.5/arch/mips/kernel/scall64-o32.S 2015-01-17 02:39:36.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/mips/kernel/scall64-o32.S 2015-01-19 10:57:45.000000000 +0000
-@@ -486,7 +486,7 @@ EXPORT(sys32_call_table)
+diff -NurpP --minimal linux-4.9.76/arch/mips/kernel/scall64-o32.S linux-4.9.76-vs2.3.9.5/arch/mips/kernel/scall64-o32.S
+--- linux-4.9.76/arch/mips/kernel/scall64-o32.S 2018-01-13 21:28:38.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/mips/kernel/scall64-o32.S 2018-01-10 02:50:49.000000000 +0000
+@@ -499,7 +499,7 @@ EXPORT(sys32_call_table)
PTR compat_sys_mq_timedreceive
PTR compat_sys_mq_notify /* 4275 */
PTR compat_sys_mq_getsetattr
@@ -413,10 +413,10 @@ diff -NurpP --minimal linux-3.18.5/arch/mips/kernel/scall64-o32.S linux-3.18.5-v
PTR compat_sys_waitid
PTR sys_ni_syscall /* available, was setaltroot */
PTR sys_add_key /* 4280 */
-diff -NurpP --minimal linux-3.18.5/arch/mips/kernel/traps.c linux-3.18.5-vs2.3.7.3/arch/mips/kernel/traps.c
---- linux-3.18.5/arch/mips/kernel/traps.c 2015-01-16 22:18:20.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/mips/kernel/traps.c 2015-01-19 10:57:45.000000000 +0000
-@@ -341,9 +341,10 @@ void show_registers(struct pt_regs *regs
+diff -NurpP --minimal linux-4.9.76/arch/mips/kernel/traps.c linux-4.9.76-vs2.3.9.5/arch/mips/kernel/traps.c
+--- linux-4.9.76/arch/mips/kernel/traps.c 2018-01-13 21:28:38.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/mips/kernel/traps.c 2018-01-10 02:50:49.000000000 +0000
+@@ -360,9 +360,10 @@ void show_registers(struct pt_regs *regs
__show_regs(regs);
print_modules();
@@ -430,10 +430,10 @@ diff -NurpP --minimal linux-3.18.5/arch/mips/kernel/traps.c linux-3.18.5-vs2.3.7
if (cpu_has_userlocal) {
unsigned long tls;
-diff -NurpP --minimal linux-3.18.5/arch/parisc/Kconfig linux-3.18.5-vs2.3.7.3/arch/parisc/Kconfig
---- linux-3.18.5/arch/parisc/Kconfig 2015-01-16 22:18:21.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/parisc/Kconfig 2015-01-19 10:57:45.000000000 +0000
-@@ -337,6 +337,8 @@ config SECCOMP
+diff -NurpP --minimal linux-4.9.76/arch/parisc/Kconfig linux-4.9.76-vs2.3.9.5/arch/parisc/Kconfig
+--- linux-4.9.76/arch/parisc/Kconfig 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/parisc/Kconfig 2018-01-10 02:50:49.000000000 +0000
+@@ -348,6 +348,8 @@ config SECCOMP
If unsure, say Y. Only embedded should say N here.
@@ -442,9 +442,9 @@ diff -NurpP --minimal linux-3.18.5/arch/parisc/Kconfig linux-3.18.5-vs2.3.7.3/ar
source "security/Kconfig"
source "crypto/Kconfig"
-diff -NurpP --minimal linux-3.18.5/arch/parisc/kernel/syscall_table.S linux-3.18.5-vs2.3.7.3/arch/parisc/kernel/syscall_table.S
---- linux-3.18.5/arch/parisc/kernel/syscall_table.S 2015-01-17 02:39:36.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/parisc/kernel/syscall_table.S 2015-01-19 10:57:45.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/arch/parisc/kernel/syscall_table.S linux-4.9.76-vs2.3.9.5/arch/parisc/kernel/syscall_table.S
+--- linux-4.9.76/arch/parisc/kernel/syscall_table.S 2018-01-13 21:28:38.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/parisc/kernel/syscall_table.S 2018-01-10 02:50:49.000000000 +0000
@@ -358,7 +358,7 @@
ENTRY_COMP(mbind) /* 260 */
ENTRY_COMP(get_mempolicy)
@@ -453,11 +453,11 @@ diff -NurpP --minimal linux-3.18.5/arch/parisc/kernel/syscall_table.S linux-3.18
+ ENTRY_DIFF(vserver)
ENTRY_SAME(add_key)
ENTRY_SAME(request_key) /* 265 */
- ENTRY_SAME(keyctl)
-diff -NurpP --minimal linux-3.18.5/arch/parisc/kernel/traps.c linux-3.18.5-vs2.3.7.3/arch/parisc/kernel/traps.c
---- linux-3.18.5/arch/parisc/kernel/traps.c 2014-06-12 13:01:26.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/parisc/kernel/traps.c 2015-01-19 10:57:45.000000000 +0000
-@@ -239,8 +239,9 @@ void die_if_kernel(char *str, struct pt_
+ ENTRY_COMP(keyctl)
+diff -NurpP --minimal linux-4.9.76/arch/parisc/kernel/traps.c linux-4.9.76-vs2.3.9.5/arch/parisc/kernel/traps.c
+--- linux-4.9.76/arch/parisc/kernel/traps.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/parisc/kernel/traps.c 2018-01-10 02:50:49.000000000 +0000
+@@ -235,8 +235,9 @@ void die_if_kernel(char *str, struct pt_
return; /* STFU */
parisc_printk_ratelimited(1, regs,
@@ -469,7 +469,7 @@ diff -NurpP --minimal linux-3.18.5/arch/parisc/kernel/traps.c linux-3.18.5-vs2.3
return;
}
-@@ -270,8 +271,8 @@ void die_if_kernel(char *str, struct pt_
+@@ -266,8 +267,8 @@ void die_if_kernel(char *str, struct pt_
pdc_console_restart();
if (err)
@@ -480,10 +480,10 @@ diff -NurpP --minimal linux-3.18.5/arch/parisc/kernel/traps.c linux-3.18.5-vs2.3
/* Wot's wrong wif bein' racy? */
if (current->thread.flags & PARISC_KERNEL_DEATH) {
-diff -NurpP --minimal linux-3.18.5/arch/powerpc/Kconfig linux-3.18.5-vs2.3.7.3/arch/powerpc/Kconfig
---- linux-3.18.5/arch/powerpc/Kconfig 2015-01-17 02:39:36.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/powerpc/Kconfig 2015-01-19 10:57:46.000000000 +0000
-@@ -1068,6 +1068,8 @@ source "lib/Kconfig"
+diff -NurpP --minimal linux-4.9.76/arch/powerpc/Kconfig linux-4.9.76-vs2.3.9.5/arch/powerpc/Kconfig
+--- linux-4.9.76/arch/powerpc/Kconfig 2018-01-13 21:28:38.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/powerpc/Kconfig 2018-01-10 02:50:49.000000000 +0000
+@@ -1085,6 +1085,8 @@ source "lib/Kconfig"
source "arch/powerpc/Kconfig.debug"
@@ -491,10 +491,10 @@ diff -NurpP --minimal linux-3.18.5/arch/powerpc/Kconfig linux-3.18.5-vs2.3.7.3/a
+
source "security/Kconfig"
- config KEYS_COMPAT
-diff -NurpP --minimal linux-3.18.5/arch/powerpc/include/uapi/asm/unistd.h linux-3.18.5-vs2.3.7.3/arch/powerpc/include/uapi/asm/unistd.h
---- linux-3.18.5/arch/powerpc/include/uapi/asm/unistd.h 2015-01-17 02:39:36.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/powerpc/include/uapi/asm/unistd.h 2015-01-19 10:57:46.000000000 +0000
+ source "crypto/Kconfig"
+diff -NurpP --minimal linux-4.9.76/arch/powerpc/include/uapi/asm/unistd.h linux-4.9.76-vs2.3.9.5/arch/powerpc/include/uapi/asm/unistd.h
+--- linux-4.9.76/arch/powerpc/include/uapi/asm/unistd.h 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/powerpc/include/uapi/asm/unistd.h 2018-01-10 02:50:49.000000000 +0000
@@ -275,7 +275,7 @@
#endif
#define __NR_rtas 255
@@ -504,25 +504,10 @@ diff -NurpP --minimal linux-3.18.5/arch/powerpc/include/uapi/asm/unistd.h linux-
#define __NR_migrate_pages 258
#define __NR_mbind 259
#define __NR_get_mempolicy 260
-diff -NurpP --minimal linux-3.18.5/arch/powerpc/kernel/traps.c linux-3.18.5-vs2.3.7.3/arch/powerpc/kernel/traps.c
---- linux-3.18.5/arch/powerpc/kernel/traps.c 2015-01-16 22:18:21.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/powerpc/kernel/traps.c 2015-01-19 10:57:46.000000000 +0000
-@@ -1313,8 +1313,9 @@ void nonrecoverable_exception(struct pt_
-
- void trace_syscall(struct pt_regs *regs)
- {
-- printk("Task: %p(%d), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld %s\n",
-- current, task_pid_nr(current), regs->nip, regs->link, regs->gpr[0],
-+ printk("Task: %p(%d:#%u), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld %s\n",
-+ current, task_pid_nr(current), current->xid,
-+ regs->nip, regs->link, regs->gpr[0],
- regs->ccr&0x10000000?"Error=":"", regs->gpr[3], print_tainted());
- }
-
-diff -NurpP --minimal linux-3.18.5/arch/s390/Kconfig linux-3.18.5-vs2.3.7.3/arch/s390/Kconfig
---- linux-3.18.5/arch/s390/Kconfig 2015-01-17 02:39:40.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/s390/Kconfig 2015-01-19 10:57:46.000000000 +0000
-@@ -652,6 +652,8 @@ source "fs/Kconfig"
+diff -NurpP --minimal linux-4.9.76/arch/s390/Kconfig linux-4.9.76-vs2.3.9.5/arch/s390/Kconfig
+--- linux-4.9.76/arch/s390/Kconfig 2018-01-13 21:28:39.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/s390/Kconfig 2018-01-10 02:50:49.000000000 +0000
+@@ -729,6 +729,8 @@ source "fs/Kconfig"
source "arch/s390/Kconfig.debug"
@@ -531,9 +516,9 @@ diff -NurpP --minimal linux-3.18.5/arch/s390/Kconfig linux-3.18.5-vs2.3.7.3/arch
source "security/Kconfig"
source "crypto/Kconfig"
-diff -NurpP --minimal linux-3.18.5/arch/s390/include/asm/tlb.h linux-3.18.5-vs2.3.7.3/arch/s390/include/asm/tlb.h
---- linux-3.18.5/arch/s390/include/asm/tlb.h 2015-01-17 02:39:41.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/s390/include/asm/tlb.h 2015-01-19 10:57:46.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/arch/s390/include/asm/tlb.h linux-4.9.76-vs2.3.9.5/arch/s390/include/asm/tlb.h
+--- linux-4.9.76/arch/s390/include/asm/tlb.h 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/s390/include/asm/tlb.h 2018-01-10 02:50:49.000000000 +0000
@@ -24,6 +24,7 @@
#include <linux/mm.h>
#include <linux/pagemap.h>
@@ -542,21 +527,21 @@ diff -NurpP --minimal linux-3.18.5/arch/s390/include/asm/tlb.h linux-3.18.5-vs2.
#include <asm/processor.h>
#include <asm/pgalloc.h>
#include <asm/tlbflush.h>
-diff -NurpP --minimal linux-3.18.5/arch/s390/include/uapi/asm/unistd.h linux-3.18.5-vs2.3.7.3/arch/s390/include/uapi/asm/unistd.h
---- linux-3.18.5/arch/s390/include/uapi/asm/unistd.h 2015-01-17 02:39:41.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/s390/include/uapi/asm/unistd.h 2015-01-19 10:57:46.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/arch/s390/include/uapi/asm/unistd.h linux-4.9.76-vs2.3.9.5/arch/s390/include/uapi/asm/unistd.h
+--- linux-4.9.76/arch/s390/include/uapi/asm/unistd.h 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/s390/include/uapi/asm/unistd.h 2018-01-10 02:50:49.000000000 +0000
@@ -200,7 +200,7 @@
- #define __NR_clock_gettime (__NR_timer_create+6)
- #define __NR_clock_getres (__NR_timer_create+7)
- #define __NR_clock_nanosleep (__NR_timer_create+8)
+ #define __NR_clock_gettime 260
+ #define __NR_clock_getres 261
+ #define __NR_clock_nanosleep 262
-/* Number 263 is reserved for vserver */
+#define __NR_vserver 263
#define __NR_statfs64 265
#define __NR_fstatfs64 266
#define __NR_remap_file_pages 267
-diff -NurpP --minimal linux-3.18.5/arch/s390/kernel/ptrace.c linux-3.18.5-vs2.3.7.3/arch/s390/kernel/ptrace.c
---- linux-3.18.5/arch/s390/kernel/ptrace.c 2015-01-17 02:39:41.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/s390/kernel/ptrace.c 2015-01-19 10:57:46.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/arch/s390/kernel/ptrace.c linux-4.9.76-vs2.3.9.5/arch/s390/kernel/ptrace.c
+--- linux-4.9.76/arch/s390/kernel/ptrace.c 2018-01-13 21:28:39.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/s390/kernel/ptrace.c 2018-01-10 02:50:49.000000000 +0000
@@ -21,6 +21,7 @@
#include <linux/tracehook.h>
#include <linux/seccomp.h>
@@ -565,22 +550,22 @@ diff -NurpP --minimal linux-3.18.5/arch/s390/kernel/ptrace.c linux-3.18.5-vs2.3.
#include <trace/syscall.h>
#include <asm/segment.h>
#include <asm/page.h>
-diff -NurpP --minimal linux-3.18.5/arch/s390/kernel/syscalls.S linux-3.18.5-vs2.3.7.3/arch/s390/kernel/syscalls.S
---- linux-3.18.5/arch/s390/kernel/syscalls.S 2015-01-17 02:39:41.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/s390/kernel/syscalls.S 2015-01-19 11:00:51.000000000 +0000
-@@ -271,7 +271,7 @@ SYSCALL(sys_clock_settime,sys_clock_sett
- SYSCALL(sys_clock_gettime,sys_clock_gettime,compat_sys_clock_gettime) /* 260 */
- SYSCALL(sys_clock_getres,sys_clock_getres,compat_sys_clock_getres)
- SYSCALL(sys_clock_nanosleep,sys_clock_nanosleep,compat_sys_clock_nanosleep)
--NI_SYSCALL /* reserved for vserver */
+diff -NurpP --minimal linux-4.9.76/arch/s390/kernel/syscalls.S linux-4.9.76-vs2.3.9.5/arch/s390/kernel/syscalls.S
+--- linux-4.9.76/arch/s390/kernel/syscalls.S 2018-01-13 21:28:39.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/s390/kernel/syscalls.S 2018-01-10 02:50:49.000000000 +0000
+@@ -271,7 +271,7 @@ SYSCALL(sys_clock_settime,compat_sys_clo
+ SYSCALL(sys_clock_gettime,compat_sys_clock_gettime) /* 260 */
+ SYSCALL(sys_clock_getres,compat_sys_clock_getres)
+ SYSCALL(sys_clock_nanosleep,compat_sys_clock_nanosleep)
+-NI_SYSCALL /* reserved for vserver */
+SYSCALL(sys_vserver,sys_vserver,sys32_vserver)
- SYSCALL(sys_s390_fadvise64_64,sys_ni_syscall,compat_sys_s390_fadvise64_64)
- SYSCALL(sys_statfs64,sys_statfs64,compat_sys_statfs64)
- SYSCALL(sys_fstatfs64,sys_fstatfs64,compat_sys_fstatfs64)
-diff -NurpP --minimal linux-3.18.5/arch/sh/Kconfig linux-3.18.5-vs2.3.7.3/arch/sh/Kconfig
---- linux-3.18.5/arch/sh/Kconfig 2015-01-16 22:18:23.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/sh/Kconfig 2015-01-19 10:57:46.000000000 +0000
-@@ -878,6 +878,8 @@ source "fs/Kconfig"
+ SYSCALL(sys_ni_syscall,compat_sys_s390_fadvise64_64)
+ SYSCALL(sys_statfs64,compat_sys_statfs64)
+ SYSCALL(sys_fstatfs64,compat_sys_fstatfs64)
+diff -NurpP --minimal linux-4.9.76/arch/sh/Kconfig linux-4.9.76-vs2.3.9.5/arch/sh/Kconfig
+--- linux-4.9.76/arch/sh/Kconfig 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/sh/Kconfig 2018-01-10 02:50:49.000000000 +0000
+@@ -904,6 +904,8 @@ source "fs/Kconfig"
source "arch/sh/Kconfig.debug"
@@ -589,9 +574,9 @@ diff -NurpP --minimal linux-3.18.5/arch/sh/Kconfig linux-3.18.5-vs2.3.7.3/arch/s
source "security/Kconfig"
source "crypto/Kconfig"
-diff -NurpP --minimal linux-3.18.5/arch/sh/kernel/irq.c linux-3.18.5-vs2.3.7.3/arch/sh/kernel/irq.c
---- linux-3.18.5/arch/sh/kernel/irq.c 2014-06-12 13:01:29.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/sh/kernel/irq.c 2015-01-19 10:57:46.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/arch/sh/kernel/irq.c linux-4.9.76-vs2.3.9.5/arch/sh/kernel/irq.c
+--- linux-4.9.76/arch/sh/kernel/irq.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/sh/kernel/irq.c 2018-01-10 02:50:49.000000000 +0000
@@ -14,6 +14,7 @@
#include <linux/ftrace.h>
#include <linux/delay.h>
@@ -600,10 +585,10 @@ diff -NurpP --minimal linux-3.18.5/arch/sh/kernel/irq.c linux-3.18.5-vs2.3.7.3/a
#include <asm/processor.h>
#include <asm/machvec.h>
#include <asm/uaccess.h>
-diff -NurpP --minimal linux-3.18.5/arch/sparc/Kconfig linux-3.18.5-vs2.3.7.3/arch/sparc/Kconfig
---- linux-3.18.5/arch/sparc/Kconfig 2015-01-17 02:39:41.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/sparc/Kconfig 2015-01-19 10:57:46.000000000 +0000
-@@ -557,6 +557,8 @@ source "fs/Kconfig"
+diff -NurpP --minimal linux-4.9.76/arch/sparc/Kconfig linux-4.9.76-vs2.3.9.5/arch/sparc/Kconfig
+--- linux-4.9.76/arch/sparc/Kconfig 2018-01-13 21:28:39.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/sparc/Kconfig 2018-01-10 02:50:49.000000000 +0000
+@@ -580,6 +580,8 @@ source "fs/Kconfig"
source "arch/sparc/Kconfig.debug"
@@ -612,9 +597,9 @@ diff -NurpP --minimal linux-3.18.5/arch/sparc/Kconfig linux-3.18.5-vs2.3.7.3/arc
source "security/Kconfig"
source "crypto/Kconfig"
-diff -NurpP --minimal linux-3.18.5/arch/sparc/include/uapi/asm/unistd.h linux-3.18.5-vs2.3.7.3/arch/sparc/include/uapi/asm/unistd.h
---- linux-3.18.5/arch/sparc/include/uapi/asm/unistd.h 2015-01-17 02:39:41.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/sparc/include/uapi/asm/unistd.h 2015-01-19 10:57:46.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/arch/sparc/include/uapi/asm/unistd.h linux-4.9.76-vs2.3.9.5/arch/sparc/include/uapi/asm/unistd.h
+--- linux-4.9.76/arch/sparc/include/uapi/asm/unistd.h 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/sparc/include/uapi/asm/unistd.h 2018-01-10 02:50:49.000000000 +0000
@@ -332,7 +332,7 @@
#define __NR_timer_getoverrun 264
#define __NR_timer_delete 265
@@ -624,9 +609,9 @@ diff -NurpP --minimal linux-3.18.5/arch/sparc/include/uapi/asm/unistd.h linux-3.
#define __NR_io_setup 268
#define __NR_io_destroy 269
#define __NR_io_submit 270
-diff -NurpP --minimal linux-3.18.5/arch/sparc/kernel/systbls_32.S linux-3.18.5-vs2.3.7.3/arch/sparc/kernel/systbls_32.S
---- linux-3.18.5/arch/sparc/kernel/systbls_32.S 2015-01-17 02:39:41.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/sparc/kernel/systbls_32.S 2015-01-19 10:57:46.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/arch/sparc/kernel/systbls_32.S linux-4.9.76-vs2.3.9.5/arch/sparc/kernel/systbls_32.S
+--- linux-4.9.76/arch/sparc/kernel/systbls_32.S 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/sparc/kernel/systbls_32.S 2018-01-10 02:50:49.000000000 +0000
@@ -70,7 +70,7 @@ sys_call_table:
/*250*/ .long sys_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_ni_syscall
/*255*/ .long sys_sync_file_range, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep
@@ -636,9 +621,9 @@ diff -NurpP --minimal linux-3.18.5/arch/sparc/kernel/systbls_32.S linux-3.18.5-v
/*270*/ .long sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink
/*275*/ .long sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid
/*280*/ .long sys_tee, sys_add_key, sys_request_key, sys_keyctl, sys_openat
-diff -NurpP --minimal linux-3.18.5/arch/sparc/kernel/systbls_64.S linux-3.18.5-vs2.3.7.3/arch/sparc/kernel/systbls_64.S
---- linux-3.18.5/arch/sparc/kernel/systbls_64.S 2015-01-17 02:39:41.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/sparc/kernel/systbls_64.S 2015-01-19 10:57:46.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/arch/sparc/kernel/systbls_64.S linux-4.9.76-vs2.3.9.5/arch/sparc/kernel/systbls_64.S
+--- linux-4.9.76/arch/sparc/kernel/systbls_64.S 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/sparc/kernel/systbls_64.S 2018-01-10 02:50:49.000000000 +0000
@@ -71,7 +71,7 @@ sys_call_table32:
/*250*/ .word sys_mremap, compat_sys_sysctl, sys_getsid, sys_fdatasync, sys_nis_syscall
.word sys32_sync_file_range, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep
@@ -648,7 +633,7 @@ diff -NurpP --minimal linux-3.18.5/arch/sparc/kernel/systbls_64.S linux-3.18.5-v
/*270*/ .word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink
.word compat_sys_mq_timedsend, compat_sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, compat_sys_waitid
/*280*/ .word sys_tee, sys_add_key, sys_request_key, compat_sys_keyctl, compat_sys_openat
-@@ -150,7 +150,7 @@ sys_call_table:
+@@ -152,7 +152,7 @@ sys_call_table:
/*250*/ .word sys_64_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nis_syscall
.word sys_sync_file_range, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep
/*260*/ .word sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun
@@ -657,9 +642,9 @@ diff -NurpP --minimal linux-3.18.5/arch/sparc/kernel/systbls_64.S linux-3.18.5-v
/*270*/ .word sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink
.word sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid
/*280*/ .word sys_tee, sys_add_key, sys_request_key, sys_keyctl, sys_openat
-diff -NurpP --minimal linux-3.18.5/arch/um/Kconfig.rest linux-3.18.5-vs2.3.7.3/arch/um/Kconfig.rest
---- linux-3.18.5/arch/um/Kconfig.rest 2012-12-11 03:30:57.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/um/Kconfig.rest 2015-01-19 10:57:46.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/arch/um/Kconfig.rest linux-4.9.76-vs2.3.9.5/arch/um/Kconfig.rest
+--- linux-4.9.76/arch/um/Kconfig.rest 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/um/Kconfig.rest 2018-01-10 02:50:49.000000000 +0000
@@ -12,6 +12,8 @@ source "arch/um/Kconfig.net"
source "fs/Kconfig"
@@ -669,10 +654,10 @@ diff -NurpP --minimal linux-3.18.5/arch/um/Kconfig.rest linux-3.18.5-vs2.3.7.3/a
source "security/Kconfig"
source "crypto/Kconfig"
-diff -NurpP --minimal linux-3.18.5/arch/x86/Kconfig linux-3.18.5-vs2.3.7.3/arch/x86/Kconfig
---- linux-3.18.5/arch/x86/Kconfig 2015-02-05 18:02:39.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/x86/Kconfig 2015-02-05 18:08:00.000000000 +0000
-@@ -2506,6 +2506,8 @@ source "fs/Kconfig"
+diff -NurpP --minimal linux-4.9.76/arch/x86/Kconfig linux-4.9.76-vs2.3.9.5/arch/x86/Kconfig
+--- linux-4.9.76/arch/x86/Kconfig 2018-01-13 21:28:39.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/x86/Kconfig 2018-01-10 02:50:49.000000000 +0000
+@@ -2763,6 +2763,8 @@ source "fs/Kconfig"
source "arch/x86/Kconfig.debug"
@@ -681,9 +666,9 @@ diff -NurpP --minimal linux-3.18.5/arch/x86/Kconfig linux-3.18.5-vs2.3.7.3/arch/
source "security/Kconfig"
source "crypto/Kconfig"
-diff -NurpP --minimal linux-3.18.5/arch/x86/syscalls/syscall_32.tbl linux-3.18.5-vs2.3.7.3/arch/x86/syscalls/syscall_32.tbl
---- linux-3.18.5/arch/x86/syscalls/syscall_32.tbl 2015-01-17 02:39:43.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/x86/syscalls/syscall_32.tbl 2015-01-19 10:57:46.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/arch/x86/entry/syscalls/syscall_32.tbl linux-4.9.76-vs2.3.9.5/arch/x86/entry/syscalls/syscall_32.tbl
+--- linux-4.9.76/arch/x86/entry/syscalls/syscall_32.tbl 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/x86/entry/syscalls/syscall_32.tbl 2018-01-10 02:50:49.000000000 +0000
@@ -279,7 +279,7 @@
270 i386 tgkill sys_tgkill
271 i386 utimes sys_utimes compat_sys_utimes
@@ -693,9 +678,9 @@ diff -NurpP --minimal linux-3.18.5/arch/x86/syscalls/syscall_32.tbl linux-3.18.5
274 i386 mbind sys_mbind
275 i386 get_mempolicy sys_get_mempolicy compat_sys_get_mempolicy
276 i386 set_mempolicy sys_set_mempolicy
-diff -NurpP --minimal linux-3.18.5/arch/x86/syscalls/syscall_64.tbl linux-3.18.5-vs2.3.7.3/arch/x86/syscalls/syscall_64.tbl
---- linux-3.18.5/arch/x86/syscalls/syscall_64.tbl 2015-01-17 02:39:43.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/arch/x86/syscalls/syscall_64.tbl 2015-01-19 10:57:46.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/arch/x86/entry/syscalls/syscall_64.tbl linux-4.9.76-vs2.3.9.5/arch/x86/entry/syscalls/syscall_64.tbl
+--- linux-4.9.76/arch/x86/entry/syscalls/syscall_64.tbl 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/arch/x86/entry/syscalls/syscall_64.tbl 2018-01-10 02:50:49.000000000 +0000
@@ -242,7 +242,7 @@
233 common epoll_ctl sys_epoll_ctl
234 common tgkill sys_tgkill
@@ -705,9 +690,9 @@ diff -NurpP --minimal linux-3.18.5/arch/x86/syscalls/syscall_64.tbl linux-3.18.5
237 common mbind sys_mbind
238 common set_mempolicy sys_set_mempolicy
239 common get_mempolicy sys_get_mempolicy
-diff -NurpP --minimal linux-3.18.5/block/ioprio.c linux-3.18.5-vs2.3.7.3/block/ioprio.c
---- linux-3.18.5/block/ioprio.c 2015-01-17 02:39:43.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/block/ioprio.c 2015-01-19 13:00:07.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/block/ioprio.c linux-4.9.76-vs2.3.9.5/block/ioprio.c
+--- linux-4.9.76/block/ioprio.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/block/ioprio.c 2018-01-10 02:50:49.000000000 +0000
@@ -28,6 +28,7 @@
#include <linux/syscalls.h>
#include <linux/security.h>
@@ -725,7 +710,7 @@ diff -NurpP --minimal linux-3.18.5/block/ioprio.c linux-3.18.5-vs2.3.7.3/block/i
ret = set_task_ioprio(p, ioprio);
if (ret)
break;
-@@ -200,6 +203,8 @@ SYSCALL_DEFINE2(ioprio_get, int, which,
+@@ -203,6 +206,8 @@ SYSCALL_DEFINE2(ioprio_get, int, which,
else
pgrp = find_vpid(who);
do_each_pid_thread(pgrp, PIDTYPE_PGID, p) {
@@ -734,10 +719,10 @@ diff -NurpP --minimal linux-3.18.5/block/ioprio.c linux-3.18.5-vs2.3.7.3/block/i
tmpio = get_task_ioprio(p);
if (tmpio < 0)
continue;
-diff -NurpP --minimal linux-3.18.5/drivers/block/Kconfig linux-3.18.5-vs2.3.7.3/drivers/block/Kconfig
---- linux-3.18.5/drivers/block/Kconfig 2014-06-12 11:33:19.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/drivers/block/Kconfig 2015-01-19 10:57:46.000000000 +0000
-@@ -283,6 +283,13 @@ config BLK_DEV_CRYPTOLOOP
+diff -NurpP --minimal linux-4.9.76/drivers/block/Kconfig linux-4.9.76-vs2.3.9.5/drivers/block/Kconfig
+--- linux-4.9.76/drivers/block/Kconfig 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/drivers/block/Kconfig 2018-01-10 02:50:49.000000000 +0000
+@@ -273,6 +273,13 @@ config BLK_DEV_CRYPTOLOOP
source "drivers/block/drbd/Kconfig"
@@ -751,10 +736,10 @@ diff -NurpP --minimal linux-3.18.5/drivers/block/Kconfig linux-3.18.5-vs2.3.7.3/
config BLK_DEV_NBD
tristate "Network block device support"
depends on NET
-diff -NurpP --minimal linux-3.18.5/drivers/block/Makefile linux-3.18.5-vs2.3.7.3/drivers/block/Makefile
---- linux-3.18.5/drivers/block/Makefile 2014-06-12 11:33:19.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/drivers/block/Makefile 2015-01-19 10:57:46.000000000 +0000
-@@ -33,6 +33,7 @@ obj-$(CONFIG_VIRTIO_BLK) += virtio_blk.o
+diff -NurpP --minimal linux-4.9.76/drivers/block/Makefile linux-4.9.76-vs2.3.9.5/drivers/block/Makefile
+--- linux-4.9.76/drivers/block/Makefile 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/drivers/block/Makefile 2018-01-10 02:50:49.000000000 +0000
+@@ -31,6 +31,7 @@ obj-$(CONFIG_VIRTIO_BLK) += virtio_blk.o
obj-$(CONFIG_BLK_DEV_SX8) += sx8.o
obj-$(CONFIG_BLK_DEV_HD) += hd.o
@@ -762,34 +747,34 @@ diff -NurpP --minimal linux-3.18.5/drivers/block/Makefile linux-3.18.5-vs2.3.7.3
obj-$(CONFIG_XEN_BLKDEV_FRONTEND) += xen-blkfront.o
obj-$(CONFIG_XEN_BLKDEV_BACKEND) += xen-blkback/
-diff -NurpP --minimal linux-3.18.5/drivers/block/loop.c linux-3.18.5-vs2.3.7.3/drivers/block/loop.c
---- linux-3.18.5/drivers/block/loop.c 2014-09-03 13:18:40.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/drivers/block/loop.c 2015-01-19 10:57:46.000000000 +0000
-@@ -75,6 +75,7 @@
- #include <linux/sysfs.h>
+diff -NurpP --minimal linux-4.9.76/drivers/block/loop.c linux-4.9.76-vs2.3.9.5/drivers/block/loop.c
+--- linux-4.9.76/drivers/block/loop.c 2018-01-13 21:28:40.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/drivers/block/loop.c 2018-01-10 02:50:49.000000000 +0000
+@@ -76,6 +76,7 @@
#include <linux/miscdevice.h>
#include <linux/falloc.h>
+ #include <linux/uio.h>
+#include <linux/vs_context.h>
#include "loop.h"
#include <asm/uaccess.h>
-@@ -885,6 +886,7 @@ static int loop_set_fd(struct loop_devic
+@@ -924,6 +925,7 @@ static int loop_set_fd(struct loop_devic
lo->lo_blocksize = lo_blocksize;
lo->lo_device = bdev;
lo->lo_flags = lo_flags;
+ lo->lo_xid = vx_current_xid();
lo->lo_backing_file = file;
- lo->transfer = transfer_none;
+ lo->transfer = NULL;
lo->ioctl = NULL;
-@@ -1029,6 +1031,7 @@ static int loop_clr_fd(struct loop_devic
+@@ -1044,6 +1046,7 @@ static int loop_clr_fd(struct loop_devic
+ lo->lo_offset = 0;
lo->lo_sizelimit = 0;
lo->lo_encrypt_key_size = 0;
- lo->lo_thread = NULL;
+ lo->lo_xid = 0;
memset(lo->lo_encrypt_key, 0, LO_KEY_SIZE);
memset(lo->lo_crypt_name, 0, LO_NAME_SIZE);
memset(lo->lo_file_name, 0, LO_NAME_SIZE);
-@@ -1072,7 +1075,7 @@ loop_set_status(struct loop_device *lo,
+@@ -1090,7 +1093,7 @@ loop_set_status(struct loop_device *lo,
if (lo->lo_encrypt_key_size &&
!uid_eq(lo->lo_key_owner, uid) &&
@@ -798,7 +783,7 @@ diff -NurpP --minimal linux-3.18.5/drivers/block/loop.c linux-3.18.5-vs2.3.7.3/d
return -EPERM;
if (lo->lo_state != Lo_bound)
return -ENXIO;
-@@ -1162,7 +1165,8 @@ loop_get_status(struct loop_device *lo,
+@@ -1191,7 +1194,8 @@ loop_get_status(struct loop_device *lo,
memcpy(info->lo_crypt_name, lo->lo_crypt_name, LO_NAME_SIZE);
info->lo_encrypt_type =
lo->lo_encryption ? lo->lo_encryption->number : 0;
@@ -808,7 +793,7 @@ diff -NurpP --minimal linux-3.18.5/drivers/block/loop.c linux-3.18.5-vs2.3.7.3/d
info->lo_encrypt_key_size = lo->lo_encrypt_key_size;
memcpy(info->lo_encrypt_key, lo->lo_encrypt_key,
lo->lo_encrypt_key_size);
-@@ -1504,6 +1508,11 @@ static int lo_open(struct block_device *
+@@ -1552,6 +1556,11 @@ static int lo_open(struct block_device *
goto out;
}
@@ -817,13 +802,13 @@ diff -NurpP --minimal linux-3.18.5/drivers/block/loop.c linux-3.18.5-vs2.3.7.3/d
+ goto out;
+ }
+
- mutex_lock(&lo->lo_ctl_mutex);
- lo->lo_refcnt++;
- mutex_unlock(&lo->lo_ctl_mutex);
-diff -NurpP --minimal linux-3.18.5/drivers/block/loop.h linux-3.18.5-vs2.3.7.3/drivers/block/loop.h
---- linux-3.18.5/drivers/block/loop.h 2013-11-25 15:44:28.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/drivers/block/loop.h 2015-01-19 10:57:46.000000000 +0000
-@@ -41,6 +41,7 @@ struct loop_device {
+ atomic_inc(&lo->lo_refcnt);
+ out:
+ mutex_unlock(&loop_index_mutex);
+diff -NurpP --minimal linux-4.9.76/drivers/block/loop.h linux-4.9.76-vs2.3.9.5/drivers/block/loop.h
+--- linux-4.9.76/drivers/block/loop.h 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/drivers/block/loop.h 2018-01-10 02:50:49.000000000 +0000
+@@ -43,6 +43,7 @@ struct loop_device {
struct loop_func_table *lo_encryption;
__u32 lo_init[2];
kuid_t lo_key_owner; /* Who set the key */
@@ -831,19 +816,19 @@ diff -NurpP --minimal linux-3.18.5/drivers/block/loop.h linux-3.18.5-vs2.3.7.3/d
int (*ioctl)(struct loop_device *, int cmd,
unsigned long arg);
-diff -NurpP --minimal linux-3.18.5/drivers/block/vroot.c linux-3.18.5-vs2.3.7.3/drivers/block/vroot.c
---- linux-3.18.5/drivers/block/vroot.c 1970-01-01 00:00:00.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/drivers/block/vroot.c 2015-01-19 10:57:46.000000000 +0000
-@@ -0,0 +1,290 @@
+diff -NurpP --minimal linux-4.9.76/drivers/block/vroot.c linux-4.9.76-vs2.3.9.5/drivers/block/vroot.c
+--- linux-4.9.76/drivers/block/vroot.c 1970-01-01 00:00:00.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/drivers/block/vroot.c 2018-01-13 22:00:41.000000000 +0000
+@@ -0,0 +1,291 @@
+/*
+ * linux/drivers/block/vroot.c
+ *
-+ * written by Herbert P�tzl, 9/11/2002
-+ * ported to 2.6.10 by Herbert P�tzl, 30/12/2004
++ * written by Herbert P?tzl, 9/11/2002
++ * ported to 2.6.10 by Herbert P?tzl, 30/12/2004
+ *
+ * based on the loop.c code by Theodore Ts'o.
+ *
-+ * Copyright (C) 2002-2007 by Herbert P�tzl.
++ * Copyright (C) 2002-2007 by Herbert P?tzl.
+ * Redistribution of this file is permitted under the
+ * GNU General Public License.
+ *
@@ -886,7 +871,7 @@ diff -NurpP --minimal linux-3.18.5/drivers/block/vroot.c linux-3.18.5-vs2.3.7.3/
+ goto out;
+
+ error = -EINVAL;
-+ inode = file->f_dentry->d_inode;
++ inode = file->f_path.dentry->d_inode;
+
+
+ if (S_ISBLK(inode->i_mode)) {
@@ -981,10 +966,11 @@ diff -NurpP --minimal linux-3.18.5/drivers/block/vroot.c linux-3.18.5-vs2.3.7.3/
+ .ioctl = vr_ioctl,
+};
+
-+static void vroot_make_request(struct request_queue *q, struct bio *bio)
++static blk_qc_t vroot_make_request(struct request_queue *q, struct bio *bio)
+{
+ printk("vroot_make_request %p, %p\n", q, bio);
+ bio_io_error(bio);
++ return BLK_QC_T_NONE;
+}
+
+struct block_device *__vroot_get_real_bdev(struct block_device *bdev)
@@ -1020,7 +1006,7 @@ diff -NurpP --minimal linux-3.18.5/drivers/block/vroot.c linux-3.18.5-vs2.3.7.3/
+MODULE_LICENSE("GPL");
+MODULE_ALIAS_BLOCKDEV_MAJOR(VROOT_MAJOR);
+
-+MODULE_AUTHOR ("Herbert P�tzl");
++MODULE_AUTHOR ("Herbert P?tzl");
+MODULE_DESCRIPTION ("Virtual Root Device Mapper");
+
+
@@ -1125,21 +1111,20 @@ diff -NurpP --minimal linux-3.18.5/drivers/block/vroot.c linux-3.18.5-vs2.3.7.3/
+
+#endif
+
-diff -NurpP --minimal linux-3.18.5/drivers/infiniband/core/addr.c linux-3.18.5-vs2.3.7.3/drivers/infiniband/core/addr.c
---- linux-3.18.5/drivers/infiniband/core/addr.c 2014-06-12 11:33:41.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/drivers/infiniband/core/addr.c 2015-01-19 10:57:46.000000000 +0000
-@@ -284,7 +284,7 @@ static int addr6_resolve(struct sockaddr
-
- if (ipv6_addr_any(&fl6.saddr)) {
- ret = ipv6_dev_get_saddr(&init_net, ip6_dst_idev(dst)->dev,
-- &fl6.daddr, 0, &fl6.saddr);
-+ &fl6.daddr, 0, &fl6.saddr, NULL);
- if (ret)
- goto put;
-
-diff -NurpP --minimal linux-3.18.5/drivers/md/dm-ioctl.c linux-3.18.5-vs2.3.7.3/drivers/md/dm-ioctl.c
---- linux-3.18.5/drivers/md/dm-ioctl.c 2015-01-17 02:39:51.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/drivers/md/dm-ioctl.c 2015-01-19 10:57:46.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/drivers/md/dm-core.h linux-4.9.76-vs2.3.9.5/drivers/md/dm-core.h
+--- linux-4.9.76/drivers/md/dm-core.h 2018-01-13 21:28:44.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/drivers/md/dm-core.h 2018-01-10 08:35:10.000000000 +0000
+@@ -52,6 +52,7 @@ struct mapped_device {
+
+ atomic_t holders;
+ atomic_t open_count;
++ vxid_t xid;
+
+ struct dm_target *immutable_target;
+ struct target_type *immutable_target_type;
+diff -NurpP --minimal linux-4.9.76/drivers/md/dm-ioctl.c linux-4.9.76-vs2.3.9.5/drivers/md/dm-ioctl.c
+--- linux-4.9.76/drivers/md/dm-ioctl.c 2018-01-13 21:28:44.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/drivers/md/dm-ioctl.c 2018-01-10 02:50:49.000000000 +0000
@@ -16,6 +16,7 @@
#include <linux/dm-ioctl.h>
#include <linux/hdreg.h>
@@ -1214,7 +1199,7 @@ diff -NurpP --minimal linux-3.18.5/drivers/md/dm-ioctl.c linux-3.18.5-vs2.3.7.3/
if (old_nl)
old_nl->next = (uint32_t) ((void *) nl -
(void *) old_nl);
-@@ -1797,8 +1809,8 @@ static int ctl_ioctl(uint command, struc
+@@ -1805,8 +1817,8 @@ static int ctl_ioctl(uint command, struc
size_t input_param_size;
struct dm_ioctl param_kernel;
@@ -1225,26 +1210,18 @@ diff -NurpP --minimal linux-3.18.5/drivers/md/dm-ioctl.c linux-3.18.5-vs2.3.7.3/
return -EACCES;
if (_IOC_TYPE(command) != DM_IOCTL)
-diff -NurpP --minimal linux-3.18.5/drivers/md/dm.c linux-3.18.5-vs2.3.7.3/drivers/md/dm.c
---- linux-3.18.5/drivers/md/dm.c 2015-02-05 18:02:42.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/drivers/md/dm.c 2015-01-28 11:48:02.000000000 +0000
-@@ -19,6 +19,7 @@
- #include <linux/idr.h>
- #include <linux/hdreg.h>
- #include <linux/delay.h>
+diff -NurpP --minimal linux-4.9.76/drivers/md/dm.c linux-4.9.76-vs2.3.9.5/drivers/md/dm.c
+--- linux-4.9.76/drivers/md/dm.c 2018-01-13 21:28:45.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/drivers/md/dm.c 2018-01-10 08:32:35.000000000 +0000
+@@ -22,6 +22,7 @@
+ #include <linux/wait.h>
+ #include <linux/pr.h>
+ #include <linux/vmalloc.h>
+#include <linux/vs_base.h>
- #include <trace/events/block.h>
-
-@@ -134,6 +135,7 @@ struct mapped_device {
- struct mutex suspend_lock;
- atomic_t holders;
- atomic_t open_count;
-+ vxid_t xid;
+ #define DM_MSG_PREFIX "core"
- /*
- * The current mapping.
-@@ -397,6 +399,7 @@ int dm_deleting_md(struct mapped_device
+@@ -300,6 +301,7 @@ int dm_deleting_md(struct mapped_device
static int dm_blk_open(struct block_device *bdev, fmode_t mode)
{
struct mapped_device *md;
@@ -1252,7 +1229,7 @@ diff -NurpP --minimal linux-3.18.5/drivers/md/dm.c linux-3.18.5-vs2.3.7.3/driver
spin_lock(&_minor_lock);
-@@ -405,18 +408,19 @@ static int dm_blk_open(struct block_devi
+@@ -308,17 +310,19 @@ static int dm_blk_open(struct block_devi
goto out;
if (test_bit(DMF_FREEING, &md->flags) ||
@@ -1268,7 +1245,6 @@ diff -NurpP --minimal linux-3.18.5/drivers/md/dm.c linux-3.18.5-vs2.3.7.3/driver
dm_get(md);
atomic_inc(&md->open_count);
--
+ ret = 0;
out:
spin_unlock(&_minor_lock);
@@ -1278,7 +1254,7 @@ diff -NurpP --minimal linux-3.18.5/drivers/md/dm.c linux-3.18.5-vs2.3.7.3/driver
}
static void dm_blk_close(struct gendisk *disk, fmode_t mode)
-@@ -819,6 +823,14 @@ int dm_set_geometry(struct mapped_device
+@@ -744,6 +748,14 @@ int dm_set_geometry(struct mapped_device
return 0;
}
@@ -1293,18 +1269,18 @@ diff -NurpP --minimal linux-3.18.5/drivers/md/dm.c linux-3.18.5-vs2.3.7.3/driver
/*-----------------------------------------------------------------
* CRUD START:
* A more elegant soln is in the works that uses the queue
-@@ -2077,6 +2089,7 @@ static struct mapped_device *alloc_dev(i
+@@ -1548,6 +1560,7 @@ static struct mapped_device *alloc_dev(i
+ INIT_LIST_HEAD(&md->uevent_list);
INIT_LIST_HEAD(&md->table_devices);
spin_lock_init(&md->uevent_lock);
-
+ md->xid = vx_current_xid();
- md->queue = blk_alloc_queue(GFP_KERNEL);
+
+ md->queue = blk_alloc_queue_node(GFP_KERNEL, numa_node_id);
if (!md->queue)
- goto bad_queue;
-diff -NurpP --minimal linux-3.18.5/drivers/md/dm.h linux-3.18.5-vs2.3.7.3/drivers/md/dm.h
---- linux-3.18.5/drivers/md/dm.h 2015-01-17 02:39:51.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/drivers/md/dm.h 2015-01-19 10:57:46.000000000 +0000
-@@ -50,6 +50,8 @@ struct dm_dev_internal {
+diff -NurpP --minimal linux-4.9.76/drivers/md/dm.h linux-4.9.76-vs2.3.9.5/drivers/md/dm.h
+--- linux-4.9.76/drivers/md/dm.h 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/drivers/md/dm.h 2018-01-10 02:50:49.000000000 +0000
+@@ -45,6 +45,8 @@ struct dm_dev_internal {
struct dm_table;
struct dm_md_mempools;
@@ -1313,18 +1289,18 @@ diff -NurpP --minimal linux-3.18.5/drivers/md/dm.h linux-3.18.5-vs2.3.7.3/driver
/*-----------------------------------------------------------------
* Internal table functions.
*---------------------------------------------------------------*/
-diff -NurpP --minimal linux-3.18.5/drivers/net/tun.c linux-3.18.5-vs2.3.7.3/drivers/net/tun.c
---- linux-3.18.5/drivers/net/tun.c 2015-01-17 02:40:00.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/drivers/net/tun.c 2015-01-19 10:57:46.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/drivers/net/tun.c linux-4.9.76-vs2.3.9.5/drivers/net/tun.c
+--- linux-4.9.76/drivers/net/tun.c 2018-01-13 21:28:50.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/drivers/net/tun.c 2018-01-10 02:50:49.000000000 +0000
@@ -65,6 +65,7 @@
#include <linux/nsproxy.h>
#include <linux/virtio_net.h>
#include <linux/rcupdate.h>
+#include <linux/vs_network.h>
- #include <net/ipv6.h>
#include <net/net_namespace.h>
#include <net/netns/generic.h>
-@@ -171,6 +172,7 @@ struct tun_struct {
+ #include <net/rtnetlink.h>
+@@ -194,6 +195,7 @@ struct tun_struct {
unsigned int flags;
kuid_t owner;
kgid_t group;
@@ -1332,7 +1308,7 @@ diff -NurpP --minimal linux-3.18.5/drivers/net/tun.c linux-3.18.5-vs2.3.7.3/driv
struct net_device *dev;
netdev_features_t set_features;
-@@ -404,6 +406,7 @@ static inline bool tun_not_capable(struc
+@@ -490,6 +492,7 @@ static inline bool tun_not_capable(struc
return ((uid_valid(tun->owner) && !uid_eq(cred->euid, tun->owner)) ||
(gid_valid(tun->group) && !in_egroup_p(tun->group))) &&
!ns_capable(net->user_ns, CAP_NET_ADMIN);
@@ -1340,7 +1316,7 @@ diff -NurpP --minimal linux-3.18.5/drivers/net/tun.c linux-3.18.5-vs2.3.7.3/driv
}
static void tun_set_real_num_queues(struct tun_struct *tun)
-@@ -1413,6 +1416,7 @@ static void tun_setup(struct net_device
+@@ -1549,6 +1552,7 @@ static void tun_setup(struct net_device
tun->owner = INVALID_UID;
tun->group = INVALID_GID;
@@ -1348,7 +1324,7 @@ diff -NurpP --minimal linux-3.18.5/drivers/net/tun.c linux-3.18.5-vs2.3.7.3/driv
dev->ethtool_ops = &tun_ethtool_ops;
dev->destructor = tun_free_netdev;
-@@ -1629,7 +1633,7 @@ static int tun_set_iff(struct net *net,
+@@ -1760,7 +1764,7 @@ static int tun_set_iff(struct net *net,
int queues = ifr->ifr_flags & IFF_MULTI_QUEUE ?
MAX_TAP_QUEUES : 1;
@@ -1357,7 +1333,7 @@ diff -NurpP --minimal linux-3.18.5/drivers/net/tun.c linux-3.18.5-vs2.3.7.3/driv
return -EPERM;
err = security_tun_dev_create();
if (err < 0)
-@@ -1996,6 +2000,16 @@ static long __tun_chr_ioctl(struct file
+@@ -2125,6 +2129,16 @@ static long __tun_chr_ioctl(struct file
from_kgid(&init_user_ns, tun->group));
break;
@@ -1374,10 +1350,10 @@ diff -NurpP --minimal linux-3.18.5/drivers/net/tun.c linux-3.18.5-vs2.3.7.3/driv
case TUNSETLINK:
/* Only allow setting the type when the interface is down */
if (tun->dev->flags & IFF_UP) {
-diff -NurpP --minimal linux-3.18.5/drivers/scsi/cxgbi/libcxgbi.c linux-3.18.5-vs2.3.7.3/drivers/scsi/cxgbi/libcxgbi.c
---- linux-3.18.5/drivers/scsi/cxgbi/libcxgbi.c 2015-01-17 02:40:05.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/drivers/scsi/cxgbi/libcxgbi.c 2015-02-06 01:59:47.000000000 +0000
-@@ -764,7 +764,8 @@ static struct cxgbi_sock *cxgbi_check_ro
+diff -NurpP --minimal linux-4.9.76/drivers/scsi/cxgbi/libcxgbi.c linux-4.9.76-vs2.3.9.5/drivers/scsi/cxgbi/libcxgbi.c
+--- linux-4.9.76/drivers/scsi/cxgbi/libcxgbi.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/drivers/scsi/cxgbi/libcxgbi.c 2018-01-10 02:50:49.000000000 +0000
+@@ -772,7 +772,8 @@ static struct cxgbi_sock *cxgbi_check_ro
struct inet6_dev *idev = ip6_dst_idev((struct dst_entry *)rt);
err = ipv6_dev_get_saddr(&init_net, idev ? idev->dev : NULL,
@@ -1387,9 +1363,9 @@ diff -NurpP --minimal linux-3.18.5/drivers/scsi/cxgbi/libcxgbi.c linux-3.18.5-vs
if (err) {
pr_info("failed to get source address to reach %pI6\n",
&daddr6->sin6_addr);
-diff -NurpP --minimal linux-3.18.5/drivers/tty/sysrq.c linux-3.18.5-vs2.3.7.3/drivers/tty/sysrq.c
---- linux-3.18.5/drivers/tty/sysrq.c 2015-01-16 22:19:12.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/drivers/tty/sysrq.c 2015-01-19 11:01:25.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/drivers/tty/sysrq.c linux-4.9.76-vs2.3.9.5/drivers/tty/sysrq.c
+--- linux-4.9.76/drivers/tty/sysrq.c 2018-01-13 21:28:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/drivers/tty/sysrq.c 2018-01-10 02:50:49.000000000 +0000
@@ -47,6 +47,7 @@
#include <linux/syscalls.h>
#include <linux/of.h>
@@ -1398,7 +1374,7 @@ diff -NurpP --minimal linux-3.18.5/drivers/tty/sysrq.c linux-3.18.5-vs2.3.7.3/dr
#include <asm/ptrace.h>
#include <asm/irq_regs.h>
-@@ -408,6 +409,21 @@ static struct sysrq_key_op sysrq_unrt_op
+@@ -428,6 +429,21 @@ static struct sysrq_key_op sysrq_unrt_op
.enable_mask = SYSRQ_ENABLE_RTNICE,
};
@@ -1420,8 +1396,8 @@ diff -NurpP --minimal linux-3.18.5/drivers/tty/sysrq.c linux-3.18.5-vs2.3.7.3/dr
/* Key Operations table and lock */
static DEFINE_SPINLOCK(sysrq_key_table_lock);
-@@ -463,7 +479,11 @@ static struct sysrq_key_op *sysrq_key_ta
- &sysrq_showstate_blocked_op, /* w */
+@@ -484,7 +500,11 @@ static struct sysrq_key_op *sysrq_key_ta
+ /* x: May be registered on mips for TLB dump */
/* x: May be registered on ppc/powerpc for xmon */
/* x: May be registered on sparc64 for global PMU dump */
+#ifdef CONFIG_VSERVER_DEBUG
@@ -1432,7 +1408,7 @@ diff -NurpP --minimal linux-3.18.5/drivers/tty/sysrq.c linux-3.18.5-vs2.3.7.3/dr
/* y: May be registered on sparc64 for global register dump */
NULL, /* y */
&sysrq_ftrace_dump_op, /* z */
-@@ -478,6 +498,8 @@ static int sysrq_key_table_key2index(int
+@@ -499,6 +519,8 @@ static int sysrq_key_table_key2index(int
retval = key - '0';
else if ((key >= 'a') && (key <= 'z'))
retval = key + 10 - 'a';
@@ -1441,9 +1417,9 @@ diff -NurpP --minimal linux-3.18.5/drivers/tty/sysrq.c linux-3.18.5-vs2.3.7.3/dr
else
retval = -1;
return retval;
-diff -NurpP --minimal linux-3.18.5/drivers/tty/tty_io.c linux-3.18.5-vs2.3.7.3/drivers/tty/tty_io.c
---- linux-3.18.5/drivers/tty/tty_io.c 2015-01-17 02:40:14.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/drivers/tty/tty_io.c 2015-01-19 10:57:46.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/drivers/tty/tty_io.c linux-4.9.76-vs2.3.9.5/drivers/tty/tty_io.c
+--- linux-4.9.76/drivers/tty/tty_io.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/drivers/tty/tty_io.c 2018-01-10 02:50:49.000000000 +0000
@@ -104,6 +104,7 @@
#include <linux/kmod.h>
@@ -1451,8 +1427,8 @@ diff -NurpP --minimal linux-3.18.5/drivers/tty/tty_io.c linux-3.18.5-vs2.3.7.3/d
+#include <linux/vs_pid.h>
#undef TTY_DEBUG_HANGUP
-
-@@ -2237,7 +2238,8 @@ static int tiocsti(struct tty_struct *tt
+ #ifdef TTY_DEBUG_HANGUP
+@@ -2286,7 +2287,8 @@ static int tiocsti(struct tty_struct *tt
char ch, mbz = 0;
struct tty_ldisc *ld;
@@ -1462,7 +1438,7 @@ diff -NurpP --minimal linux-3.18.5/drivers/tty/tty_io.c linux-3.18.5-vs2.3.7.3/d
return -EPERM;
if (get_user(ch, p))
return -EFAULT;
-@@ -2525,6 +2527,7 @@ static int tiocspgrp(struct tty_struct *
+@@ -2601,6 +2603,7 @@ static int tiocspgrp(struct tty_struct *
return -ENOTTY;
if (get_user(pgrp_nr, p))
return -EFAULT;
@@ -1470,9 +1446,9 @@ diff -NurpP --minimal linux-3.18.5/drivers/tty/tty_io.c linux-3.18.5-vs2.3.7.3/d
if (pgrp_nr < 0)
return -EINVAL;
rcu_read_lock();
-diff -NurpP --minimal linux-3.18.5/fs/attr.c linux-3.18.5-vs2.3.7.3/fs/attr.c
---- linux-3.18.5/fs/attr.c 2014-09-03 13:19:35.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/attr.c 2015-01-19 10:57:46.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/fs/attr.c linux-4.9.76-vs2.3.9.5/fs/attr.c
+--- linux-4.9.76/fs/attr.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/attr.c 2018-01-10 02:50:49.000000000 +0000
@@ -15,6 +15,9 @@
#include <linux/security.h>
#include <linux/evm.h>
@@ -1482,9 +1458,9 @@ diff -NurpP --minimal linux-3.18.5/fs/attr.c linux-3.18.5-vs2.3.7.3/fs/attr.c
+#include <linux/vs_tag.h>
/**
- * inode_change_ok - check if attribute changes to an inode are allowed
-@@ -77,6 +80,10 @@ int inode_change_ok(const struct inode *
- return -EPERM;
+ * setattr_prepare - check if attribute changes to a dentry are allowed
+@@ -90,6 +93,10 @@ kill_priv:
+ return error;
}
+ /* check for inode tag permission */
@@ -1493,8 +1469,8 @@ diff -NurpP --minimal linux-3.18.5/fs/attr.c linux-3.18.5-vs2.3.7.3/fs/attr.c
+
return 0;
}
- EXPORT_SYMBOL(inode_change_ok);
-@@ -147,6 +154,8 @@ void setattr_copy(struct inode *inode, c
+ EXPORT_SYMBOL(setattr_prepare);
+@@ -160,6 +167,8 @@ void setattr_copy(struct inode *inode, c
inode->i_uid = attr->ia_uid;
if (ia_valid & ATTR_GID)
inode->i_gid = attr->ia_gid;
@@ -1503,9 +1479,9 @@ diff -NurpP --minimal linux-3.18.5/fs/attr.c linux-3.18.5-vs2.3.7.3/fs/attr.c
if (ia_valid & ATTR_ATIME)
inode->i_atime = timespec_trunc(attr->ia_atime,
inode->i_sb->s_time_gran);
-@@ -197,7 +206,8 @@ int notify_change(struct dentry * dentry
+@@ -210,7 +219,8 @@ int notify_change(struct dentry * dentry
- WARN_ON_ONCE(!mutex_is_locked(&inode->i_mutex));
+ WARN_ON_ONCE(!inode_is_locked(inode));
- if (ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID | ATTR_TIMES_SET)) {
+ if (ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID |
@@ -1513,18 +1489,18 @@ diff -NurpP --minimal linux-3.18.5/fs/attr.c linux-3.18.5-vs2.3.7.3/fs/attr.c
if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
return -EPERM;
}
-diff -NurpP --minimal linux-3.18.5/fs/block_dev.c linux-3.18.5-vs2.3.7.3/fs/block_dev.c
---- linux-3.18.5/fs/block_dev.c 2015-01-17 02:40:16.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/block_dev.c 2015-01-19 10:57:46.000000000 +0000
-@@ -28,6 +28,7 @@
- #include <linux/log2.h>
- #include <linux/cleancache.h>
- #include <linux/aio.h>
+diff -NurpP --minimal linux-4.9.76/fs/block_dev.c linux-4.9.76-vs2.3.9.5/fs/block_dev.c
+--- linux-4.9.76/fs/block_dev.c 2018-01-13 21:28:56.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/block_dev.c 2018-01-13 00:48:31.000000000 +0000
+@@ -31,6 +31,7 @@
+ #include <linux/dax.h>
+ #include <linux/badblocks.h>
+ #include <linux/falloc.h>
+#include <linux/vs_device.h>
#include <asm/uaccess.h>
#include "internal.h"
-@@ -575,6 +576,7 @@ struct block_device *bdget(dev_t dev)
+@@ -720,6 +721,7 @@ struct block_device *bdget(dev_t dev)
bdev->bd_invalidated = 0;
inode->i_mode = S_IFBLK;
inode->i_rdev = dev;
@@ -1532,7 +1508,7 @@ diff -NurpP --minimal linux-3.18.5/fs/block_dev.c linux-3.18.5-vs2.3.7.3/fs/bloc
inode->i_bdev = bdev;
inode->i_data.a_ops = &def_blk_aops;
mapping_set_gfp_mask(&inode->i_data, GFP_USER);
-@@ -622,6 +624,11 @@ EXPORT_SYMBOL(bdput);
+@@ -766,6 +768,11 @@ EXPORT_SYMBOL(bdput);
static struct block_device *bd_acquire(struct inode *inode)
{
struct block_device *bdev;
@@ -1544,7 +1520,7 @@ diff -NurpP --minimal linux-3.18.5/fs/block_dev.c linux-3.18.5-vs2.3.7.3/fs/bloc
spin_lock(&bdev_lock);
bdev = inode->i_bdev;
-@@ -632,7 +639,7 @@ static struct block_device *bd_acquire(s
+@@ -776,7 +783,7 @@ static struct block_device *bd_acquire(s
}
spin_unlock(&bdev_lock);
@@ -1553,35 +1529,19 @@ diff -NurpP --minimal linux-3.18.5/fs/block_dev.c linux-3.18.5-vs2.3.7.3/fs/bloc
if (bdev) {
spin_lock(&bdev_lock);
if (!inode->i_bdev) {
-diff -NurpP --minimal linux-3.18.5/fs/btrfs/ctree.h linux-3.18.5-vs2.3.7.3/fs/btrfs/ctree.h
---- linux-3.18.5/fs/btrfs/ctree.h 2015-01-17 02:40:16.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/btrfs/ctree.h 2015-01-19 10:57:46.000000000 +0000
-@@ -728,11 +728,14 @@ struct btrfs_inode_item {
- /* modification sequence number for NFS */
- __le64 sequence;
-
-+ __le16 tag;
- /*
- * a little future expansion, for more than this we can
- * just grow the inode item and version it
- */
-- __le64 reserved[4];
-+ __le16 reserved16;
-+ __le32 reserved32;
-+ __le64 reserved[3];
- struct btrfs_timespec atime;
- struct btrfs_timespec ctime;
- struct btrfs_timespec mtime;
-@@ -2098,6 +2101,8 @@ struct btrfs_ioctl_defrag_range_args {
+diff -NurpP --minimal linux-4.9.76/fs/btrfs/ctree.h linux-4.9.76-vs2.3.9.5/fs/btrfs/ctree.h
+--- linux-4.9.76/fs/btrfs/ctree.h 2018-01-13 21:28:56.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/btrfs/ctree.h 2018-01-10 02:50:49.000000000 +0000
+@@ -1321,6 +1321,8 @@ static inline u32 BTRFS_MAX_XATTR_SIZE(c
#define BTRFS_DEFAULT_COMMIT_INTERVAL (30)
- #define BTRFS_DEFAULT_MAX_INLINE (8192)
+ #define BTRFS_DEFAULT_MAX_INLINE (2048)
+#define BTRFS_MOUNT_TAGGED (1 << 24)
+
#define btrfs_clear_opt(o, opt) ((o) &= ~BTRFS_MOUNT_##opt)
#define btrfs_set_opt(o, opt) ((o) |= BTRFS_MOUNT_##opt)
#define btrfs_raw_test_opt(o, opt) ((o) & BTRFS_MOUNT_##opt)
-@@ -2381,6 +2386,7 @@ BTRFS_SETGET_FUNCS(inode_block_group, st
+@@ -1668,6 +1670,7 @@ BTRFS_SETGET_FUNCS(inode_block_group, st
BTRFS_SETGET_FUNCS(inode_nlink, struct btrfs_inode_item, nlink, 32);
BTRFS_SETGET_FUNCS(inode_uid, struct btrfs_inode_item, uid, 32);
BTRFS_SETGET_FUNCS(inode_gid, struct btrfs_inode_item, gid, 32);
@@ -1589,7 +1549,7 @@ diff -NurpP --minimal linux-3.18.5/fs/btrfs/ctree.h linux-3.18.5-vs2.3.7.3/fs/bt
BTRFS_SETGET_FUNCS(inode_mode, struct btrfs_inode_item, mode, 32);
BTRFS_SETGET_FUNCS(inode_rdev, struct btrfs_inode_item, rdev, 64);
BTRFS_SETGET_FUNCS(inode_flags, struct btrfs_inode_item, flags, 64);
-@@ -2453,6 +2459,10 @@ BTRFS_SETGET_FUNCS(extent_flags, struct
+@@ -1715,6 +1718,10 @@ BTRFS_SETGET_FUNCS(extent_flags, struct
BTRFS_SETGET_FUNCS(extent_refs_v0, struct btrfs_extent_item_v0, refs, 32);
@@ -1600,7 +1560,7 @@ diff -NurpP --minimal linux-3.18.5/fs/btrfs/ctree.h linux-3.18.5-vs2.3.7.3/fs/bt
BTRFS_SETGET_FUNCS(tree_block_level, struct btrfs_tree_block_info, level, 8);
-@@ -3864,6 +3874,7 @@ long btrfs_ioctl(struct file *file, unsi
+@@ -3197,6 +3204,7 @@ int btrfs_ioctl_get_supported_features(v
void btrfs_update_iflags(struct inode *inode);
void btrfs_inherit_iflags(struct inode *inode, struct inode *dir);
int btrfs_is_empty_uuid(u8 *uuid);
@@ -1608,31 +1568,31 @@ diff -NurpP --minimal linux-3.18.5/fs/btrfs/ctree.h linux-3.18.5-vs2.3.7.3/fs/bt
int btrfs_defrag_file(struct inode *inode, struct file *file,
struct btrfs_ioctl_defrag_range_args *range,
u64 newer_than, unsigned long max_pages);
-diff -NurpP --minimal linux-3.18.5/fs/btrfs/disk-io.c linux-3.18.5-vs2.3.7.3/fs/btrfs/disk-io.c
---- linux-3.18.5/fs/btrfs/disk-io.c 2015-02-05 18:02:44.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/btrfs/disk-io.c 2015-01-19 10:57:46.000000000 +0000
-@@ -2460,6 +2460,9 @@ int open_ctree(struct super_block *sb,
+diff -NurpP --minimal linux-4.9.76/fs/btrfs/disk-io.c linux-4.9.76-vs2.3.9.5/fs/btrfs/disk-io.c
+--- linux-4.9.76/fs/btrfs/disk-io.c 2018-01-13 21:28:56.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/btrfs/disk-io.c 2018-01-13 05:55:56.000000000 +0000
+@@ -2850,6 +2850,9 @@ int open_ctree(struct super_block *sb,
goto fail_alloc;
}
-+ if (btrfs_test_opt(tree_root, TAGGED))
++ if (btrfs_test_opt(fs_info, TAGGED))
+ sb->s_flags |= MS_TAGGED;
+
features = btrfs_super_incompat_flags(disk_super) &
~BTRFS_FEATURE_INCOMPAT_SUPP;
if (features) {
-diff -NurpP --minimal linux-3.18.5/fs/btrfs/inode.c linux-3.18.5-vs2.3.7.3/fs/btrfs/inode.c
---- linux-3.18.5/fs/btrfs/inode.c 2015-01-17 02:40:16.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/btrfs/inode.c 2015-01-19 12:26:30.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/fs/btrfs/inode.c linux-4.9.76-vs2.3.9.5/fs/btrfs/inode.c
+--- linux-4.9.76/fs/btrfs/inode.c 2018-01-13 21:28:56.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/btrfs/inode.c 2018-01-13 01:41:05.000000000 +0000
@@ -43,6 +43,7 @@
- #include <linux/btrfs.h>
#include <linux/blkdev.h>
#include <linux/posix_acl_xattr.h>
+ #include <linux/uio.h>
+#include <linux/vs_tag.h>
#include "ctree.h"
#include "disk-io.h"
#include "transaction.h"
-@@ -3477,6 +3478,9 @@ static void btrfs_read_locked_inode(stru
+@@ -3662,6 +3663,9 @@ static int btrfs_read_locked_inode(struc
unsigned long ptr;
int maybe_acls;
u32 rdev;
@@ -1642,7 +1602,7 @@ diff -NurpP --minimal linux-3.18.5/fs/btrfs/inode.c linux-3.18.5-vs2.3.7.3/fs/bt
int ret;
bool filled = false;
int first_xattr_slot;
-@@ -3504,8 +3508,14 @@ static void btrfs_read_locked_inode(stru
+@@ -3694,8 +3698,14 @@ static int btrfs_read_locked_inode(struc
struct btrfs_inode_item);
inode->i_mode = btrfs_inode_mode(leaf, inode_item);
set_nlink(inode, btrfs_inode_nlink(leaf, inode_item));
@@ -1658,8 +1618,8 @@ diff -NurpP --minimal linux-3.18.5/fs/btrfs/inode.c linux-3.18.5-vs2.3.7.3/fs/bt
+ inode->i_tag = INOTAG_KTAG(DX_TAG(inode), kuid, kgid, ktag);
btrfs_i_size_write(inode, btrfs_inode_size(leaf, inode_item));
- tspec = btrfs_inode_atime(inode_item);
-@@ -3629,11 +3639,18 @@ static void fill_inode_item(struct btrfs
+ inode->i_atime.tv_sec = btrfs_timespec_sec(leaf, &inode_item->atime);
+@@ -3850,11 +3860,18 @@ static void fill_inode_item(struct btrfs
struct inode *inode)
{
struct btrfs_map_token token;
@@ -1680,34 +1640,34 @@ diff -NurpP --minimal linux-3.18.5/fs/btrfs/inode.c linux-3.18.5-vs2.3.7.3/fs/bt
btrfs_set_token_inode_size(leaf, item, BTRFS_I(inode)->disk_i_size,
&token);
btrfs_set_token_inode_mode(leaf, item, inode->i_mode, &token);
-@@ -9459,6 +9476,7 @@ static const struct inode_operations btr
+@@ -10613,6 +10630,7 @@ static const struct inode_operations btr
+ .mknod = btrfs_mknod,
.listxattr = btrfs_listxattr,
- .removexattr = btrfs_removexattr,
.permission = btrfs_permission,
+ .sync_flags = btrfs_sync_flags,
.get_acl = btrfs_get_acl,
.set_acl = btrfs_set_acl,
.update_time = btrfs_update_time,
-@@ -9467,6 +9485,7 @@ static const struct inode_operations btr
+@@ -10621,6 +10639,7 @@ static const struct inode_operations btr
static const struct inode_operations btrfs_dir_ro_inode_operations = {
.lookup = btrfs_lookup,
.permission = btrfs_permission,
+ .sync_flags = btrfs_sync_flags,
- .get_acl = btrfs_get_acl,
- .set_acl = btrfs_set_acl,
.update_time = btrfs_update_time,
-@@ -9537,6 +9556,7 @@ static const struct inode_operations btr
- .removexattr = btrfs_removexattr,
+ };
+
+@@ -10686,6 +10705,7 @@ static const struct inode_operations btr
+ .listxattr = btrfs_listxattr,
.permission = btrfs_permission,
.fiemap = btrfs_fiemap,
+ .sync_flags = btrfs_sync_flags,
.get_acl = btrfs_get_acl,
.set_acl = btrfs_set_acl,
.update_time = btrfs_update_time,
-diff -NurpP --minimal linux-3.18.5/fs/btrfs/ioctl.c linux-3.18.5-vs2.3.7.3/fs/btrfs/ioctl.c
---- linux-3.18.5/fs/btrfs/ioctl.c 2015-01-17 02:40:16.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/btrfs/ioctl.c 2015-01-21 09:54:51.000000000 +0000
-@@ -107,10 +107,13 @@ static unsigned int btrfs_flags_to_ioctl
+diff -NurpP --minimal linux-4.9.76/fs/btrfs/ioctl.c linux-4.9.76-vs2.3.9.5/fs/btrfs/ioctl.c
+--- linux-4.9.76/fs/btrfs/ioctl.c 2018-01-13 21:28:56.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/btrfs/ioctl.c 2018-01-10 02:50:49.000000000 +0000
+@@ -110,10 +110,13 @@ static unsigned int btrfs_flags_to_ioctl
{
unsigned int iflags = 0;
@@ -1723,9 +1683,9 @@ diff -NurpP --minimal linux-3.18.5/fs/btrfs/ioctl.c linux-3.18.5-vs2.3.7.3/fs/bt
if (flags & BTRFS_INODE_APPEND)
iflags |= FS_APPEND_FL;
if (flags & BTRFS_INODE_NODUMP)
-@@ -127,34 +130,84 @@ static unsigned int btrfs_flags_to_ioctl
- else if (flags & BTRFS_INODE_NOCOMPRESS)
- iflags |= FS_NOCOMP_FL;
+@@ -130,34 +133,84 @@ static unsigned int btrfs_flags_to_ioctl
+ else if (flags & BTRFS_INODE_COMPRESS)
+ iflags |= FS_COMPR_FL;
+ if (flags & BTRFS_INODE_BARRIER)
+ iflags |= FS_BARRIER_FL;
@@ -1813,7 +1773,7 @@ diff -NurpP --minimal linux-3.18.5/fs/btrfs/ioctl.c linux-3.18.5-vs2.3.7.3/fs/bt
* Inherit flags from the parent inode.
*
* Currently only the compression flags and the cow flags are inherited.
-@@ -167,6 +220,7 @@ void btrfs_inherit_iflags(struct inode *
+@@ -170,6 +223,7 @@ void btrfs_inherit_iflags(struct inode *
return;
flags = BTRFS_I(dir)->flags;
@@ -1821,7 +1781,7 @@ diff -NurpP --minimal linux-3.18.5/fs/btrfs/ioctl.c linux-3.18.5-vs2.3.7.3/fs/bt
if (flags & BTRFS_INODE_NOCOMPRESS) {
BTRFS_I(inode)->flags &= ~BTRFS_INODE_COMPRESS;
-@@ -185,6 +239,30 @@ void btrfs_inherit_iflags(struct inode *
+@@ -188,6 +242,30 @@ void btrfs_inherit_iflags(struct inode *
btrfs_update_iflags(inode);
}
@@ -1852,7 +1812,7 @@ diff -NurpP --minimal linux-3.18.5/fs/btrfs/ioctl.c linux-3.18.5-vs2.3.7.3/fs/bt
static int btrfs_ioctl_getflags(struct file *file, void __user *arg)
{
struct btrfs_inode *ip = BTRFS_I(file_inode(file));
-@@ -247,21 +325,27 @@ static int btrfs_ioctl_setflags(struct f
+@@ -250,21 +328,27 @@ static int btrfs_ioctl_setflags(struct f
flags = btrfs_mask_flags(inode->i_mode, flags);
oldflags = btrfs_flags_to_ioctl(ip->flags);
@@ -1885,32 +1845,32 @@ diff -NurpP --minimal linux-3.18.5/fs/btrfs/ioctl.c linux-3.18.5-vs2.3.7.3/fs/bt
if (flags & FS_APPEND_FL)
ip->flags |= BTRFS_INODE_APPEND;
else
-diff -NurpP --minimal linux-3.18.5/fs/btrfs/super.c linux-3.18.5-vs2.3.7.3/fs/btrfs/super.c
---- linux-3.18.5/fs/btrfs/super.c 2015-02-05 18:02:44.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/btrfs/super.c 2015-01-19 10:57:46.000000000 +0000
-@@ -325,7 +325,7 @@ enum {
- Opt_commit_interval, Opt_barrier, Opt_nodefrag, Opt_nodiscard,
- Opt_noenospc_debug, Opt_noflushoncommit, Opt_acl, Opt_datacow,
- Opt_datasum, Opt_treelog, Opt_noinode_cache,
+diff -NurpP --minimal linux-4.9.76/fs/btrfs/super.c linux-4.9.76-vs2.3.9.5/fs/btrfs/super.c
+--- linux-4.9.76/fs/btrfs/super.c 2018-01-13 21:28:56.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/btrfs/super.c 2018-01-13 05:51:52.000000000 +0000
+@@ -327,7 +327,7 @@ enum {
+ #ifdef CONFIG_BTRFS_DEBUG
+ Opt_fragment_data, Opt_fragment_metadata, Opt_fragment_all,
+ #endif
- Opt_err,
+ Opt_tag, Opt_notag, Opt_tagid, Opt_err,
};
- static match_table_t tokens = {
-@@ -377,6 +377,9 @@ static match_table_t tokens = {
- {Opt_rescan_uuid_tree, "rescan_uuid_tree"},
- {Opt_fatal_errors, "fatal_errors=%s"},
- {Opt_commit_interval, "commit=%d"},
+ static const match_table_t tokens = {
+@@ -388,6 +388,9 @@ static const match_table_t tokens = {
+ {Opt_fragment_metadata, "fragment=metadata"},
+ {Opt_fragment_all, "fragment=all"},
+ #endif
+ {Opt_tag, "tag"},
+ {Opt_notag, "notag"},
+ {Opt_tagid, "tagid=%u"},
{Opt_err, NULL},
};
-@@ -743,6 +746,22 @@ int btrfs_parse_options(struct btrfs_roo
- info->commit_interval = BTRFS_DEFAULT_COMMIT_INTERVAL;
- }
+@@ -833,6 +836,22 @@ int btrfs_parse_options(struct btrfs_roo
+ btrfs_set_opt(info->mount_opt, FRAGMENT_DATA);
break;
+ #endif
+#ifndef CONFIG_TAGGING_NONE
+ case Opt_tag:
+ printk(KERN_INFO "btrfs: use tagging\n");
@@ -1928,13 +1888,13 @@ diff -NurpP --minimal linux-3.18.5/fs/btrfs/super.c linux-3.18.5-vs2.3.7.3/fs/bt
+ break;
+#endif
case Opt_err:
- btrfs_info(root->fs_info, "unrecognized mount option '%s'", p);
- ret = -EINVAL;
-@@ -1495,6 +1514,12 @@ static int btrfs_remount(struct super_bl
+ btrfs_info(root->fs_info,
+ "unrecognized mount option '%s'", p);
+@@ -1754,6 +1773,12 @@ static int btrfs_remount(struct super_bl
btrfs_resize_thread_pool(fs_info,
fs_info->thread_pool_size, old_thread_pool_size);
-+ if (btrfs_test_opt(root, TAGGED) && !(sb->s_flags & MS_TAGGED)) {
++ if (btrfs_test_opt(fs_info, TAGGED) && !(sb->s_flags & MS_TAGGED)) {
+ printk("btrfs: %s: tagging not permitted on remount.\n",
+ sb->s_id);
+ return -EINVAL;
@@ -1943,9 +1903,9 @@ diff -NurpP --minimal linux-3.18.5/fs/btrfs/super.c linux-3.18.5-vs2.3.7.3/fs/bt
if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
goto out;
-diff -NurpP --minimal linux-3.18.5/fs/char_dev.c linux-3.18.5-vs2.3.7.3/fs/char_dev.c
---- linux-3.18.5/fs/char_dev.c 2014-01-22 20:39:05.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/char_dev.c 2015-01-19 10:57:46.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/fs/char_dev.c linux-4.9.76-vs2.3.9.5/fs/char_dev.c
+--- linux-4.9.76/fs/char_dev.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/char_dev.c 2018-01-10 02:50:49.000000000 +0000
@@ -21,6 +21,8 @@
#include <linux/mutex.h>
#include <linux/backing-dev.h>
@@ -1955,7 +1915,7 @@ diff -NurpP --minimal linux-3.18.5/fs/char_dev.c linux-3.18.5-vs2.3.7.3/fs/char_
#include "internal.h"
-@@ -372,14 +374,21 @@ static int chrdev_open(struct inode *ino
+@@ -354,14 +356,21 @@ static int chrdev_open(struct inode *ino
struct cdev *p;
struct cdev *new = NULL;
int ret = 0;
@@ -1978,18 +1938,34 @@ diff -NurpP --minimal linux-3.18.5/fs/char_dev.c linux-3.18.5-vs2.3.7.3/fs/char_
if (!kobj)
return -ENXIO;
new = container_of(kobj, struct cdev, kobj);
-diff -NurpP --minimal linux-3.18.5/fs/dcache.c linux-3.18.5-vs2.3.7.3/fs/dcache.c
---- linux-3.18.5/fs/dcache.c 2015-02-05 18:02:45.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/dcache.c 2015-01-19 12:06:59.000000000 +0000
-@@ -38,6 +38,7 @@
- #include <linux/prefetch.h>
+diff -NurpP --minimal linux-4.9.76/fs/dcache.c linux-4.9.76-vs2.3.9.5/fs/dcache.c
+--- linux-4.9.76/fs/dcache.c 2018-01-13 21:28:56.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/dcache.c 2018-01-10 02:50:49.000000000 +0000
+@@ -39,6 +39,7 @@
#include <linux/ratelimit.h>
#include <linux/list_lru.h>
+ #include <linux/kasan.h>
+#include <linux/vs_limit.h>
+
#include "internal.h"
#include "mount.h"
+@@ -680,6 +681,7 @@ static inline bool fast_dput(struct dent
+ spin_lock(&dentry->d_lock);
+ if (dentry->d_lockref.count > 1) {
+ dentry->d_lockref.count--;
++ vx_dentry_dec(dentry);
+ spin_unlock(&dentry->d_lock);
+ return 1;
+ }
+@@ -811,6 +813,7 @@ repeat:
+ dentry_lru_add(dentry);
-@@ -654,6 +655,7 @@ EXPORT_SYMBOL(dput);
+ dentry->d_lockref.count--;
++ vx_dentry_dec(dentry);
+ spin_unlock(&dentry->d_lock);
+ return;
+
+@@ -828,6 +831,7 @@ EXPORT_SYMBOL(dput);
static inline void __dget_dlock(struct dentry *dentry)
{
dentry->d_lockref.count++;
@@ -1997,7 +1973,7 @@ diff -NurpP --minimal linux-3.18.5/fs/dcache.c linux-3.18.5-vs2.3.7.3/fs/dcache.
}
static inline void __dget(struct dentry *dentry)
-@@ -666,6 +668,8 @@ struct dentry *dget_parent(struct dentry
+@@ -840,6 +844,8 @@ struct dentry *dget_parent(struct dentry
int gotref;
struct dentry *ret;
@@ -2006,9 +1982,25 @@ diff -NurpP --minimal linux-3.18.5/fs/dcache.c linux-3.18.5-vs2.3.7.3/fs/dcache.
/*
* Do optimistic parent lookup without any
* locking.
-@@ -1410,6 +1414,9 @@ struct dentry *__d_alloc(struct super_bl
- struct dentry *dentry;
+@@ -870,6 +876,7 @@ repeat:
+ rcu_read_unlock();
+ BUG_ON(!ret->d_lockref.count);
+ ret->d_lockref.count++;
++ vx_dentry_inc(ret);
+ spin_unlock(&ret->d_lock);
+ return ret;
+ }
+@@ -1024,6 +1031,7 @@ static void shrink_dentry_list(struct li
+ parent = lock_parent(dentry);
+ if (dentry->d_lockref.count != 1) {
+ dentry->d_lockref.count--;
++ vx_dentry_dec(dentry);
+ spin_unlock(&dentry->d_lock);
+ if (parent)
+ spin_unlock(&parent->d_lock);
+@@ -1590,6 +1598,9 @@ struct dentry *__d_alloc(struct super_bl
char *dname;
+ int err;
+ if (!vx_dentry_avail(1))
+ return NULL;
@@ -2016,7 +2008,7 @@ diff -NurpP --minimal linux-3.18.5/fs/dcache.c linux-3.18.5-vs2.3.7.3/fs/dcache.
dentry = kmem_cache_alloc(dentry_cache, GFP_KERNEL);
if (!dentry)
return NULL;
-@@ -1445,6 +1452,7 @@ struct dentry *__d_alloc(struct super_bl
+@@ -1633,6 +1644,7 @@ struct dentry *__d_alloc(struct super_bl
dentry->d_lockref.count = 1;
dentry->d_flags = 0;
@@ -2024,17 +2016,25 @@ diff -NurpP --minimal linux-3.18.5/fs/dcache.c linux-3.18.5-vs2.3.7.3/fs/dcache.
spin_lock_init(&dentry->d_lock);
seqcount_init(&dentry->d_seq);
dentry->d_inode = NULL;
-@@ -2184,6 +2192,7 @@ struct dentry *__d_lookup(const struct d
- }
+@@ -2282,6 +2294,7 @@ struct dentry *__d_lookup(const struct d
+ goto next;
dentry->d_lockref.count++;
+ vx_dentry_inc(dentry);
found = dentry;
spin_unlock(&dentry->d_lock);
break;
-diff -NurpP --minimal linux-3.18.5/fs/devpts/inode.c linux-3.18.5-vs2.3.7.3/fs/devpts/inode.c
---- linux-3.18.5/fs/devpts/inode.c 2014-09-03 13:19:39.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/devpts/inode.c 2015-01-19 10:57:47.000000000 +0000
+@@ -3532,6 +3545,7 @@ static enum d_walk_ret d_genocide_kill(v
+ if (!(dentry->d_flags & DCACHE_GENOCIDE)) {
+ dentry->d_flags |= DCACHE_GENOCIDE;
+ dentry->d_lockref.count--;
++ vx_dentry_dec(dentry);
+ }
+ }
+ return D_WALK_CONTINUE;
+diff -NurpP --minimal linux-4.9.76/fs/devpts/inode.c linux-4.9.76-vs2.3.9.5/fs/devpts/inode.c
+--- linux-4.9.76/fs/devpts/inode.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/devpts/inode.c 2018-01-13 01:06:29.000000000 +0000
@@ -27,6 +27,7 @@
#include <linux/parser.h>
#include <linux/fsnotify.h>
@@ -2065,7 +2065,7 @@ diff -NurpP --minimal linux-3.18.5/fs/devpts/inode.c linux-3.18.5-vs2.3.7.3/fs/d
/*
* sysctl support for setting limits on the number of Unix98 ptys allocated.
* Otherwise one can eat up all kernel memory by opening /dev/ptmx repeatedly.
-@@ -350,6 +366,34 @@ static int devpts_show_options(struct se
+@@ -363,6 +379,34 @@ static int devpts_show_options(struct se
return 0;
}
@@ -2100,8 +2100,8 @@ diff -NurpP --minimal linux-3.18.5/fs/devpts/inode.c linux-3.18.5-vs2.3.7.3/fs/d
static const struct super_operations devpts_sops = {
.statfs = simple_statfs,
.remount_fs = devpts_remount,
-@@ -393,8 +437,10 @@ devpts_fill_super(struct super_block *s,
- inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
+@@ -415,8 +459,10 @@ devpts_fill_super(struct super_block *s,
+ inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR;
inode->i_op = &simple_dir_inode_operations;
- inode->i_fop = &simple_dir_operations;
@@ -2111,20 +2111,20 @@ diff -NurpP --minimal linux-3.18.5/fs/devpts/inode.c linux-3.18.5-vs2.3.7.3/fs/d
+ i_tag_write(inode, (vtag_t)vx_current_xid());
s->s_root = d_make_root(inode);
- if (s->s_root)
-@@ -598,6 +644,9 @@ struct inode *devpts_pty_new(struct inod
+ if (!s->s_root) {
+@@ -542,6 +588,9 @@ struct dentry *devpts_pty_new(struct pts
inode->i_gid = opts->setgid ? opts->gid : current_fsgid();
- inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
- init_special_inode(inode, S_IFCHR|opts->mode, device);
+ inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
+ init_special_inode(inode, S_IFCHR|opts->mode, MKDEV(UNIX98_PTY_SLAVE_MAJOR, index));
+ /* devpts is xid tagged */
+ i_tag_write(inode, (vtag_t)vx_current_xid());
+ inode->i_op = &devpts_file_inode_operations;
- inode->i_private = priv;
sprintf(s, "%d", index);
-diff -NurpP --minimal linux-3.18.5/fs/ext2/balloc.c linux-3.18.5-vs2.3.7.3/fs/ext2/balloc.c
---- linux-3.18.5/fs/ext2/balloc.c 2013-05-31 13:45:23.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext2/balloc.c 2015-01-19 10:57:47.000000000 +0000
+
+diff -NurpP --minimal linux-4.9.76/fs/ext2/balloc.c linux-4.9.76-vs2.3.9.5/fs/ext2/balloc.c
+--- linux-4.9.76/fs/ext2/balloc.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/ext2/balloc.c 2018-01-10 02:50:49.000000000 +0000
@@ -693,7 +693,6 @@ ext2_try_to_allocate(struct super_block
start = 0;
end = EXT2_BLOCKS_PER_GROUP(sb);
@@ -2133,10 +2133,10 @@ diff -NurpP --minimal linux-3.18.5/fs/ext2/balloc.c linux-3.18.5-vs2.3.7.3/fs/ex
BUG_ON(start > EXT2_BLOCKS_PER_GROUP(sb));
repeat:
-diff -NurpP --minimal linux-3.18.5/fs/ext2/ext2.h linux-3.18.5-vs2.3.7.3/fs/ext2/ext2.h
---- linux-3.18.5/fs/ext2/ext2.h 2012-12-11 03:30:57.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext2/ext2.h 2015-01-19 10:57:47.000000000 +0000
-@@ -244,8 +244,12 @@ struct ext2_group_desc
+diff -NurpP --minimal linux-4.9.76/fs/ext2/ext2.h linux-4.9.76-vs2.3.9.5/fs/ext2/ext2.h
+--- linux-4.9.76/fs/ext2/ext2.h 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/ext2/ext2.h 2018-01-10 02:50:49.000000000 +0000
+@@ -247,8 +247,12 @@ struct ext2_group_desc
#define EXT2_NOTAIL_FL FS_NOTAIL_FL /* file tail should not be merged */
#define EXT2_DIRSYNC_FL FS_DIRSYNC_FL /* dirsync behaviour (directories only) */
#define EXT2_TOPDIR_FL FS_TOPDIR_FL /* Top of directory hierarchies*/
@@ -2149,7 +2149,7 @@ diff -NurpP --minimal linux-3.18.5/fs/ext2/ext2.h linux-3.18.5-vs2.3.7.3/fs/ext2
#define EXT2_FL_USER_VISIBLE FS_FL_USER_VISIBLE /* User visible flags */
#define EXT2_FL_USER_MODIFIABLE FS_FL_USER_MODIFIABLE /* User modifiable flags */
-@@ -329,7 +333,8 @@ struct ext2_inode {
+@@ -332,7 +336,8 @@ struct ext2_inode {
__u16 i_pad1;
__le16 l_i_uid_high; /* these 2 fields */
__le16 l_i_gid_high; /* were reserved2[0] */
@@ -2159,7 +2159,7 @@ diff -NurpP --minimal linux-3.18.5/fs/ext2/ext2.h linux-3.18.5-vs2.3.7.3/fs/ext2
} linux2;
struct {
__u8 h_i_frag; /* Fragment number */
-@@ -357,6 +362,7 @@ struct ext2_inode {
+@@ -360,6 +365,7 @@ struct ext2_inode {
#define i_gid_low i_gid
#define i_uid_high osd2.linux2.l_i_uid_high
#define i_gid_high osd2.linux2.l_i_gid_high
@@ -2167,15 +2167,15 @@ diff -NurpP --minimal linux-3.18.5/fs/ext2/ext2.h linux-3.18.5-vs2.3.7.3/fs/ext2
#define i_reserved2 osd2.linux2.l_i_reserved2
/*
-@@ -384,6 +390,7 @@ struct ext2_inode {
- #define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */
- #define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */
- #define EXT2_MOUNT_RESERVATION 0x080000 /* Preallocation */
-+#define EXT2_MOUNT_TAGGED (1<<24) /* Enable Context Tags */
+@@ -393,6 +399,7 @@ struct ext2_inode {
+ #else
+ #define EXT2_MOUNT_DAX 0
+ #endif
++#define EXT2_MOUNT_TAGGED 0x200000 /* Enable Context Tags */
#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt
-@@ -757,6 +764,7 @@ extern void ext2_set_inode_flags(struct
+@@ -782,6 +789,7 @@ extern void ext2_set_inode_flags(struct
extern void ext2_get_inode_flags(struct ext2_inode_info *);
extern int ext2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
u64 start, u64 len);
@@ -2183,18 +2183,18 @@ diff -NurpP --minimal linux-3.18.5/fs/ext2/ext2.h linux-3.18.5-vs2.3.7.3/fs/ext2
/* ioctl.c */
extern long ext2_ioctl(struct file *, unsigned int, unsigned long);
-diff -NurpP --minimal linux-3.18.5/fs/ext2/file.c linux-3.18.5-vs2.3.7.3/fs/ext2/file.c
---- linux-3.18.5/fs/ext2/file.c 2014-09-03 13:19:39.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext2/file.c 2015-01-19 10:57:47.000000000 +0000
-@@ -105,4 +105,5 @@ const struct inode_operations ext2_file_
+diff -NurpP --minimal linux-4.9.76/fs/ext2/file.c linux-4.9.76-vs2.3.9.5/fs/ext2/file.c
+--- linux-4.9.76/fs/ext2/file.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/ext2/file.c 2018-01-10 02:50:49.000000000 +0000
+@@ -247,4 +247,5 @@ const struct inode_operations ext2_file_
.get_acl = ext2_get_acl,
.set_acl = ext2_set_acl,
.fiemap = ext2_fiemap,
+ .sync_flags = ext2_sync_flags,
};
-diff -NurpP --minimal linux-3.18.5/fs/ext2/ialloc.c linux-3.18.5-vs2.3.7.3/fs/ext2/ialloc.c
---- linux-3.18.5/fs/ext2/ialloc.c 2014-06-12 13:02:41.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext2/ialloc.c 2015-01-19 10:57:47.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/fs/ext2/ialloc.c linux-4.9.76-vs2.3.9.5/fs/ext2/ialloc.c
+--- linux-4.9.76/fs/ext2/ialloc.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/ext2/ialloc.c 2018-01-10 02:50:49.000000000 +0000
@@ -17,6 +17,7 @@
#include <linux/backing-dev.h>
#include <linux/buffer_head.h>
@@ -2203,7 +2203,7 @@ diff -NurpP --minimal linux-3.18.5/fs/ext2/ialloc.c linux-3.18.5-vs2.3.7.3/fs/ex
#include "ext2.h"
#include "xattr.h"
#include "acl.h"
-@@ -546,6 +547,7 @@ got:
+@@ -551,6 +552,7 @@ got:
inode->i_mode = mode;
inode->i_uid = current_fsuid();
inode->i_gid = dir->i_gid;
@@ -2211,40 +2211,39 @@ diff -NurpP --minimal linux-3.18.5/fs/ext2/ialloc.c linux-3.18.5-vs2.3.7.3/fs/ex
} else
inode_init_owner(inode, dir, mode);
-diff -NurpP --minimal linux-3.18.5/fs/ext2/inode.c linux-3.18.5-vs2.3.7.3/fs/ext2/inode.c
---- linux-3.18.5/fs/ext2/inode.c 2014-09-03 13:19:39.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext2/inode.c 2015-01-19 10:57:47.000000000 +0000
-@@ -32,6 +32,7 @@
- #include <linux/fiemap.h>
+diff -NurpP --minimal linux-4.9.76/fs/ext2/inode.c linux-4.9.76-vs2.3.9.5/fs/ext2/inode.c
+--- linux-4.9.76/fs/ext2/inode.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/ext2/inode.c 2018-01-13 01:19:54.000000000 +0000
+@@ -35,6 +35,7 @@
+ #include <linux/iomap.h>
#include <linux/namei.h>
- #include <linux/aio.h>
+ #include <linux/uio.h>
+#include <linux/vs_tag.h>
#include "ext2.h"
#include "acl.h"
- #include "xip.h"
-@@ -1182,7 +1183,7 @@ static void ext2_truncate_blocks(struct
+ #include "xattr.h"
+@@ -1271,7 +1272,7 @@ static void ext2_truncate_blocks(struct
return;
if (ext2_inode_is_fast_symlink(inode))
return;
- if (IS_APPEND(inode) || IS_IMMUTABLE(inode))
+ if (IS_APPEND(inode) || IS_IXORUNLINK(inode))
return;
- __ext2_truncate_blocks(inode, offset);
- }
-@@ -1273,36 +1274,61 @@ void ext2_set_inode_flags(struct inode *
+
+ dax_sem_down_write(EXT2_I(inode));
+@@ -1367,39 +1368,61 @@ void ext2_set_inode_flags(struct inode *
{
unsigned int flags = EXT2_I(inode)->i_flags;
-- inode->i_flags &= ~(S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC);
-+ inode->i_flags &= ~(S_IMMUTABLE | S_IXUNLINK |
+- inode->i_flags &= ~(S_SYNC | S_APPEND | S_IMMUTABLE | S_NOATIME |
+- S_DIRSYNC | S_DAX);
++ inode->i_flags &= ~(S_IMMUTABLE | S_IXUNLINK | S_DAX |
+ S_SYNC | S_APPEND | S_NOATIME | S_DIRSYNC);
+
-+
+ if (flags & EXT2_IMMUTABLE_FL)
+ inode->i_flags |= S_IMMUTABLE;
+ if (flags & EXT2_IXUNLINK_FL)
+ inode->i_flags |= S_IXUNLINK;
-+
if (flags & EXT2_SYNC_FL)
inode->i_flags |= S_SYNC;
if (flags & EXT2_APPEND_FL)
@@ -2255,6 +2254,8 @@ diff -NurpP --minimal linux-3.18.5/fs/ext2/inode.c linux-3.18.5-vs2.3.7.3/fs/ext
inode->i_flags |= S_NOATIME;
if (flags & EXT2_DIRSYNC_FL)
inode->i_flags |= S_DIRSYNC;
+ if (test_opt(inode->i_sb, DAX) && S_ISREG(inode->i_mode))
+ inode->i_flags |= S_DAX;
+
+ inode->i_vflags &= ~(V_BARRIER | V_COW);
+
@@ -2300,7 +2301,7 @@ diff -NurpP --minimal linux-3.18.5/fs/ext2/inode.c linux-3.18.5-vs2.3.7.3/fs/ext
}
struct inode *ext2_iget (struct super_block *sb, unsigned long ino)
-@@ -1338,8 +1364,10 @@ struct inode *ext2_iget (struct super_bl
+@@ -1435,8 +1458,10 @@ struct inode *ext2_iget (struct super_bl
i_uid |= le16_to_cpu(raw_inode->i_uid_high) << 16;
i_gid |= le16_to_cpu(raw_inode->i_gid_high) << 16;
}
@@ -2313,7 +2314,7 @@ diff -NurpP --minimal linux-3.18.5/fs/ext2/inode.c linux-3.18.5-vs2.3.7.3/fs/ext
set_nlink(inode, le16_to_cpu(raw_inode->i_links_count));
inode->i_size = le32_to_cpu(raw_inode->i_size);
inode->i_atime.tv_sec = (signed)le32_to_cpu(raw_inode->i_atime);
-@@ -1437,8 +1465,10 @@ static int __ext2_write_inode(struct ino
+@@ -1543,8 +1568,10 @@ static int __ext2_write_inode(struct ino
struct ext2_inode_info *ei = EXT2_I(inode);
struct super_block *sb = inode->i_sb;
ino_t ino = inode->i_ino;
@@ -2326,7 +2327,7 @@ diff -NurpP --minimal linux-3.18.5/fs/ext2/inode.c linux-3.18.5-vs2.3.7.3/fs/ext
struct buffer_head * bh;
struct ext2_inode * raw_inode = ext2_get_inode(sb, ino, &bh);
int n;
-@@ -1474,6 +1504,9 @@ static int __ext2_write_inode(struct ino
+@@ -1580,6 +1607,9 @@ static int __ext2_write_inode(struct ino
raw_inode->i_uid_high = 0;
raw_inode->i_gid_high = 0;
}
@@ -2336,9 +2337,9 @@ diff -NurpP --minimal linux-3.18.5/fs/ext2/inode.c linux-3.18.5-vs2.3.7.3/fs/ext
raw_inode->i_links_count = cpu_to_le16(inode->i_nlink);
raw_inode->i_size = cpu_to_le32(inode->i_size);
raw_inode->i_atime = cpu_to_le32(inode->i_atime.tv_sec);
-@@ -1554,7 +1587,8 @@ int ext2_setattr(struct dentry *dentry,
- if (is_quota_modification(inode, iattr))
- dquot_initialize(inode);
+@@ -1663,7 +1693,8 @@ int ext2_setattr(struct dentry *dentry,
+ return error;
+ }
if ((iattr->ia_valid & ATTR_UID && !uid_eq(iattr->ia_uid, inode->i_uid)) ||
- (iattr->ia_valid & ATTR_GID && !gid_eq(iattr->ia_gid, inode->i_gid))) {
+ (iattr->ia_valid & ATTR_GID && !gid_eq(iattr->ia_gid, inode->i_gid)) ||
@@ -2346,9 +2347,9 @@ diff -NurpP --minimal linux-3.18.5/fs/ext2/inode.c linux-3.18.5-vs2.3.7.3/fs/ext
error = dquot_transfer(inode, iattr);
if (error)
return error;
-diff -NurpP --minimal linux-3.18.5/fs/ext2/ioctl.c linux-3.18.5-vs2.3.7.3/fs/ext2/ioctl.c
---- linux-3.18.5/fs/ext2/ioctl.c 2013-05-31 13:45:23.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext2/ioctl.c 2015-01-19 10:57:47.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/fs/ext2/ioctl.c linux-4.9.76-vs2.3.9.5/fs/ext2/ioctl.c
+--- linux-4.9.76/fs/ext2/ioctl.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/ext2/ioctl.c 2018-01-13 01:20:40.000000000 +0000
@@ -17,6 +17,16 @@
#include <asm/uaccess.h>
@@ -2375,7 +2376,7 @@ diff -NurpP --minimal linux-3.18.5/fs/ext2/ioctl.c linux-3.18.5-vs2.3.7.3/fs/ext
+ return -EACCES;
+ }
+
- mutex_lock(&inode->i_mutex);
+ inode_lock(inode);
/* Is it quota file? Do not allow user to mess with it */
if (IS_NOQUOTA(inode)) {
@@ -66,7 +81,9 @@ long ext2_ioctl(struct file *filp, unsig
@@ -2387,7 +2388,7 @@ diff -NurpP --minimal linux-3.18.5/fs/ext2/ioctl.c linux-3.18.5-vs2.3.7.3/fs/ext
+ ((flags ^ oldflags) & (EXT2_APPEND_FL |
+ EXT2_IMMUTABLE_FL | EXT2_IXUNLINK_FL))) {
if (!capable(CAP_LINUX_IMMUTABLE)) {
- mutex_unlock(&inode->i_mutex);
+ inode_unlock(inode);
ret = -EPERM;
@@ -74,7 +91,7 @@ long ext2_ioctl(struct file *filp, unsig
}
@@ -2398,9 +2399,9 @@ diff -NurpP --minimal linux-3.18.5/fs/ext2/ioctl.c linux-3.18.5-vs2.3.7.3/fs/ext
flags |= oldflags & ~EXT2_FL_USER_MODIFIABLE;
ei->i_flags = flags;
-diff -NurpP --minimal linux-3.18.5/fs/ext2/namei.c linux-3.18.5-vs2.3.7.3/fs/ext2/namei.c
---- linux-3.18.5/fs/ext2/namei.c 2014-06-12 11:34:57.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext2/namei.c 2015-01-19 10:57:47.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/fs/ext2/namei.c linux-4.9.76-vs2.3.9.5/fs/ext2/namei.c
+--- linux-4.9.76/fs/ext2/namei.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/ext2/namei.c 2018-01-10 02:50:49.000000000 +0000
@@ -32,6 +32,7 @@
#include <linux/pagemap.h>
@@ -2409,7 +2410,7 @@ diff -NurpP --minimal linux-3.18.5/fs/ext2/namei.c linux-3.18.5-vs2.3.7.3/fs/ext
#include "ext2.h"
#include "xattr.h"
#include "acl.h"
-@@ -73,6 +74,7 @@ static struct dentry *ext2_lookup(struct
+@@ -72,6 +73,7 @@ static struct dentry *ext2_lookup(struct
(unsigned long) ino);
return ERR_PTR(-EIO);
}
@@ -2417,38 +2418,38 @@ diff -NurpP --minimal linux-3.18.5/fs/ext2/namei.c linux-3.18.5-vs2.3.7.3/fs/ext
}
return d_splice_alias(inode, dentry);
}
-@@ -433,6 +435,7 @@ const struct inode_operations ext2_speci
- .removexattr = generic_removexattr,
+@@ -445,6 +447,7 @@ const struct inode_operations ext2_speci
+ .listxattr = ext2_listxattr,
#endif
.setattr = ext2_setattr,
+ .sync_flags = ext2_sync_flags,
.get_acl = ext2_get_acl,
.set_acl = ext2_set_acl,
};
-diff -NurpP --minimal linux-3.18.5/fs/ext2/super.c linux-3.18.5-vs2.3.7.3/fs/ext2/super.c
---- linux-3.18.5/fs/ext2/super.c 2015-01-17 02:40:17.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext2/super.c 2015-01-19 10:57:47.000000000 +0000
-@@ -395,7 +395,8 @@ enum {
+diff -NurpP --minimal linux-4.9.76/fs/ext2/super.c linux-4.9.76-vs2.3.9.5/fs/ext2/super.c
+--- linux-4.9.76/fs/ext2/super.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/ext2/super.c 2018-01-10 02:50:49.000000000 +0000
+@@ -411,7 +411,8 @@ enum {
Opt_err_ro, Opt_nouid32, Opt_nocheck, Opt_debug,
Opt_oldalloc, Opt_orlov, Opt_nobh, Opt_user_xattr, Opt_nouser_xattr,
- Opt_acl, Opt_noacl, Opt_xip, Opt_ignore, Opt_err, Opt_quota,
+ Opt_acl, Opt_noacl, Opt_xip, Opt_dax, Opt_ignore, Opt_err, Opt_quota,
- Opt_usrquota, Opt_grpquota, Opt_reservation, Opt_noreservation
+ Opt_usrquota, Opt_grpquota, Opt_reservation, Opt_noreservation,
+ Opt_tag, Opt_notag, Opt_tagid
};
static const match_table_t tokens = {
-@@ -423,6 +424,9 @@ static const match_table_t tokens = {
+@@ -439,6 +440,9 @@ static const match_table_t tokens = {
{Opt_acl, "acl"},
{Opt_noacl, "noacl"},
{Opt_xip, "xip"},
+ {Opt_tag, "tag"},
+ {Opt_notag, "notag"},
+ {Opt_tagid, "tagid=%u"},
+ {Opt_dax, "dax"},
{Opt_grpquota, "grpquota"},
{Opt_ignore, "noquota"},
- {Opt_quota, "quota"},
-@@ -506,6 +510,20 @@ static int parse_options(char *options,
+@@ -523,6 +527,20 @@ static int parse_options(char *options,
case Opt_nouid32:
set_opt (sbi->s_mount_opt, NO_UID32);
break;
@@ -2469,430 +2470,46 @@ diff -NurpP --minimal linux-3.18.5/fs/ext2/super.c linux-3.18.5-vs2.3.7.3/fs/ext
case Opt_nocheck:
clear_opt (sbi->s_mount_opt, CHECK);
break;
-@@ -864,6 +882,8 @@ static int ext2_fill_super(struct super_
+@@ -887,6 +905,8 @@ static int ext2_fill_super(struct super_
if (!parse_options((char *) data, sb))
goto failed_mount;
-+ if (EXT2_SB(sb)->s_mount_opt & EXT2_MOUNT_TAGGED)
-+ sb->s_flags |= MS_TAGGED;
- sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
- ((EXT2_SB(sb)->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ?
- MS_POSIXACL : 0);
-@@ -1270,6 +1290,14 @@ static int ext2_remount (struct super_bl
- err = -EINVAL;
- goto restore_opts;
- }
-+
-+ if ((sbi->s_mount_opt & EXT2_MOUNT_TAGGED) &&
-+ !(sb->s_flags & MS_TAGGED)) {
-+ printk("EXT2-fs: %s: tagging not permitted on remount.\n",
-+ sb->s_id);
-+ err = -EINVAL;
-+ goto restore_opts;
-+ }
-
- sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
- ((sbi->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
-diff -NurpP --minimal linux-3.18.5/fs/ext3/ext3.h linux-3.18.5-vs2.3.7.3/fs/ext3/ext3.h
---- linux-3.18.5/fs/ext3/ext3.h 2015-01-17 02:40:17.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext3/ext3.h 2015-01-19 10:57:47.000000000 +0000
-@@ -151,10 +151,14 @@ struct ext3_group_desc
- #define EXT3_NOTAIL_FL 0x00008000 /* file tail should not be merged */
- #define EXT3_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */
- #define EXT3_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/
-+#define EXT3_IXUNLINK_FL 0x08000000 /* Immutable invert on unlink */
- #define EXT3_RESERVED_FL 0x80000000 /* reserved for ext3 lib */
-
--#define EXT3_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */
--#define EXT3_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */
-+#define EXT3_BARRIER_FL 0x04000000 /* Barrier for chroot() */
-+#define EXT3_COW_FL 0x20000000 /* Copy on Write marker */
-+
-+#define EXT3_FL_USER_VISIBLE 0x0103DFFF /* User visible flags */
-+#define EXT3_FL_USER_MODIFIABLE 0x010380FF /* User modifiable flags */
-
- /* Flags that should be inherited by new inodes from their parent. */
- #define EXT3_FL_INHERITED (EXT3_SECRM_FL | EXT3_UNRM_FL | EXT3_COMPR_FL |\
-@@ -292,7 +296,8 @@ struct ext3_inode {
- __u16 i_pad1;
- __le16 l_i_uid_high; /* these 2 fields */
- __le16 l_i_gid_high; /* were reserved2[0] */
-- __u32 l_i_reserved2;
-+ __le16 l_i_tag; /* Context Tag */
-+ __u16 l_i_reserved2;
- } linux2;
- struct {
- __u8 h_i_frag; /* Fragment number */
-@@ -322,6 +327,7 @@ struct ext3_inode {
- #define i_gid_low i_gid
- #define i_uid_high osd2.linux2.l_i_uid_high
- #define i_gid_high osd2.linux2.l_i_gid_high
-+#define i_raw_tag osd2.linux2.l_i_tag
- #define i_reserved2 osd2.linux2.l_i_reserved2
-
- /*
-@@ -366,6 +372,7 @@ struct ext3_inode {
- #define EXT3_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */
- #define EXT3_MOUNT_DATA_ERR_ABORT 0x400000 /* Abort on file data write
- * error in ordered mode */
-+#define EXT3_MOUNT_TAGGED (1<<24) /* Enable Context Tags */
-
- /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
- #ifndef _LINUX_EXT2_FS_H
-@@ -1063,6 +1070,7 @@ extern void ext3_get_inode_flags(struct
- extern void ext3_set_aops(struct inode *inode);
- extern int ext3_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
- u64 start, u64 len);
-+extern int ext3_sync_flags(struct inode *, int, int);
-
- /* ioctl.c */
- extern long ext3_ioctl(struct file *, unsigned int, unsigned long);
-diff -NurpP --minimal linux-3.18.5/fs/ext3/file.c linux-3.18.5-vs2.3.7.3/fs/ext3/file.c
---- linux-3.18.5/fs/ext3/file.c 2014-09-03 13:19:39.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext3/file.c 2015-01-19 10:57:47.000000000 +0000
-@@ -77,5 +77,6 @@ const struct inode_operations ext3_file_
- .get_acl = ext3_get_acl,
- .set_acl = ext3_set_acl,
- .fiemap = ext3_fiemap,
-+ .sync_flags = ext3_sync_flags,
- };
-
-diff -NurpP --minimal linux-3.18.5/fs/ext3/ialloc.c linux-3.18.5-vs2.3.7.3/fs/ext3/ialloc.c
---- linux-3.18.5/fs/ext3/ialloc.c 2014-06-12 13:02:41.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext3/ialloc.c 2015-01-19 10:57:47.000000000 +0000
-@@ -14,6 +14,7 @@
-
- #include <linux/quotaops.h>
- #include <linux/random.h>
-+#include <linux/vs_tag.h>
-
- #include "ext3.h"
- #include "xattr.h"
-@@ -469,6 +470,7 @@ got:
- inode->i_mode = mode;
- inode->i_uid = current_fsuid();
- inode->i_gid = dir->i_gid;
-+ i_tag_write(inode, dx_current_fstag(sb));
- } else
- inode_init_owner(inode, dir, mode);
-
-diff -NurpP --minimal linux-3.18.5/fs/ext3/inode.c linux-3.18.5-vs2.3.7.3/fs/ext3/inode.c
---- linux-3.18.5/fs/ext3/inode.c 2014-09-03 13:19:39.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext3/inode.c 2015-01-19 10:57:47.000000000 +0000
-@@ -28,6 +28,8 @@
- #include <linux/mpage.h>
- #include <linux/namei.h>
- #include <linux/aio.h>
-+#include <linux/vs_tag.h>
-+
- #include "ext3.h"
- #include "xattr.h"
- #include "acl.h"
-@@ -2813,36 +2815,60 @@ void ext3_set_inode_flags(struct inode *
- {
- unsigned int flags = EXT3_I(inode)->i_flags;
-
-- inode->i_flags &= ~(S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC);
-+ inode->i_flags &= ~(S_IMMUTABLE | S_IXUNLINK |
-+ S_SYNC | S_APPEND | S_NOATIME | S_DIRSYNC);
-+
-+ if (flags & EXT3_IMMUTABLE_FL)
-+ inode->i_flags |= S_IMMUTABLE;
-+ if (flags & EXT3_IXUNLINK_FL)
-+ inode->i_flags |= S_IXUNLINK;
-+
- if (flags & EXT3_SYNC_FL)
- inode->i_flags |= S_SYNC;
- if (flags & EXT3_APPEND_FL)
- inode->i_flags |= S_APPEND;
-- if (flags & EXT3_IMMUTABLE_FL)
-- inode->i_flags |= S_IMMUTABLE;
- if (flags & EXT3_NOATIME_FL)
- inode->i_flags |= S_NOATIME;
- if (flags & EXT3_DIRSYNC_FL)
- inode->i_flags |= S_DIRSYNC;
-+
-+ inode->i_vflags &= ~(V_BARRIER | V_COW);
-+
-+ if (flags & EXT3_BARRIER_FL)
-+ inode->i_vflags |= V_BARRIER;
-+ if (flags & EXT3_COW_FL)
-+ inode->i_vflags |= V_COW;
- }
-
- /* Propagate flags from i_flags to EXT3_I(inode)->i_flags */
- void ext3_get_inode_flags(struct ext3_inode_info *ei)
- {
- unsigned int flags = ei->vfs_inode.i_flags;
-+ unsigned int vflags = ei->vfs_inode.i_vflags;
-+
-+ ei->i_flags &= ~(EXT3_SYNC_FL | EXT3_APPEND_FL |
-+ EXT3_IMMUTABLE_FL | EXT3_IXUNLINK_FL |
-+ EXT3_NOATIME_FL | EXT3_DIRSYNC_FL |
-+ EXT3_BARRIER_FL | EXT3_COW_FL);
-+
-+ if (flags & S_IMMUTABLE)
-+ ei->i_flags |= EXT3_IMMUTABLE_FL;
-+ if (flags & S_IXUNLINK)
-+ ei->i_flags |= EXT3_IXUNLINK_FL;
-
-- ei->i_flags &= ~(EXT3_SYNC_FL|EXT3_APPEND_FL|
-- EXT3_IMMUTABLE_FL|EXT3_NOATIME_FL|EXT3_DIRSYNC_FL);
- if (flags & S_SYNC)
- ei->i_flags |= EXT3_SYNC_FL;
- if (flags & S_APPEND)
- ei->i_flags |= EXT3_APPEND_FL;
-- if (flags & S_IMMUTABLE)
-- ei->i_flags |= EXT3_IMMUTABLE_FL;
- if (flags & S_NOATIME)
- ei->i_flags |= EXT3_NOATIME_FL;
- if (flags & S_DIRSYNC)
- ei->i_flags |= EXT3_DIRSYNC_FL;
-+
-+ if (vflags & V_BARRIER)
-+ ei->i_flags |= EXT3_BARRIER_FL;
-+ if (vflags & V_COW)
-+ ei->i_flags |= EXT3_COW_FL;
- }
-
- struct inode *ext3_iget(struct super_block *sb, unsigned long ino)
-@@ -2880,8 +2906,10 @@ struct inode *ext3_iget(struct super_blo
- i_uid |= le16_to_cpu(raw_inode->i_uid_high) << 16;
- i_gid |= le16_to_cpu(raw_inode->i_gid_high) << 16;
- }
-- i_uid_write(inode, i_uid);
-- i_gid_write(inode, i_gid);
-+ i_uid_write(inode, INOTAG_UID(DX_TAG(inode), i_uid, i_gid));
-+ i_gid_write(inode, INOTAG_GID(DX_TAG(inode), i_uid, i_gid));
-+ i_tag_write(inode, INOTAG_TAG(DX_TAG(inode), i_uid, i_gid,
-+ le16_to_cpu(raw_inode->i_raw_tag)));
- set_nlink(inode, le16_to_cpu(raw_inode->i_links_count));
- inode->i_size = le32_to_cpu(raw_inode->i_size);
- inode->i_atime.tv_sec = (signed)le32_to_cpu(raw_inode->i_atime);
-@@ -3053,8 +3081,10 @@ again:
-
- ext3_get_inode_flags(ei);
- raw_inode->i_mode = cpu_to_le16(inode->i_mode);
-- i_uid = i_uid_read(inode);
-- i_gid = i_gid_read(inode);
-+ i_uid = from_kuid(&init_user_ns,
-+ TAGINO_KUID(DX_TAG(inode), inode->i_uid, inode->i_tag));
-+ i_gid = from_kgid(&init_user_ns,
-+ TAGINO_KGID(DX_TAG(inode), inode->i_gid, inode->i_tag));
- if(!(test_opt(inode->i_sb, NO_UID32))) {
- raw_inode->i_uid_low = cpu_to_le16(low_16_bits(i_uid));
- raw_inode->i_gid_low = cpu_to_le16(low_16_bits(i_gid));
-@@ -3079,6 +3109,9 @@ again:
- raw_inode->i_uid_high = 0;
- raw_inode->i_gid_high = 0;
- }
-+#ifdef CONFIG_TAGGING_INTERN
-+ raw_inode->i_raw_tag = cpu_to_le16(i_tag_read(inode));
-+#endif
- raw_inode->i_links_count = cpu_to_le16(inode->i_nlink);
- disksize = cpu_to_le32(ei->i_disksize);
- if (disksize != raw_inode->i_size) {
-@@ -3251,7 +3284,8 @@ int ext3_setattr(struct dentry *dentry,
- if (is_quota_modification(inode, attr))
- dquot_initialize(inode);
- if ((ia_valid & ATTR_UID && !uid_eq(attr->ia_uid, inode->i_uid)) ||
-- (ia_valid & ATTR_GID && !gid_eq(attr->ia_gid, inode->i_gid))) {
-+ (ia_valid & ATTR_GID && !gid_eq(attr->ia_gid, inode->i_gid)) ||
-+ (ia_valid & ATTR_TAG && !tag_eq(attr->ia_tag, inode->i_tag))) {
- handle_t *handle;
-
- /* (user+group)*(old+new) structure, inode write (sb,
-@@ -3273,6 +3307,8 @@ int ext3_setattr(struct dentry *dentry,
- inode->i_uid = attr->ia_uid;
- if (attr->ia_valid & ATTR_GID)
- inode->i_gid = attr->ia_gid;
-+ if ((attr->ia_valid & ATTR_TAG) && IS_TAGGED(inode))
-+ inode->i_tag = attr->ia_tag;
- error = ext3_mark_inode_dirty(handle, inode);
- ext3_journal_stop(handle);
- }
-diff -NurpP --minimal linux-3.18.5/fs/ext3/ioctl.c linux-3.18.5-vs2.3.7.3/fs/ext3/ioctl.c
---- linux-3.18.5/fs/ext3/ioctl.c 2013-05-31 13:45:23.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext3/ioctl.c 2015-01-19 10:57:47.000000000 +0000
-@@ -12,6 +12,34 @@
- #include <asm/uaccess.h>
- #include "ext3.h"
-
-+
-+int ext3_sync_flags(struct inode *inode, int flags, int vflags)
-+{
-+ handle_t *handle = NULL;
-+ struct ext3_iloc iloc;
-+ int err;
-+
-+ handle = ext3_journal_start(inode, 1);
-+ if (IS_ERR(handle))
-+ return PTR_ERR(handle);
-+
-+ if (IS_SYNC(inode))
-+ handle->h_sync = 1;
-+ err = ext3_reserve_inode_write(handle, inode, &iloc);
-+ if (err)
-+ goto flags_err;
-+
-+ inode->i_flags = flags;
-+ inode->i_vflags = vflags;
-+ ext3_get_inode_flags(EXT3_I(inode));
-+ inode->i_ctime = CURRENT_TIME_SEC;
-+
-+ err = ext3_mark_iloc_dirty(handle, inode, &iloc);
-+flags_err:
-+ ext3_journal_stop(handle);
-+ return err;
-+}
-+
- long ext3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
- {
- struct inode *inode = file_inode(filp);
-@@ -45,6 +73,11 @@ long ext3_ioctl(struct file *filp, unsig
-
- flags = ext3_mask_flags(inode->i_mode, flags);
-
-+ if (IS_BARRIER(inode)) {
-+ vxwprintk_task(1, "messing with the barrier.");
-+ return -EACCES;
-+ }
-+
- mutex_lock(&inode->i_mutex);
-
- /* Is it quota file? Do not allow user to mess with it */
-@@ -63,7 +96,9 @@ long ext3_ioctl(struct file *filp, unsig
- *
- * This test looks nicer. Thanks to Pauline Middelink
- */
-- if ((flags ^ oldflags) & (EXT3_APPEND_FL | EXT3_IMMUTABLE_FL)) {
-+ if ((oldflags & EXT3_IMMUTABLE_FL) ||
-+ ((flags ^ oldflags) & (EXT3_APPEND_FL |
-+ EXT3_IMMUTABLE_FL | EXT3_IXUNLINK_FL))) {
- if (!capable(CAP_LINUX_IMMUTABLE))
- goto flags_out;
- }
-@@ -88,7 +123,7 @@ long ext3_ioctl(struct file *filp, unsig
- if (err)
- goto flags_err;
-
-- flags = flags & EXT3_FL_USER_MODIFIABLE;
-+ flags &= EXT3_FL_USER_MODIFIABLE;
- flags |= oldflags & ~EXT3_FL_USER_MODIFIABLE;
- ei->i_flags = flags;
-
-diff -NurpP --minimal linux-3.18.5/fs/ext3/namei.c linux-3.18.5-vs2.3.7.3/fs/ext3/namei.c
---- linux-3.18.5/fs/ext3/namei.c 2014-06-12 11:34:57.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext3/namei.c 2015-01-19 10:57:47.000000000 +0000
-@@ -25,6 +25,8 @@
- */
-
- #include <linux/quotaops.h>
-+#include <linux/vs_tag.h>
-+
- #include "ext3.h"
- #include "namei.h"
- #include "xattr.h"
-@@ -915,6 +917,7 @@ restart:
- submit_bh(READ | REQ_META | REQ_PRIO,
- bh);
- }
-+ dx_propagate_tag(nd, inode);
- }
- }
- if ((bh = bh_use[ra_ptr++]) == NULL)
-@@ -2568,6 +2571,7 @@ const struct inode_operations ext3_dir_i
- .listxattr = ext3_listxattr,
- .removexattr = generic_removexattr,
- #endif
-+ .sync_flags = ext3_sync_flags,
- .get_acl = ext3_get_acl,
- .set_acl = ext3_set_acl,
- };
-diff -NurpP --minimal linux-3.18.5/fs/ext3/super.c linux-3.18.5-vs2.3.7.3/fs/ext3/super.c
---- linux-3.18.5/fs/ext3/super.c 2015-01-17 02:40:17.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext3/super.c 2015-01-19 10:57:47.000000000 +0000
-@@ -826,7 +826,8 @@ enum {
- Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota,
- Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_jqfmt_vfsv1, Opt_quota,
- Opt_noquota, Opt_ignore, Opt_barrier, Opt_nobarrier, Opt_err,
-- Opt_resize, Opt_usrquota, Opt_grpquota
-+ Opt_resize, Opt_usrquota, Opt_grpquota,
-+ Opt_tag, Opt_notag, Opt_tagid
- };
-
- static const match_table_t tokens = {
-@@ -884,6 +885,9 @@ static const match_table_t tokens = {
- {Opt_barrier, "barrier"},
- {Opt_nobarrier, "nobarrier"},
- {Opt_resize, "resize"},
-+ {Opt_tag, "tag"},
-+ {Opt_notag, "notag"},
-+ {Opt_tagid, "tagid=%u"},
- {Opt_err, NULL},
- };
-
-@@ -1056,6 +1060,20 @@ static int parse_options (char *options,
- case Opt_nouid32:
- set_opt (sbi->s_mount_opt, NO_UID32);
- break;
-+#ifndef CONFIG_TAGGING_NONE
-+ case Opt_tag:
-+ set_opt (sbi->s_mount_opt, TAGGED);
-+ break;
-+ case Opt_notag:
-+ clear_opt (sbi->s_mount_opt, TAGGED);
-+ break;
-+#endif
-+#ifdef CONFIG_PROPAGATE
-+ case Opt_tagid:
-+ /* use args[0] */
-+ set_opt (sbi->s_mount_opt, TAGGED);
-+ break;
-+#endif
- case Opt_nocheck:
- clear_opt (sbi->s_mount_opt, CHECK);
- break;
-@@ -1781,6 +1799,9 @@ static int ext3_fill_super (struct super
- NULL, 0))
- goto failed_mount;
-
-+ if (EXT3_SB(sb)->s_mount_opt & EXT3_MOUNT_TAGGED)
-+ sb->s_flags |= MS_TAGGED;
-+
- sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
- (test_opt(sb, POSIX_ACL) ? MS_POSIXACL : 0);
-
-@@ -2678,6 +2699,14 @@ static int ext3_remount (struct super_bl
- if (test_opt(sb, ABORT))
- ext3_abort(sb, __func__, "Abort forced by user");
-
-+ if ((sbi->s_mount_opt & EXT3_MOUNT_TAGGED) &&
++ if (EXT2_SB(sb)->s_mount_opt & EXT2_MOUNT_TAGGED)
++ sb->s_flags |= MS_TAGGED;
+ sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
+ ((EXT2_SB(sb)->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ?
+ MS_POSIXACL : 0);
+@@ -1300,6 +1320,14 @@ static int ext2_remount (struct super_bl
+ err = -EINVAL;
+ goto restore_opts;
+ }
++
++ if ((sbi->s_mount_opt & EXT2_MOUNT_TAGGED) &&
+ !(sb->s_flags & MS_TAGGED)) {
-+ printk("EXT3-fs: %s: tagging not permitted on remount.\n",
-+ sb->s_id);
++ printk("EXT2-fs: %s: tagging not permitted on remount.\n",
++ sb->s_id);
+ err = -EINVAL;
+ goto restore_opts;
+ }
-+
- sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
- (test_opt(sb, POSIX_ACL) ? MS_POSIXACL : 0);
-diff -NurpP --minimal linux-3.18.5/fs/ext4/ext4.h linux-3.18.5-vs2.3.7.3/fs/ext4/ext4.h
---- linux-3.18.5/fs/ext4/ext4.h 2015-01-17 02:40:17.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext4/ext4.h 2015-01-19 10:57:47.000000000 +0000
-@@ -385,7 +385,10 @@ struct flex_groups {
+ sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
+ ((sbi->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
+diff -NurpP --minimal linux-4.9.76/fs/ext4/ext4.h linux-4.9.76-vs2.3.9.5/fs/ext4/ext4.h
+--- linux-4.9.76/fs/ext4/ext4.h 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/ext4/ext4.h 2018-01-13 02:00:49.000000000 +0000
+@@ -392,8 +392,11 @@ struct flex_groups {
#define EXT4_EXTENTS_FL 0x00080000 /* Inode uses extents */
#define EXT4_EA_INODE_FL 0x00200000 /* Inode used for large EA */
#define EXT4_EOFBLOCKS_FL 0x00400000 /* Blocks allocated beyond EOF */
+#define EXT4_BARRIER_FL 0x04000000 /* Barrier for chroot() */
+#define EXT4_IXUNLINK_FL 0x08000000 /* Immutable invert on unlink */
#define EXT4_INLINE_DATA_FL 0x10000000 /* Inode has inline data. */
-+#define EXT4_COW_FL 0x20000000 /* Copy on Write marker */
+ #define EXT4_PROJINHERIT_FL 0x20000000 /* Create with parents projid */
++#define EXT4_COW_FL 0x40000000 /* Copy on Write marker */
#define EXT4_RESERVED_FL 0x80000000 /* reserved for ext4 lib */
- #define EXT4_FL_USER_VISIBLE 0x004BDFFF /* User visible flags */
-@@ -671,7 +674,7 @@ struct ext4_inode {
+ #define EXT4_FL_USER_VISIBLE 0x304BDFFF /* User visible flags */
+@@ -735,7 +738,7 @@ struct ext4_inode {
__le16 l_i_uid_high; /* these 2 fields */
__le16 l_i_gid_high; /* were reserved2[0] */
__le16 l_i_checksum_lo;/* crc32c(uuid+inum+inode) LE */
@@ -2901,7 +2518,7 @@ diff -NurpP --minimal linux-3.18.5/fs/ext4/ext4.h linux-3.18.5-vs2.3.7.3/fs/ext4
} linux2;
struct {
__le16 h_i_reserved1; /* Obsoleted fragment number/size which are removed in ext4 */
-@@ -791,6 +794,7 @@ do { \
+@@ -892,6 +895,7 @@ do { \
#define i_gid_low i_gid
#define i_uid_high osd2.linux2.l_i_uid_high
#define i_gid_high osd2.linux2.l_i_gid_high
@@ -2909,36 +2526,36 @@ diff -NurpP --minimal linux-3.18.5/fs/ext4/ext4.h linux-3.18.5-vs2.3.7.3/fs/ext4
#define i_checksum_lo osd2.linux2.l_i_checksum_lo
#elif defined(__GNU__)
-@@ -980,6 +984,7 @@ struct ext4_inode_info {
- #define EXT4_MOUNT_POSIX_ACL 0x08000 /* POSIX Access Control Lists */
- #define EXT4_MOUNT_NO_AUTO_DA_ALLOC 0x10000 /* No auto delalloc mapping */
- #define EXT4_MOUNT_BARRIER 0x20000 /* Use block barriers */
-+#define EXT4_MOUNT_TAGGED 0x40000 /* Enable Context Tags */
- #define EXT4_MOUNT_QUOTA 0x80000 /* Some quota option set */
- #define EXT4_MOUNT_USRQUOTA 0x100000 /* "old" user quota */
- #define EXT4_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */
-@@ -2644,6 +2649,7 @@ extern struct buffer_head *ext4_get_firs
- extern int ext4_inline_data_fiemap(struct inode *inode,
- struct fiemap_extent_info *fieinfo,
- int *has_inline);
+@@ -1133,6 +1137,7 @@ struct ext4_inode_info {
+ #define EXT4_MOUNT_DIOREAD_NOLOCK 0x400000 /* Enable support for dio read nolocking */
+ #define EXT4_MOUNT_JOURNAL_CHECKSUM 0x800000 /* Journal checksums */
+ #define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT 0x1000000 /* Journal Async Commit */
++#define EXT4_MOUNT_TAGGED 0x2000000 /* Enable Context Tags */
+ #define EXT4_MOUNT_DELALLOC 0x8000000 /* Delalloc support */
+ #define EXT4_MOUNT_DATA_ERR_ABORT 0x10000000 /* Abort on file data write */
+ #define EXT4_MOUNT_BLOCK_VALIDITY 0x20000000 /* Block validity checking */
+@@ -2497,6 +2502,7 @@ extern int ext4_punch_hole(struct inode
+ extern int ext4_truncate_restart_trans(handle_t *, struct inode *, int nblocks);
+ extern void ext4_set_inode_flags(struct inode *);
+ extern void ext4_get_inode_flags(struct ext4_inode_info *);
+extern int ext4_sync_flags(struct inode *, int, int);
- extern int ext4_try_to_evict_inline_data(handle_t *handle,
- struct inode *inode,
- int needed);
-diff -NurpP --minimal linux-3.18.5/fs/ext4/file.c linux-3.18.5-vs2.3.7.3/fs/ext4/file.c
---- linux-3.18.5/fs/ext4/file.c 2015-01-17 02:40:17.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext4/file.c 2015-01-19 10:57:47.000000000 +0000
-@@ -610,5 +610,6 @@ const struct inode_operations ext4_file_
+ extern int ext4_alloc_da_blocks(struct inode *inode);
+ extern void ext4_set_aops(struct inode *inode);
+ extern int ext4_writepage_trans_blocks(struct inode *);
+diff -NurpP --minimal linux-4.9.76/fs/ext4/file.c linux-4.9.76-vs2.3.9.5/fs/ext4/file.c
+--- linux-4.9.76/fs/ext4/file.c 2018-01-13 21:28:56.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/ext4/file.c 2018-01-10 02:50:49.000000000 +0000
+@@ -691,5 +691,6 @@ const struct inode_operations ext4_file_
.get_acl = ext4_get_acl,
.set_acl = ext4_set_acl,
.fiemap = ext4_fiemap,
+ .sync_flags = ext4_sync_flags,
};
-diff -NurpP --minimal linux-3.18.5/fs/ext4/ialloc.c linux-3.18.5-vs2.3.7.3/fs/ext4/ialloc.c
---- linux-3.18.5/fs/ext4/ialloc.c 2015-01-17 02:40:17.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext4/ialloc.c 2015-01-19 10:57:47.000000000 +0000
-@@ -22,6 +22,7 @@
+diff -NurpP --minimal linux-4.9.76/fs/ext4/ialloc.c linux-4.9.76-vs2.3.9.5/fs/ext4/ialloc.c
+--- linux-4.9.76/fs/ext4/ialloc.c 2018-01-13 21:28:56.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/ext4/ialloc.c 2018-01-10 02:50:49.000000000 +0000
+@@ -21,6 +21,7 @@
#include <linux/random.h>
#include <linux/bitops.h>
#include <linux/blkdev.h>
@@ -2946,26 +2563,26 @@ diff -NurpP --minimal linux-3.18.5/fs/ext4/ialloc.c linux-3.18.5-vs2.3.7.3/fs/ex
#include <asm/byteorder.h>
#include "ext4.h"
-@@ -754,6 +755,7 @@ struct inode *__ext4_new_inode(handle_t
+@@ -799,6 +800,7 @@ struct inode *__ext4_new_inode(handle_t
inode->i_mode = mode;
inode->i_uid = current_fsuid();
inode->i_gid = dir->i_gid;
+ i_tag_write(inode, dx_current_fstag(sb));
} else
inode_init_owner(inode, dir, mode);
- dquot_initialize(inode);
-diff -NurpP --minimal linux-3.18.5/fs/ext4/inode.c linux-3.18.5-vs2.3.7.3/fs/ext4/inode.c
---- linux-3.18.5/fs/ext4/inode.c 2015-01-17 02:40:17.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext4/inode.c 2015-01-19 12:50:18.000000000 +0000
-@@ -39,6 +39,7 @@
- #include <linux/ratelimit.h>
- #include <linux/aio.h>
+
+diff -NurpP --minimal linux-4.9.76/fs/ext4/inode.c linux-4.9.76-vs2.3.9.5/fs/ext4/inode.c
+--- linux-4.9.76/fs/ext4/inode.c 2018-01-13 21:28:56.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/ext4/inode.c 2018-01-13 02:02:12.000000000 +0000
+@@ -37,6 +37,7 @@
+ #include <linux/printk.h>
+ #include <linux/slab.h>
#include <linux/bitops.h>
+#include <linux/vs_tag.h>
#include "ext4_jbd2.h"
#include "xattr.h"
-@@ -3811,42 +3812,66 @@ void ext4_set_inode_flags(struct inode *
+@@ -4374,12 +4375,15 @@ void ext4_set_inode_flags(struct inode *
unsigned int flags = EXT4_I(inode)->i_flags;
unsigned int new_fl = 0;
@@ -2983,10 +2600,12 @@ diff -NurpP --minimal linux-3.18.5/fs/ext4/inode.c linux-3.18.5-vs2.3.7.3/fs/ext
if (flags & EXT4_NOATIME_FL)
new_fl |= S_NOATIME;
if (flags & EXT4_DIRSYNC_FL)
- new_fl |= S_DIRSYNC;
+@@ -4387,31 +4391,52 @@ void ext4_set_inode_flags(struct inode *
+ if (test_opt(inode->i_sb, DAX) && S_ISREG(inode->i_mode))
+ new_fl |= S_DAX;
inode_set_flags(inode, new_fl,
-- S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC);
-+ S_IXUNLINK | S_IMMUTABLE |
+- S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC|S_DAX);
++ S_IXUNLINK | S_IMMUTABLE | S_DAX |
+ S_SYNC | S_APPEND | S_NOATIME | S_DIRSYNC);
+
+ new_fl = 0;
@@ -3039,7 +2658,7 @@ diff -NurpP --minimal linux-3.18.5/fs/ext4/inode.c linux-3.18.5-vs2.3.7.3/fs/ext
} while (cmpxchg(&ei->i_flags, old_fl, new_fl) != old_fl);
}
-@@ -3950,8 +3975,10 @@ struct inode *ext4_iget(struct super_blo
+@@ -4531,8 +4556,10 @@ struct inode *ext4_iget(struct super_blo
i_uid |= le16_to_cpu(raw_inode->i_uid_high) << 16;
i_gid |= le16_to_cpu(raw_inode->i_gid_high) << 16;
}
@@ -3049,10 +2668,10 @@ diff -NurpP --minimal linux-3.18.5/fs/ext4/inode.c linux-3.18.5-vs2.3.7.3/fs/ext
+ i_gid_write(inode, INOTAG_GID(DX_TAG(inode), i_uid, i_gid));
+ i_tag_write(inode, INOTAG_TAG(DX_TAG(inode), i_uid, i_gid,
+ le16_to_cpu(raw_inode->i_raw_tag)));
+ ei->i_projid = make_kprojid(&init_user_ns, i_projid);
set_nlink(inode, le16_to_cpu(raw_inode->i_links_count));
- ext4_clear_state_flags(ei); /* Only relevant on 32-bit archs */
-@@ -4191,8 +4218,10 @@ static int ext4_do_update_inode(handle_t
+@@ -4848,8 +4875,10 @@ static int ext4_do_update_inode(handle_t
ext4_get_inode_flags(ei);
raw_inode->i_mode = cpu_to_le16(inode->i_mode);
@@ -3062,10 +2681,10 @@ diff -NurpP --minimal linux-3.18.5/fs/ext4/inode.c linux-3.18.5-vs2.3.7.3/fs/ext
+ TAGINO_KUID(DX_TAG(inode), inode->i_uid, inode->i_tag));
+ i_gid = from_kgid(&init_user_ns,
+ TAGINO_KGID(DX_TAG(inode), inode->i_gid, inode->i_tag));
+ i_projid = from_kprojid(&init_user_ns, ei->i_projid);
if (!(test_opt(inode->i_sb, NO_UID32))) {
raw_inode->i_uid_low = cpu_to_le16(low_16_bits(i_uid));
- raw_inode->i_gid_low = cpu_to_le16(low_16_bits(i_gid));
-@@ -4215,6 +4244,9 @@ static int ext4_do_update_inode(handle_t
+@@ -4873,6 +4902,9 @@ static int ext4_do_update_inode(handle_t
raw_inode->i_uid_high = 0;
raw_inode->i_gid_high = 0;
}
@@ -3075,9 +2694,9 @@ diff -NurpP --minimal linux-3.18.5/fs/ext4/inode.c linux-3.18.5-vs2.3.7.3/fs/ext
raw_inode->i_links_count = cpu_to_le16(inode->i_nlink);
EXT4_INODE_SET_XTIME(i_ctime, inode, raw_inode);
-@@ -4458,7 +4490,8 @@ int ext4_setattr(struct dentry *dentry,
- if (is_quota_modification(inode, attr))
- dquot_initialize(inode);
+@@ -5126,7 +5158,8 @@ int ext4_setattr(struct dentry *dentry,
+ return error;
+ }
if ((ia_valid & ATTR_UID && !uid_eq(attr->ia_uid, inode->i_uid)) ||
- (ia_valid & ATTR_GID && !gid_eq(attr->ia_gid, inode->i_gid))) {
+ (ia_valid & ATTR_GID && !gid_eq(attr->ia_gid, inode->i_gid)) ||
@@ -3085,7 +2704,7 @@ diff -NurpP --minimal linux-3.18.5/fs/ext4/inode.c linux-3.18.5-vs2.3.7.3/fs/ext
handle_t *handle;
/* (user+group)*(old+new) structure, inode write (sb,
-@@ -4481,6 +4514,8 @@ int ext4_setattr(struct dentry *dentry,
+@@ -5149,6 +5182,8 @@ int ext4_setattr(struct dentry *dentry,
inode->i_uid = attr->ia_uid;
if (attr->ia_valid & ATTR_GID)
inode->i_gid = attr->ia_gid;
@@ -3094,19 +2713,30 @@ diff -NurpP --minimal linux-3.18.5/fs/ext4/inode.c linux-3.18.5-vs2.3.7.3/fs/ext
error = ext4_mark_inode_dirty(handle, inode);
ext4_journal_stop(handle);
}
-diff -NurpP --minimal linux-3.18.5/fs/ext4/ioctl.c linux-3.18.5-vs2.3.7.3/fs/ext4/ioctl.c
---- linux-3.18.5/fs/ext4/ioctl.c 2015-01-17 02:40:17.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext4/ioctl.c 2015-01-19 10:57:47.000000000 +0000
-@@ -14,6 +14,7 @@
- #include <linux/compat.h>
- #include <linux/mount.h>
+diff -NurpP --minimal linux-4.9.76/fs/ext4/ioctl.c linux-4.9.76-vs2.3.9.5/fs/ext4/ioctl.c
+--- linux-4.9.76/fs/ext4/ioctl.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/ext4/ioctl.c 2018-01-13 02:03:59.000000000 +0000
+@@ -15,6 +15,7 @@
#include <linux/file.h>
+ #include <linux/quotaops.h>
+ #include <linux/uuid.h>
+#include <linux/vs_tag.h>
#include <asm/uaccess.h>
#include "ext4_jbd2.h"
#include "ext4.h"
-@@ -198,6 +199,33 @@ journal_err_out:
- return err;
+@@ -226,7 +227,9 @@ static int ext4_ioctl_setflags(struct in
+ *
+ * This test looks nicer. Thanks to Pauline Middelink
+ */
+- if ((flags ^ oldflags) & (EXT4_APPEND_FL | EXT4_IMMUTABLE_FL)) {
++ if ((oldflags & EXT4_IMMUTABLE_FL) ||
++ ((flags ^ oldflags) & (EXT4_APPEND_FL |
++ EXT4_IMMUTABLE_FL | EXT4_IXUNLINK_FL))) {
+ if (!capable(CAP_LINUX_IMMUTABLE))
+ goto flags_out;
+ }
+@@ -430,6 +433,33 @@ static inline unsigned long ext4_xflags_
+ return iflags;
}
+int ext4_sync_flags(struct inode *inode, int flags, int vflags)
@@ -3139,7 +2769,7 @@ diff -NurpP --minimal linux-3.18.5/fs/ext4/ioctl.c linux-3.18.5-vs2.3.7.3/fs/ext
long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
struct inode *inode = file_inode(filp);
-@@ -231,6 +259,11 @@ long ext4_ioctl(struct file *filp, unsig
+@@ -459,6 +489,11 @@ long ext4_ioctl(struct file *filp, unsig
flags = ext4_mask_flags(inode->i_mode, flags);
@@ -3148,24 +2778,13 @@ diff -NurpP --minimal linux-3.18.5/fs/ext4/ioctl.c linux-3.18.5-vs2.3.7.3/fs/ext
+ return -EACCES;
+ }
+
- err = -EPERM;
- mutex_lock(&inode->i_mutex);
- /* Is it quota file? Do not allow user to mess with it */
-@@ -248,7 +281,9 @@ long ext4_ioctl(struct file *filp, unsig
- *
- * This test looks nicer. Thanks to Pauline Middelink
- */
-- if ((flags ^ oldflags) & (EXT4_APPEND_FL | EXT4_IMMUTABLE_FL)) {
-+ if ((oldflags & EXT4_IMMUTABLE_FL) ||
-+ ((flags ^ oldflags) & (EXT4_APPEND_FL |
-+ EXT4_IMMUTABLE_FL | EXT4_IXUNLINK_FL))) {
- if (!capable(CAP_LINUX_IMMUTABLE))
- goto flags_out;
- }
-diff -NurpP --minimal linux-3.18.5/fs/ext4/namei.c linux-3.18.5-vs2.3.7.3/fs/ext4/namei.c
---- linux-3.18.5/fs/ext4/namei.c 2015-01-17 02:40:17.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext4/namei.c 2015-01-19 10:57:47.000000000 +0000
-@@ -34,6 +34,7 @@
+ inode_lock(inode);
+ err = ext4_ioctl_setflags(inode, flags);
+ inode_unlock(inode);
+diff -NurpP --minimal linux-4.9.76/fs/ext4/namei.c linux-4.9.76-vs2.3.9.5/fs/ext4/namei.c
+--- linux-4.9.76/fs/ext4/namei.c 2018-01-13 21:28:56.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/ext4/namei.c 2018-01-10 02:50:49.000000000 +0000
+@@ -33,6 +33,7 @@
#include <linux/quotaops.h>
#include <linux/buffer_head.h>
#include <linux/bio.h>
@@ -3173,15 +2792,15 @@ diff -NurpP --minimal linux-3.18.5/fs/ext4/namei.c linux-3.18.5-vs2.3.7.3/fs/ext
#include "ext4.h"
#include "ext4_jbd2.h"
-@@ -1279,6 +1280,7 @@ restart:
- ll_rw_block(READ | REQ_META | REQ_PRIO,
+@@ -1459,6 +1460,7 @@ restart:
+ REQ_META | REQ_PRIO,
1, &bh);
}
+ dx_propagate_tag(nd, inode);
}
if ((bh = bh_use[ra_ptr++]) == NULL)
goto next;
-@@ -3539,6 +3541,7 @@ const struct inode_operations ext4_dir_i
+@@ -3906,6 +3908,7 @@ const struct inode_operations ext4_dir_i
.get_acl = ext4_get_acl,
.set_acl = ext4_set_acl,
.fiemap = ext4_fiemap,
@@ -3189,19 +2808,18 @@ diff -NurpP --minimal linux-3.18.5/fs/ext4/namei.c linux-3.18.5-vs2.3.7.3/fs/ext
};
const struct inode_operations ext4_special_inode_operations = {
-diff -NurpP --minimal linux-3.18.5/fs/ext4/super.c linux-3.18.5-vs2.3.7.3/fs/ext4/super.c
---- linux-3.18.5/fs/ext4/super.c 2015-01-17 02:40:17.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ext4/super.c 2015-01-19 10:57:47.000000000 +0000
-@@ -1146,7 +1146,7 @@ enum {
- Opt_inode_readahead_blks, Opt_journal_ioprio,
+diff -NurpP --minimal linux-4.9.76/fs/ext4/super.c linux-4.9.76-vs2.3.9.5/fs/ext4/super.c
+--- linux-4.9.76/fs/ext4/super.c 2018-01-13 21:28:56.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/ext4/super.c 2018-01-10 02:50:49.000000000 +0000
+@@ -1280,6 +1280,7 @@ enum {
Opt_dioread_nolock, Opt_dioread_lock,
Opt_discard, Opt_nodiscard, Opt_init_itable, Opt_noinit_itable,
-- Opt_max_dir_size_kb,
-+ Opt_max_dir_size_kb, Opt_tag, Opt_notag, Opt_tagid
+ Opt_max_dir_size_kb, Opt_nojournal_checksum,
++ Opt_tag, Opt_notag, Opt_tagid
};
static const match_table_t tokens = {
-@@ -1227,6 +1227,9 @@ static const match_table_t tokens = {
+@@ -1366,6 +1367,9 @@ static const match_table_t tokens = {
{Opt_removed, "reservation"}, /* mount option from ext2/3 */
{Opt_removed, "noreservation"}, /* mount option from ext2/3 */
{Opt_removed, "journal=%u"}, /* mount option from ext2/3 */
@@ -3211,9 +2829,9 @@ diff -NurpP --minimal linux-3.18.5/fs/ext4/super.c linux-3.18.5-vs2.3.7.3/fs/ext
{Opt_err, NULL},
};
-@@ -1459,6 +1462,20 @@ static int handle_mount_opt(struct super
- case Opt_i_version:
- sb->s_flags |= MS_I_VERSION;
+@@ -1611,6 +1615,20 @@ static int handle_mount_opt(struct super
+ case Opt_nolazytime:
+ sb->s_flags &= ~MS_LAZYTIME;
return 1;
+#ifndef CONFIG_TAGGING_NONE
+ case Opt_tag:
@@ -3232,8 +2850,8 @@ diff -NurpP --minimal linux-3.18.5/fs/ext4/super.c linux-3.18.5-vs2.3.7.3/fs/ext
}
for (m = ext4_mount_opts; m->token != Opt_err; m++)
-@@ -3600,6 +3617,9 @@ static int ext4_fill_super(struct super_
- clear_opt(sb, DELALLOC);
+@@ -3550,6 +3568,9 @@ static int ext4_fill_super(struct super_
+ sb->s_iflags |= SB_I_CGROUPWB;
}
+ if (EXT4_SB(sb)->s_mount_opt & EXT4_MOUNT_TAGGED)
@@ -3242,7 +2860,7 @@ diff -NurpP --minimal linux-3.18.5/fs/ext4/super.c linux-3.18.5-vs2.3.7.3/fs/ext
sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
(test_opt(sb, POSIX_ACL) ? MS_POSIXACL : 0);
-@@ -4872,6 +4892,14 @@ static int ext4_remount(struct super_blo
+@@ -4917,6 +4938,14 @@ static int ext4_remount(struct super_blo
if (sbi->s_mount_flags & EXT4_MF_FS_ABORTED)
ext4_abort(sb, "Abort forced by user");
@@ -3257,9 +2875,9 @@ diff -NurpP --minimal linux-3.18.5/fs/ext4/super.c linux-3.18.5-vs2.3.7.3/fs/ext
sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
(test_opt(sb, POSIX_ACL) ? MS_POSIXACL : 0);
-diff -NurpP --minimal linux-3.18.5/fs/fcntl.c linux-3.18.5-vs2.3.7.3/fs/fcntl.c
---- linux-3.18.5/fs/fcntl.c 2015-01-17 02:40:17.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/fcntl.c 2015-01-19 11:48:08.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/fs/fcntl.c linux-4.9.76-vs2.3.9.5/fs/fcntl.c
+--- linux-4.9.76/fs/fcntl.c 2018-01-13 21:28:57.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/fcntl.c 2018-01-10 02:50:49.000000000 +0000
@@ -22,6 +22,7 @@
#include <linux/pid_namespace.h>
#include <linux/user_namespace.h>
@@ -3268,7 +2886,7 @@ diff -NurpP --minimal linux-3.18.5/fs/fcntl.c linux-3.18.5-vs2.3.7.3/fs/fcntl.c
#include <asm/poll.h>
#include <asm/siginfo.h>
-@@ -385,6 +386,8 @@ SYSCALL_DEFINE3(fcntl64, unsigned int, f
+@@ -386,6 +387,8 @@ SYSCALL_DEFINE3(fcntl64, unsigned int, f
if (!f.file)
goto out;
@@ -3277,18 +2895,18 @@ diff -NurpP --minimal linux-3.18.5/fs/fcntl.c linux-3.18.5-vs2.3.7.3/fs/fcntl.c
if (unlikely(f.file->f_mode & FMODE_PATH)) {
if (!check_fcntl_cmd(cmd))
-diff -NurpP --minimal linux-3.18.5/fs/file.c linux-3.18.5-vs2.3.7.3/fs/file.c
---- linux-3.18.5/fs/file.c 2015-01-17 02:40:17.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/file.c 2015-01-19 10:57:47.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/fs/file.c linux-4.9.76-vs2.3.9.5/fs/file.c
+--- linux-4.9.76/fs/file.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/file.c 2018-01-10 02:50:49.000000000 +0000
@@ -22,6 +22,7 @@
#include <linux/spinlock.h>
#include <linux/rcupdate.h>
#include <linux/workqueue.h>
+#include <linux/vs_limit.h>
- int sysctl_nr_open __read_mostly = 1024*1024;
- int sysctl_nr_open_min = BITS_PER_LONG;
-@@ -309,6 +310,8 @@ struct files_struct *dup_fd(struct files
+ unsigned int sysctl_nr_open __read_mostly = 1024*1024;
+ unsigned int sysctl_nr_open_min = BITS_PER_LONG;
+@@ -357,6 +358,8 @@ struct files_struct *dup_fd(struct files
struct file *f = *old_fds++;
if (f) {
get_file(f);
@@ -3297,7 +2915,7 @@ diff -NurpP --minimal linux-3.18.5/fs/file.c linux-3.18.5-vs2.3.7.3/fs/file.c
} else {
/*
* The fd may be claimed in the fd bitmap but not yet
-@@ -369,9 +372,11 @@ static struct fdtable *close_files(struc
+@@ -406,9 +409,11 @@ static struct fdtable *close_files(struc
filp_close(file, files);
cond_resched_rcu_qs();
}
@@ -3309,7 +2927,7 @@ diff -NurpP --minimal linux-3.18.5/fs/file.c linux-3.18.5-vs2.3.7.3/fs/file.c
}
}
-@@ -487,6 +492,7 @@ repeat:
+@@ -539,6 +544,7 @@ repeat:
else
__clear_close_on_exec(fd, fdt);
error = fd;
@@ -3317,7 +2935,7 @@ diff -NurpP --minimal linux-3.18.5/fs/file.c linux-3.18.5-vs2.3.7.3/fs/file.c
#if 1
/* Sanity check */
if (rcu_access_pointer(fdt->fd[fd]) != NULL) {
-@@ -517,6 +523,7 @@ static void __put_unused_fd(struct files
+@@ -569,6 +575,7 @@ static void __put_unused_fd(struct files
__clear_open_fd(fd, fdt);
if (fd < files->next_fd)
files->next_fd = fd;
@@ -3325,7 +2943,7 @@ diff -NurpP --minimal linux-3.18.5/fs/file.c linux-3.18.5-vs2.3.7.3/fs/file.c
}
void put_unused_fd(unsigned int fd)
-@@ -784,6 +791,8 @@ __releases(&files->file_lock)
+@@ -856,6 +863,8 @@ __releases(&files->file_lock)
if (tofree)
filp_close(tofree, files);
@@ -3334,13 +2952,13 @@ diff -NurpP --minimal linux-3.18.5/fs/file.c linux-3.18.5-vs2.3.7.3/fs/file.c
return fd;
-diff -NurpP --minimal linux-3.18.5/fs/file_table.c linux-3.18.5-vs2.3.7.3/fs/file_table.c
---- linux-3.18.5/fs/file_table.c 2015-01-17 02:40:17.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/file_table.c 2015-01-19 12:36:42.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/fs/file_table.c linux-4.9.76-vs2.3.9.5/fs/file_table.c
+--- linux-4.9.76/fs/file_table.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/file_table.c 2018-01-10 02:50:49.000000000 +0000
@@ -26,6 +26,8 @@
- #include <linux/hardirq.h>
#include <linux/task_work.h>
#include <linux/ima.h>
+ #include <linux/swap.h>
+#include <linux/vs_limit.h>
+#include <linux/vs_context.h>
@@ -3373,9 +2991,9 @@ diff -NurpP --minimal linux-3.18.5/fs/file_table.c linux-3.18.5-vs2.3.7.3/fs/fil
file_free(file);
}
}
-diff -NurpP --minimal linux-3.18.5/fs/fs_struct.c linux-3.18.5-vs2.3.7.3/fs/fs_struct.c
---- linux-3.18.5/fs/fs_struct.c 2014-01-22 20:39:06.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/fs_struct.c 2015-01-19 10:57:47.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/fs/fs_struct.c linux-4.9.76-vs2.3.9.5/fs/fs_struct.c
+--- linux-4.9.76/fs/fs_struct.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/fs_struct.c 2018-01-10 02:50:49.000000000 +0000
@@ -4,6 +4,7 @@
#include <linux/path.h>
#include <linux/slab.h>
@@ -3400,10 +3018,10 @@ diff -NurpP --minimal linux-3.18.5/fs/fs_struct.c linux-3.18.5-vs2.3.7.3/fs/fs_s
}
return fs;
}
-diff -NurpP --minimal linux-3.18.5/fs/gfs2/file.c linux-3.18.5-vs2.3.7.3/fs/gfs2/file.c
---- linux-3.18.5/fs/gfs2/file.c 2015-01-17 02:40:17.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/gfs2/file.c 2015-01-19 10:57:47.000000000 +0000
-@@ -138,6 +138,9 @@ static const u32 fsflags_to_gfs2[32] = {
+diff -NurpP --minimal linux-4.9.76/fs/gfs2/file.c linux-4.9.76-vs2.3.9.5/fs/gfs2/file.c
+--- linux-4.9.76/fs/gfs2/file.c 2018-01-13 21:28:57.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/gfs2/file.c 2018-01-10 02:50:49.000000000 +0000
+@@ -137,6 +137,9 @@ static const u32 fsflags_to_gfs2[32] = {
[12] = GFS2_DIF_EXHASH,
[14] = GFS2_DIF_INHERIT_JDATA,
[17] = GFS2_DIF_TOPDIR,
@@ -3413,7 +3031,7 @@ diff -NurpP --minimal linux-3.18.5/fs/gfs2/file.c linux-3.18.5-vs2.3.7.3/fs/gfs2
};
static const u32 gfs2_to_fsflags[32] = {
-@@ -148,6 +151,9 @@ static const u32 gfs2_to_fsflags[32] = {
+@@ -147,6 +150,9 @@ static const u32 gfs2_to_fsflags[32] = {
[gfs2fl_ExHash] = FS_INDEX_FL,
[gfs2fl_TopLevel] = FS_TOPDIR_FL,
[gfs2fl_InheritJdata] = FS_JOURNAL_DATA_FL,
@@ -3423,7 +3041,7 @@ diff -NurpP --minimal linux-3.18.5/fs/gfs2/file.c linux-3.18.5-vs2.3.7.3/fs/gfs2
};
static int gfs2_get_flags(struct file *filp, u32 __user *ptr)
-@@ -178,12 +184,18 @@ void gfs2_set_inode_flags(struct inode *
+@@ -178,12 +184,17 @@ void gfs2_set_inode_flags(struct inode *
{
struct gfs2_inode *ip = GFS2_I(inode);
unsigned int flags = inode->i_flags;
@@ -3434,16 +3052,15 @@ diff -NurpP --minimal linux-3.18.5/fs/gfs2/file.c linux-3.18.5-vs2.3.7.3/fs/gfs2
- flags &= ~(S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC|S_NOSEC);
if ((ip->i_eattr == 0) && !is_sxid(inode->i_mode))
- inode->i_flags |= S_NOSEC;
+ flags |= S_NOSEC;
if (ip->i_diskflags & GFS2_DIF_IMMUTABLE)
flags |= S_IMMUTABLE;
+ if (ip->i_diskflags & GFS2_DIF_IXUNLINK)
+ flags |= S_IXUNLINK;
-+
if (ip->i_diskflags & GFS2_DIF_APPENDONLY)
flags |= S_APPEND;
if (ip->i_diskflags & GFS2_DIF_NOATIME)
-@@ -191,6 +203,43 @@ void gfs2_set_inode_flags(struct inode *
+@@ -191,6 +202,43 @@ void gfs2_set_inode_flags(struct inode *
if (ip->i_diskflags & GFS2_DIF_SYNC)
flags |= S_SYNC;
inode->i_flags = flags;
@@ -3487,8 +3104,8 @@ diff -NurpP --minimal linux-3.18.5/fs/gfs2/file.c linux-3.18.5-vs2.3.7.3/fs/gfs2
}
/* Flags that can be set by user space */
-@@ -304,6 +353,37 @@ static int gfs2_set_flags(struct file *f
- return do_gfs2_set_flags(filp, gfsflags, ~GFS2_DIF_JDATA);
+@@ -306,6 +354,37 @@ static int gfs2_set_flags(struct file *f
+ return do_gfs2_set_flags(filp, gfsflags, ~(GFS2_DIF_SYSTEM | GFS2_DIF_JDATA));
}
+int gfs2_sync_flags(struct inode *inode, int flags, int vflags)
@@ -3525,10 +3142,10 @@ diff -NurpP --minimal linux-3.18.5/fs/gfs2/file.c linux-3.18.5-vs2.3.7.3/fs/gfs2
static long gfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
switch(cmd) {
-diff -NurpP --minimal linux-3.18.5/fs/gfs2/inode.h linux-3.18.5-vs2.3.7.3/fs/gfs2/inode.h
---- linux-3.18.5/fs/gfs2/inode.h 2013-11-25 15:45:01.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/gfs2/inode.h 2015-01-19 10:57:47.000000000 +0000
-@@ -118,6 +118,7 @@ extern const struct file_operations gfs2
+diff -NurpP --minimal linux-4.9.76/fs/gfs2/inode.h linux-4.9.76-vs2.3.9.5/fs/gfs2/inode.h
+--- linux-4.9.76/fs/gfs2/inode.h 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/gfs2/inode.h 2018-01-10 02:50:49.000000000 +0000
+@@ -117,6 +117,7 @@ extern const struct file_operations gfs2
extern const struct file_operations gfs2_dir_fops_nolock;
extern void gfs2_set_inode_flags(struct inode *inode);
@@ -3536,9 +3153,9 @@ diff -NurpP --minimal linux-3.18.5/fs/gfs2/inode.h linux-3.18.5-vs2.3.7.3/fs/gfs
#ifdef CONFIG_GFS2_FS_LOCKING_DLM
extern const struct file_operations gfs2_file_fops;
-diff -NurpP --minimal linux-3.18.5/fs/hostfs/hostfs.h linux-3.18.5-vs2.3.7.3/fs/hostfs/hostfs.h
---- linux-3.18.5/fs/hostfs/hostfs.h 2015-01-16 22:19:18.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/hostfs/hostfs.h 2015-01-19 10:57:47.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/fs/hostfs/hostfs.h linux-4.9.76-vs2.3.9.5/fs/hostfs/hostfs.h
+--- linux-4.9.76/fs/hostfs/hostfs.h 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/hostfs/hostfs.h 2018-01-10 02:50:49.000000000 +0000
@@ -42,6 +42,7 @@ struct hostfs_iattr {
unsigned short ia_mode;
uid_t ia_uid;
@@ -3547,18 +3164,18 @@ diff -NurpP --minimal linux-3.18.5/fs/hostfs/hostfs.h linux-3.18.5-vs2.3.7.3/fs/
loff_t ia_size;
struct timespec ia_atime;
struct timespec ia_mtime;
-diff -NurpP --minimal linux-3.18.5/fs/inode.c linux-3.18.5-vs2.3.7.3/fs/inode.c
---- linux-3.18.5/fs/inode.c 2015-01-16 22:19:18.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/inode.c 2015-01-19 10:57:47.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/fs/inode.c linux-4.9.76-vs2.3.9.5/fs/inode.c
+--- linux-4.9.76/fs/inode.c 2018-01-13 21:28:57.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/inode.c 2018-01-10 02:50:49.000000000 +0000
@@ -18,6 +18,7 @@
#include <linux/buffer_head.h> /* for inode_has_buffers */
#include <linux/ratelimit.h>
#include <linux/list_lru.h>
+#include <linux/vs_tag.h>
+ #include <trace/events/writeback.h>
#include "internal.h"
- /*
-@@ -129,6 +130,8 @@ int inode_init_always(struct super_block
+@@ -133,6 +134,8 @@ int inode_init_always(struct super_block
struct address_space *const mapping = &inode->i_data;
inode->i_sb = sb;
@@ -3567,23 +3184,23 @@ diff -NurpP --minimal linux-3.18.5/fs/inode.c linux-3.18.5-vs2.3.7.3/fs/inode.c
inode->i_blkbits = sb->s_blocksize_bits;
inode->i_flags = 0;
atomic_set(&inode->i_count, 1);
-@@ -138,6 +141,7 @@ int inode_init_always(struct super_block
- inode->i_opflags = 0;
+@@ -144,6 +147,7 @@ int inode_init_always(struct super_block
+ inode->i_opflags |= IOP_XATTR;
i_uid_write(inode, 0);
i_gid_write(inode, 0);
+ i_tag_write(inode, 0);
atomic_set(&inode->i_writecount, 0);
inode->i_size = 0;
inode->i_blocks = 0;
-@@ -150,6 +154,7 @@ int inode_init_always(struct super_block
- inode->i_bdev = NULL;
- inode->i_cdev = NULL;
+@@ -155,6 +159,7 @@ int inode_init_always(struct super_block
+ inode->i_link = NULL;
+ inode->i_dir_seq = 0;
inode->i_rdev = 0;
+ inode->i_mdev = 0;
inode->dirtied_when = 0;
- if (security_inode_alloc(inode))
-@@ -478,6 +483,8 @@ void __insert_inode_hash(struct inode *i
+ #ifdef CONFIG_CGROUP_WRITEBACK
+@@ -479,6 +484,8 @@ void __insert_inode_hash(struct inode *i
}
EXPORT_SYMBOL(__insert_inode_hash);
@@ -3592,7 +3209,7 @@ diff -NurpP --minimal linux-3.18.5/fs/inode.c linux-3.18.5-vs2.3.7.3/fs/inode.c
/**
* __remove_inode_hash - remove an inode from the hash
* @inode: inode to unhash
-@@ -1795,9 +1802,11 @@ void init_special_inode(struct inode *in
+@@ -1977,9 +1984,11 @@ void init_special_inode(struct inode *in
if (S_ISCHR(mode)) {
inode->i_fop = &def_chr_fops;
inode->i_rdev = rdev;
@@ -3604,7 +3221,7 @@ diff -NurpP --minimal linux-3.18.5/fs/inode.c linux-3.18.5-vs2.3.7.3/fs/inode.c
} else if (S_ISFIFO(mode))
inode->i_fop = &pipefifo_fops;
else if (S_ISSOCK(mode))
-@@ -1826,6 +1835,7 @@ void inode_init_owner(struct inode *inod
+@@ -2008,6 +2017,7 @@ void inode_init_owner(struct inode *inod
} else
inode->i_gid = current_fsgid();
inode->i_mode = mode;
@@ -3612,9 +3229,9 @@ diff -NurpP --minimal linux-3.18.5/fs/inode.c linux-3.18.5-vs2.3.7.3/fs/inode.c
}
EXPORT_SYMBOL(inode_init_owner);
-diff -NurpP --minimal linux-3.18.5/fs/ioctl.c linux-3.18.5-vs2.3.7.3/fs/ioctl.c
---- linux-3.18.5/fs/ioctl.c 2014-01-22 20:39:06.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/ioctl.c 2015-01-19 10:57:47.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/fs/ioctl.c linux-4.9.76-vs2.3.9.5/fs/ioctl.c
+--- linux-4.9.76/fs/ioctl.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/ioctl.c 2018-01-13 01:03:36.000000000 +0000
@@ -15,6 +15,9 @@
#include <linux/writeback.h>
#include <linux/buffer_head.h>
@@ -3622,15 +3239,15 @@ diff -NurpP --minimal linux-3.18.5/fs/ioctl.c linux-3.18.5-vs2.3.7.3/fs/ioctl.c
+#include <linux/proc_fs.h>
+#include <linux/vserver/inode.h>
+#include <linux/vs_tag.h>
+ #include "internal.h"
#include <asm/ioctls.h>
-
-diff -NurpP --minimal linux-3.18.5/fs/jfs/file.c linux-3.18.5-vs2.3.7.3/fs/jfs/file.c
---- linux-3.18.5/fs/jfs/file.c 2014-09-03 13:19:40.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/jfs/file.c 2015-01-19 10:58:03.000000000 +0000
-@@ -110,7 +110,8 @@ int jfs_setattr(struct dentry *dentry, s
- if (is_quota_modification(inode, iattr))
- dquot_initialize(inode);
+diff -NurpP --minimal linux-4.9.76/fs/jfs/file.c linux-4.9.76-vs2.3.9.5/fs/jfs/file.c
+--- linux-4.9.76/fs/jfs/file.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/jfs/file.c 2018-01-10 02:50:49.000000000 +0000
+@@ -113,7 +113,8 @@ int jfs_setattr(struct dentry *dentry, s
+ return rc;
+ }
if ((iattr->ia_valid & ATTR_UID && !uid_eq(iattr->ia_uid, inode->i_uid)) ||
- (iattr->ia_valid & ATTR_GID && !gid_eq(iattr->ia_gid, inode->i_gid))) {
+ (iattr->ia_valid & ATTR_GID && !gid_eq(iattr->ia_gid, inode->i_gid)) ||
@@ -3646,9 +3263,9 @@ diff -NurpP --minimal linux-3.18.5/fs/jfs/file.c linux-3.18.5-vs2.3.7.3/fs/jfs/f
};
const struct file_operations jfs_file_operations = {
-diff -NurpP --minimal linux-3.18.5/fs/jfs/ioctl.c linux-3.18.5-vs2.3.7.3/fs/jfs/ioctl.c
---- linux-3.18.5/fs/jfs/ioctl.c 2013-05-31 13:45:24.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/jfs/ioctl.c 2015-01-19 10:58:03.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/fs/jfs/ioctl.c linux-4.9.76-vs2.3.9.5/fs/jfs/ioctl.c
+--- linux-4.9.76/fs/jfs/ioctl.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/jfs/ioctl.c 2018-01-10 02:50:49.000000000 +0000
@@ -12,6 +12,7 @@
#include <linux/time.h>
#include <linux/sched.h>
@@ -3695,7 +3312,7 @@ diff -NurpP --minimal linux-3.18.5/fs/jfs/ioctl.c linux-3.18.5-vs2.3.7.3/fs/jfs/
+ ((flags ^ oldflags) & (JFS_APPEND_FL |
+ JFS_IMMUTABLE_FL | JFS_IXUNLINK_FL))) {
if (!capable(CAP_LINUX_IMMUTABLE)) {
- mutex_unlock(&inode->i_mutex);
+ inode_unlock(inode);
err = -EPERM;
@@ -115,7 +131,7 @@ long jfs_ioctl(struct file *filp, unsign
}
@@ -3706,9 +3323,9 @@ diff -NurpP --minimal linux-3.18.5/fs/jfs/ioctl.c linux-3.18.5-vs2.3.7.3/fs/jfs/
flags |= oldflags & ~JFS_FL_USER_MODIFIABLE;
jfs_inode->mode2 = flags;
-diff -NurpP --minimal linux-3.18.5/fs/jfs/jfs_dinode.h linux-3.18.5-vs2.3.7.3/fs/jfs/jfs_dinode.h
---- linux-3.18.5/fs/jfs/jfs_dinode.h 2012-12-11 03:30:57.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/jfs/jfs_dinode.h 2015-01-19 10:58:03.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/fs/jfs/jfs_dinode.h linux-4.9.76-vs2.3.9.5/fs/jfs/jfs_dinode.h
+--- linux-4.9.76/fs/jfs/jfs_dinode.h 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/jfs/jfs_dinode.h 2018-01-10 02:50:49.000000000 +0000
@@ -161,9 +161,13 @@ struct dinode {
#define JFS_APPEND_FL 0x01000000 /* writes to file may only append */
@@ -3725,9 +3342,9 @@ diff -NurpP --minimal linux-3.18.5/fs/jfs/jfs_dinode.h linux-3.18.5-vs2.3.7.3/fs
#define JFS_FL_INHERIT 0x03C80000
/* These are identical to EXT[23]_IOC_GETFLAGS/SETFLAGS */
-diff -NurpP --minimal linux-3.18.5/fs/jfs/jfs_filsys.h linux-3.18.5-vs2.3.7.3/fs/jfs/jfs_filsys.h
---- linux-3.18.5/fs/jfs/jfs_filsys.h 2012-12-11 03:30:57.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/jfs/jfs_filsys.h 2015-01-19 10:58:03.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/fs/jfs/jfs_filsys.h linux-4.9.76-vs2.3.9.5/fs/jfs/jfs_filsys.h
+--- linux-4.9.76/fs/jfs/jfs_filsys.h 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/jfs/jfs_filsys.h 2018-01-10 02:50:49.000000000 +0000
@@ -266,6 +266,7 @@
#define JFS_NAME_MAX 255
#define JFS_PATH_MAX BPSIZE
@@ -3736,9 +3353,9 @@ diff -NurpP --minimal linux-3.18.5/fs/jfs/jfs_filsys.h linux-3.18.5-vs2.3.7.3/fs
/*
* file system state (superblock state)
-diff -NurpP --minimal linux-3.18.5/fs/jfs/jfs_imap.c linux-3.18.5-vs2.3.7.3/fs/jfs/jfs_imap.c
---- linux-3.18.5/fs/jfs/jfs_imap.c 2013-11-25 15:45:01.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/jfs/jfs_imap.c 2015-01-19 10:58:03.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/fs/jfs/jfs_imap.c linux-4.9.76-vs2.3.9.5/fs/jfs/jfs_imap.c
+--- linux-4.9.76/fs/jfs/jfs_imap.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/jfs/jfs_imap.c 2018-01-10 02:50:49.000000000 +0000
@@ -46,6 +46,7 @@
#include <linux/pagemap.h>
#include <linux/quotaops.h>
@@ -3747,7 +3364,7 @@ diff -NurpP --minimal linux-3.18.5/fs/jfs/jfs_imap.c linux-3.18.5-vs2.3.7.3/fs/j
#include "jfs_incore.h"
#include "jfs_inode.h"
-@@ -3047,6 +3048,8 @@ static int copy_from_dinode(struct dinod
+@@ -3046,6 +3047,8 @@ static int copy_from_dinode(struct dinod
{
struct jfs_inode_info *jfs_ip = JFS_IP(ip);
struct jfs_sb_info *sbi = JFS_SBI(ip->i_sb);
@@ -3756,7 +3373,7 @@ diff -NurpP --minimal linux-3.18.5/fs/jfs/jfs_imap.c linux-3.18.5-vs2.3.7.3/fs/j
jfs_ip->fileset = le32_to_cpu(dip->di_fileset);
jfs_ip->mode2 = le32_to_cpu(dip->di_mode);
-@@ -3067,14 +3070,18 @@ static int copy_from_dinode(struct dinod
+@@ -3066,14 +3069,18 @@ static int copy_from_dinode(struct dinod
}
set_nlink(ip, le32_to_cpu(dip->di_nlink));
@@ -3777,7 +3394,7 @@ diff -NurpP --minimal linux-3.18.5/fs/jfs/jfs_imap.c linux-3.18.5-vs2.3.7.3/fs/j
if (!gid_valid(sbi->gid))
ip->i_gid = jfs_ip->saved_gid;
else {
-@@ -3139,16 +3146,14 @@ static void copy_to_dinode(struct dinode
+@@ -3138,16 +3145,14 @@ static void copy_to_dinode(struct dinode
dip->di_size = cpu_to_le64(ip->i_size);
dip->di_nblocks = cpu_to_le64(PBLK2LBLK(ip->i_sb, ip->i_blocks));
dip->di_nlink = cpu_to_le32(ip->i_nlink);
@@ -3802,9 +3419,9 @@ diff -NurpP --minimal linux-3.18.5/fs/jfs/jfs_imap.c linux-3.18.5-vs2.3.7.3/fs/j
jfs_get_inode_flags(jfs_ip);
/*
* mode2 is only needed for storing the higher order bits.
-diff -NurpP --minimal linux-3.18.5/fs/jfs/jfs_inode.c linux-3.18.5-vs2.3.7.3/fs/jfs/jfs_inode.c
---- linux-3.18.5/fs/jfs/jfs_inode.c 2014-09-03 13:19:40.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/jfs/jfs_inode.c 2015-01-21 09:53:08.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/fs/jfs/jfs_inode.c linux-4.9.76-vs2.3.9.5/fs/jfs/jfs_inode.c
+--- linux-4.9.76/fs/jfs/jfs_inode.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/jfs/jfs_inode.c 2018-01-14 06:01:31.000000000 +0000
@@ -18,6 +18,7 @@
#include <linux/fs.h>
@@ -3813,26 +3430,25 @@ diff -NurpP --minimal linux-3.18.5/fs/jfs/jfs_inode.c linux-3.18.5-vs2.3.7.3/fs/
#include "jfs_incore.h"
#include "jfs_inode.h"
#include "jfs_filsys.h"
-@@ -33,26 +34,45 @@ void jfs_set_inode_flags(struct inode *i
+@@ -33,6 +34,9 @@ void jfs_set_inode_flags(struct inode *i
if (flags & JFS_IMMUTABLE_FL)
new_fl |= S_IMMUTABLE;
+ if (flags & JFS_IXUNLINK_FL)
-+ inode->i_flags |= S_IXUNLINK;
++ new_fl |= S_IXUNLINK;
+
-+ if (flags & JFS_SYNC_FL)
-+ inode->i_flags |= S_SYNC;
if (flags & JFS_APPEND_FL)
new_fl |= S_APPEND;
if (flags & JFS_NOATIME_FL)
- new_fl |= S_NOATIME;
- if (flags & JFS_DIRSYNC_FL)
+@@ -41,18 +45,35 @@ void jfs_set_inode_flags(struct inode *i
new_fl |= S_DIRSYNC;
-- if (flags & JFS_SYNC_FL)
-- new_fl |= S_SYNC;
+ if (flags & JFS_SYNC_FL)
+ new_fl |= S_SYNC;
- inode_set_flags(inode, new_fl, S_IMMUTABLE | S_APPEND | S_NOATIME |
-+ inode_set_flags(inode, new_fl, S_IMMUTABLE | S_IXUNLINK | S_APPEND | S_NOATIME |
- S_DIRSYNC | S_SYNC);
+- S_DIRSYNC | S_SYNC);
++
++ inode_set_flags(inode, new_fl, S_IMMUTABLE | S_IXUNLINK |
++ S_APPEND | S_NOATIME | S_DIRSYNC | S_SYNC);
+
+ new_fl = 0;
+ if (flags & JFS_BARRIER_FL)
@@ -3864,7 +3480,7 @@ diff -NurpP --minimal linux-3.18.5/fs/jfs/jfs_inode.c linux-3.18.5-vs2.3.7.3/fs/
if (flags & S_APPEND)
jfs_ip->mode2 |= JFS_APPEND_FL;
if (flags & S_NOATIME)
-@@ -61,6 +81,11 @@ void jfs_get_inode_flags(struct jfs_inod
+@@ -61,6 +82,11 @@ void jfs_get_inode_flags(struct jfs_inod
jfs_ip->mode2 |= JFS_DIRSYNC_FL;
if (flags & S_SYNC)
jfs_ip->mode2 |= JFS_SYNC_FL;
@@ -3876,9 +3492,9 @@ diff -NurpP --minimal linux-3.18.5/fs/jfs/jfs_inode.c linux-3.18.5-vs2.3.7.3/fs/
}
/*
-diff -NurpP --minimal linux-3.18.5/fs/jfs/jfs_inode.h linux-3.18.5-vs2.3.7.3/fs/jfs/jfs_inode.h
---- linux-3.18.5/fs/jfs/jfs_inode.h 2012-12-11 03:30:57.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/jfs/jfs_inode.h 2015-01-19 10:58:03.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/fs/jfs/jfs_inode.h linux-4.9.76-vs2.3.9.5/fs/jfs/jfs_inode.h
+--- linux-4.9.76/fs/jfs/jfs_inode.h 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/jfs/jfs_inode.h 2018-01-10 02:50:49.000000000 +0000
@@ -39,6 +39,7 @@ extern struct dentry *jfs_fh_to_dentry(s
extern struct dentry *jfs_fh_to_parent(struct super_block *sb, struct fid *fid,
int fh_len, int fh_type);
@@ -3887,9 +3503,9 @@ diff -NurpP --minimal linux-3.18.5/fs/jfs/jfs_inode.h linux-3.18.5-vs2.3.7.3/fs/
extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
extern int jfs_setattr(struct dentry *, struct iattr *);
-diff -NurpP --minimal linux-3.18.5/fs/jfs/namei.c linux-3.18.5-vs2.3.7.3/fs/jfs/namei.c
---- linux-3.18.5/fs/jfs/namei.c 2014-06-12 11:34:58.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/jfs/namei.c 2015-01-19 10:58:03.000000000 +0000
+diff -NurpP --minimal linux-4.9.76/fs/jfs/namei.c linux-4.9.76-vs2.3.9.5/fs/jfs/namei.c
+--- linux-4.9.76/fs/jfs/namei.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/jfs/namei.c 2018-01-10 02:50:49.000000000 +0000
@@ -22,6 +22,7 @@
#include <linux/ctype.h>
#include <linux/quotaops.h>
@@ -3898,7 +3514,7 @@ diff -NurpP --minimal linux-3.18.5/fs/jfs/namei.c linux-3.18.5-vs2.3.7.3/fs/jfs/
#include "jfs_incore.h"
#include "jfs_superblock.h"
#include "jfs_inode.h"
-@@ -1461,6 +1462,7 @@ static struct dentry *jfs_lookup(struct
+@@ -1484,6 +1485,7 @@ static struct dentry *jfs_lookup(struct
jfs_err("jfs_lookup: iget failed on inum %d", (uint)inum);
}
@@ -3906,7 +3522,7 @@ diff -NurpP --minimal linux-3.18.5/fs/jfs/namei.c linux-3.18.5-vs2.3.7.3/fs/jfs/
return d_splice_alias(ip, dentry);
}
-@@ -1526,6 +1528,7 @@ const struct inode_operations jfs_dir_in
+@@ -1546,6 +1548,7 @@ const struct inode_operations jfs_dir_in
.get_acl = jfs_get_acl,
.set_acl = jfs_set_acl,
#endif
@@ -3914,10 +3530,10 @@ diff -NurpP --minimal linux-3.18.5/fs/jfs/namei.c linux-3.18.5-vs2.3.7.3/fs/jfs/
};
const struct file_operations jfs_dir_operations = {
-diff -NurpP --minimal linux-3.18.5/fs/jfs/super.c linux-3.18.5-vs2.3.7.3/fs/jfs/super.c
---- linux-3.18.5/fs/jfs/super.c 2015-01-17 02:40:19.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/jfs/super.c 2015-01-19 10:58:03.000000000 +0000
-@@ -203,7 +203,8 @@ enum {
+diff -NurpP --minimal linux-4.9.76/fs/jfs/super.c linux-4.9.76-vs2.3.9.5/fs/jfs/super.c
+--- linux-4.9.76/fs/jfs/super.c 2018-01-13 21:28:57.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/jfs/super.c 2018-01-10 02:50:49.000000000 +0000
+@@ -206,7 +206,8 @@ enum {
Opt_integrity, Opt_nointegrity, Opt_iocharset, Opt_resize,
Opt_resize_nosize, Opt_errors, Opt_ignore, Opt_err, Opt_quota,
Opt_usrquota, Opt_grpquota, Opt_uid, Opt_gid, Opt_umask,
@@ -3927,7 +3543,7 @@ diff -NurpP --minimal linux-3.18.5/fs/jfs/super.c linux-3.18.5-vs2.3.7.3/fs/jfs/
};
static const match_table_t tokens = {
-@@ -213,6 +214,10 @@ static const match_table_t tokens = {
+@@ -216,6 +217,10 @@ static const match_table_t tokens = {
{Opt_resize, "resize=%u"},
{Opt_resize_nosize, "resize"},
{Opt_errors, "errors=%s"},
@@ -3938,7 +3554,7 @@ diff -NurpP --minimal linux-3.18.5/fs/jfs/super.c linux-3.18.5-vs2.3.7.3/fs/jfs/
{Opt_ignore, "noquota"},
{Opt_ignore, "quota"},
{Opt_usrquota, "usrquota"},
-@@ -402,7 +407,20 @@ static int parse_options(char *options,
+@@ -405,7 +410,20 @@ static int parse_options(char *options,
pr_err("JFS: discard option not supported on device\n");
break;
}
@@ -3960,7 +3576,7 @@ diff -NurpP --minimal linux-3.18.5/fs/jfs/super.c linux-3.18.5-vs2.3.7.3/fs/jfs/
default:
printk("jfs: Unrecognized mount option \"%s\" or missing value\n",
p);
-@@ -434,6 +452,12 @@ static int jfs_remount(struct super_bloc
+@@ -437,6 +455,12 @@ static int jfs_remount(struct super_bloc
if (!parse_options(data, sb, &newLVSize, &flag))
return -EINVAL;
@@ -3983,39 +3599,34 @@ diff -NurpP --minimal linux-3.18.5/fs/jfs/super.c linux-3.18.5-vs2.3.7.3/fs/jfs/
if (newLVSize) {
pr_err("resize option for remount only\n");
-diff -NurpP --minimal linux-3.18.5/fs/libfs.c linux-3.18.5-vs2.3.7.3/fs/libfs.c
---- linux-3.18.5/fs/libfs.c 2015-02-05 18:02:45.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/libfs.c 2015-01-22 07:27:38.000000000 +0000
-@@ -146,13 +146,14 @@ static inline unsigned char dt_type(stru
+diff -NurpP --minimal linux-4.9.76/fs/libfs.c linux-4.9.76-vs2.3.9.5/fs/libfs.c
+--- linux-4.9.76/fs/libfs.c 2018-01-13 21:28:57.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/libfs.c 2018-01-13 01:03:09.000000000 +0000
+@@ -180,7 +180,8 @@ static inline unsigned char dt_type(stru
* both impossible due to the lock on directory.
*/
-int dcache_readdir(struct file *file, struct dir_context *ctx)
-+static inline int do_dcache_readdir_filter(struct file *filp,
++static inline int do_dcache_readdir_filter(struct file *file,
+ struct dir_context *ctx, int (*filter)(struct dentry *dentry))
{
-- struct dentry *dentry = file->f_path.dentry;
-- struct dentry *cursor = file->private_data;
-+ struct dentry *dentry = filp->f_path.dentry;
-+ struct dentry *cursor = filp->private_data;
- struct list_head *p, *q = &cursor->d_child;
-
-- if (!dir_emit_dots(file, ctx))
-+ if (!dir_emit_dots(filp, ctx))
- return 0;
- spin_lock(&dentry->d_lock);
+ struct dentry *dentry = file->f_path.dentry;
+ struct dentry *cursor = file->private_data;
+@@ -194,9 +195,10 @@ int dcache_readdir(struct file *file, st
if (ctx->pos == 2)
-@@ -160,6 +161,8 @@ int dcache_readdir(struct file *file, st
-
- for (p = q->next; p != &dentry->d_subdirs; p = p->next) {
- struct dentry *next = list_entry(p, struct dentry, d_child);
-+ if (filter && !filter(next))
-+ continue;
- spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED);
- if (!simple_positive(next)) {
- spin_unlock(&next->d_lock);
-@@ -182,8 +185,22 @@ int dcache_readdir(struct file *file, st
- spin_unlock(&dentry->d_lock);
+ p = &dentry->d_subdirs;
+ while ((next = next_positive(dentry, p, 1)) != NULL) {
+- if (!dir_emit(ctx, next->d_name.name, next->d_name.len,
++ if (!filter || filter(next))
++ if (!dir_emit(ctx, next->d_name.name, next->d_name.len,
+ d_inode(next)->i_ino, dt_type(d_inode(next))))
+- break;
++ break;
+ moved = true;
+ p = &next->d_child;
+ ctx->pos++;
+@@ -205,8 +207,22 @@ int dcache_readdir(struct file *file, st
+ move_cursor(cursor, p);
return 0;
}
+
@@ -4037,19 +3648,19 @@ diff -NurpP --minimal linux-3.18.5/fs/libfs.c linux-3.18.5-vs2.3.7.3/fs/libfs.c
ssize_t generic_read_dir(struct file *filp, char __user *buf, size_t siz, loff_t *ppos)
{
return -EISDIR;
-diff -NurpP --minimal linux-3.18.5/fs/locks.c linux-3.18.5-vs2.3.7.3/fs/locks.c
---- linux-3.18.5/fs/locks.c 2015-02-05 18:02:45.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/locks.c 2015-01-28 11:48:02.000000000 +0000
-@@ -129,6 +129,8 @@
+diff -NurpP --minimal linux-4.9.76/fs/locks.c linux-4.9.76-vs2.3.9.5/fs/locks.c
+--- linux-4.9.76/fs/locks.c 2016-12-11 19:17:54.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/locks.c 2018-01-13 01:28:30.000000000 +0000
+@@ -127,6 +127,8 @@
+ #include <linux/pid_namespace.h>
#include <linux/hashtable.h>
#include <linux/percpu.h>
- #include <linux/lglock.h>
+#include <linux/vs_base.h>
+#include <linux/vs_limit.h>
#define CREATE_TRACE_POINTS
#include <trace/events/filelock.h>
-@@ -214,11 +216,17 @@ static void locks_init_lock_heads(struct
+@@ -292,11 +294,15 @@ static void locks_init_lock_heads(struct
/* Allocate an empty lock structure. */
struct file_lock *locks_alloc_lock(void)
{
@@ -4058,27 +3669,17 @@ diff -NurpP --minimal linux-3.18.5/fs/locks.c linux-3.18.5-vs2.3.7.3/fs/locks.c
- if (fl)
- locks_init_lock_heads(fl);
-+ if (!vx_locks_avail(1))
-+ return NULL;
-
+ fl = kmem_cache_zalloc(filelock_cache, GFP_KERNEL);
-+
+
+ if (fl) {
+ locks_init_lock_heads(fl);
++ vx_locks_inc(fl);
+ fl->fl_xid = -1;
+ }
return fl;
}
EXPORT_SYMBOL_GPL(locks_alloc_lock);
-@@ -246,6 +254,7 @@ void locks_free_lock(struct file_lock *f
- BUG_ON(!list_empty(&fl->fl_block));
- BUG_ON(!hlist_unhashed(&fl->fl_link));
-
-+ vx_locks_dec(fl);
- locks_release_private(fl);
- kmem_cache_free(filelock_cache, fl);
- }
-@@ -267,6 +276,7 @@ void locks_init_lock(struct file_lock *f
+@@ -348,6 +354,7 @@ void locks_init_lock(struct file_lock *f
{
memset(fl, 0, sizeof(struct file_lock));
locks_init_lock_heads(fl);
@@ -4086,7 +3687,7 @@ diff -NurpP --minimal linux-3.18.5/fs/locks.c linux-3.18.5-vs2.3.7.3/fs/locks.c
}
EXPORT_SYMBOL(locks_init_lock);
-@@ -284,6 +294,7 @@ void locks_copy_conflock(struct file_loc
+@@ -365,6 +372,7 @@ void locks_copy_conflock(struct file_loc
new->fl_start = fl->fl_start;
new->fl_end = fl->fl_end;
new->fl_lmops = fl->fl_lmops;
@@ -4094,19 +3695,19 @@ diff -NurpP --minimal linux-3.18.5/fs/locks.c linux-3.18.5-vs2.3.7.3/fs/locks.c
new->fl_ops = NULL;
if (fl->fl_lmops) {
-@@ -345,6 +356,11 @@ flock_make_lock(struct file *filp, unsig
+@@ -426,7 +434,10 @@ flock_make_lock(struct file *filp, unsig
fl->fl_flags = FL_FLOCK;
fl->fl_type = type;
fl->fl_end = OFFSET_MAX;
+-
+
+ vxd_assert(filp->f_xid == vx_current_xid(),
+ "f_xid(%d) == current(%d)", filp->f_xid, vx_current_xid());
+ fl->fl_xid = filp->f_xid;
-+ vx_locks_inc(fl);
-
return fl;
}
-@@ -467,6 +483,7 @@ static int lease_init(struct file *filp,
+
+@@ -548,6 +559,7 @@ static int lease_init(struct file *filp,
fl->fl_owner = filp;
fl->fl_pid = current->tgid;
@@ -4114,7 +3715,7 @@ diff -NurpP --minimal linux-3.18.5/fs/locks.c linux-3.18.5-vs2.3.7.3/fs/locks.c
fl->fl_file = filp;
fl->fl_flags = FL_LEASE;
-@@ -486,6 +503,11 @@ static struct file_lock *lease_alloc(str
+@@ -567,6 +579,10 @@ static struct file_lock *lease_alloc(str
if (fl == NULL)
return ERR_PTR(error);
@@ -4122,118 +3723,108 @@ diff -NurpP --minimal linux-3.18.5/fs/locks.c linux-3.18.5-vs2.3.7.3/fs/locks.c
+ if (filp)
+ vxd_assert(filp->f_xid == fl->fl_xid,
+ "f_xid(%d) == fl_xid(%d)", filp->f_xid, fl->fl_xid);
-+ vx_locks_inc(fl);
error = lease_init(filp, type, fl);
if (error) {
locks_free_lock(fl);
-@@ -892,6 +914,7 @@ static int flock_lock_file(struct file *
- spin_lock(&inode->i_lock);
+@@ -956,6 +972,7 @@ static int flock_lock_inode(struct inode
+ goto out;
}
+ new_fl->fl_xid = -1;
find_conflict:
- for_each_lock(inode, before) {
- struct file_lock *fl = *before;
-@@ -912,6 +935,7 @@ find_conflict:
- goto out;
- locks_copy_lock(new_fl, request);
- locks_insert_lock(before, new_fl);
-+ vx_locks_inc(new_fl);
- new_fl = NULL;
- error = 0;
-
-@@ -923,7 +947,8 @@ out:
- return error;
+ list_for_each_entry(fl, &ctx->flc_flock, fl_list) {
+ if (!flock_locks_conflict(request, fl))
+@@ -984,7 +1001,7 @@ out:
}
--static int __posix_lock_file(struct inode *inode, struct file_lock *request, struct file_lock *conflock)
-+static int __posix_lock_file(struct inode *inode, struct file_lock *request,
-+ struct file_lock *conflock, vxid_t xid)
+ static int posix_lock_inode(struct inode *inode, struct file_lock *request,
+- struct file_lock *conflock)
++ struct file_lock *conflock, vxid_t xid)
{
- struct file_lock *fl;
+ struct file_lock *fl, *tmp;
struct file_lock *new_fl = NULL;
-@@ -935,6 +960,8 @@ static int __posix_lock_file(struct inod
- bool added = false;
- LIST_HEAD(dispose);
+@@ -1000,6 +1017,9 @@ static int posix_lock_inode(struct inode
+ if (!ctx)
+ return (request->fl_type == F_UNLCK) ? 0 : -ENOMEM;
-+ vxd_assert(xid == vx_current_xid(),
-+ "xid(%d) == current(%d)", xid, vx_current_xid());
++ if (xid)
++ vxd_assert(xid == vx_current_xid(),
++ "xid(%d) == current(%d)", xid, vx_current_xid());
/*
* We may need two file_lock structures for this operation,
* so we get them in advance to avoid races.
-@@ -945,7 +972,11 @@ static int __posix_lock_file(struct inod
+@@ -1010,7 +1030,11 @@ static int posix_lock_inode(struct inode
(request->fl_type != F_UNLCK ||
request->fl_start != 0 || request->fl_end != OFFSET_MAX)) {
new_fl = locks_alloc_lock();
+ new_fl->fl_xid = xid;
-+ vx_locks_inc(new_fl);
++ // vx_locks_inc(new_fl);
new_fl2 = locks_alloc_lock();
+ new_fl2->fl_xid = xid;
-+ vx_locks_inc(new_fl2);
++ // vx_locks_inc(new_fl2);
}
- spin_lock(&inode->i_lock);
-@@ -1158,7 +1189,8 @@ static int __posix_lock_file(struct inod
+ percpu_down_read_preempt_disable(&file_rwsem);
+@@ -1216,7 +1240,7 @@ static int posix_lock_inode(struct inode
int posix_lock_file(struct file *filp, struct file_lock *fl,
struct file_lock *conflock)
{
-- return __posix_lock_file(file_inode(filp), fl, conflock);
-+ return __posix_lock_file(file_inode(filp),
-+ fl, conflock, filp->f_xid);
+- return posix_lock_inode(locks_inode(filp), fl, conflock);
++ return posix_lock_inode(locks_inode(filp), fl, conflock, filp->f_xid);
}
EXPORT_SYMBOL(posix_lock_file);
-@@ -1252,7 +1284,7 @@ int locks_mandatory_area(int read_write,
+@@ -1232,7 +1256,7 @@ static int posix_lock_inode_wait(struct
+ int error;
+ might_sleep ();
+ for (;;) {
+- error = posix_lock_inode(inode, fl, NULL);
++ error = posix_lock_inode(inode, fl, NULL, 0);
+ if (error != FILE_LOCK_DEFERRED)
+ break;
+ error = wait_event_interruptible(fl->fl_wait, !fl->fl_next);
+@@ -1308,10 +1332,13 @@ int locks_mandatory_area(struct inode *i
+ fl.fl_end = end;
+
+ for (;;) {
++ vxid_t f_xid = 0;
++
if (filp) {
fl.fl_owner = filp;
fl.fl_flags &= ~FL_SLEEP;
-- error = __posix_lock_file(inode, &fl, NULL);
-+ error = __posix_lock_file(inode, &fl, NULL, filp->f_xid);
+- error = posix_lock_inode(inode, &fl, NULL);
++ f_xid = filp->f_xid;
++ error = posix_lock_inode(inode, &fl, NULL, f_xid);
if (!error)
break;
}
-@@ -1260,7 +1292,7 @@ int locks_mandatory_area(int read_write,
+@@ -1319,7 +1346,7 @@ int locks_mandatory_area(struct inode *i
if (sleep)
fl.fl_flags |= FL_SLEEP;
fl.fl_owner = current->files;
-- error = __posix_lock_file(inode, &fl, NULL);
-+ error = __posix_lock_file(inode, &fl, NULL, filp->f_xid);
+- error = posix_lock_inode(inode, &fl, NULL);
++ error = posix_lock_inode(inode, &fl, NULL, f_xid);
if (error != FILE_LOCK_DEFERRED)
break;
error = wait_event_interruptible(fl.fl_wait, !fl.fl_next);
-@@ -1655,6 +1687,7 @@ generic_add_lease(struct file *filp, lon
- goto out;
-
- locks_insert_lock(before, lease);
-+ vx_locks_inc(lease);
- /*
- * The check in break_lease() is lockless. It's possible for another
- * open to race in after we did the earlier check for a conflicting
-@@ -2110,6 +2143,11 @@ int fcntl_setlk(unsigned int fd, struct
+@@ -2374,6 +2401,16 @@ int fcntl_setlk64(unsigned int fd, struc
if (file_lock == NULL)
return -ENOLCK;
+ vxd_assert(filp->f_xid == vx_current_xid(),
+ "f_xid(%d) == current(%d)", filp->f_xid, vx_current_xid());
+ file_lock->fl_xid = filp->f_xid;
-+ vx_locks_inc(file_lock);
++ // vx_locks_inc(file_lock);
+
- /*
- * This might block, so we do it before checking the inode.
- */
-@@ -2250,6 +2288,11 @@ int fcntl_setlk64(unsigned int fd, struc
- if (file_lock == NULL)
- return -ENOLCK;
-
+ vxd_assert(filp->f_xid == vx_current_xid(),
+ "f_xid(%d) == current(%d)", filp->f_xid, vx_current_xid());
+ file_lock->fl_xid = filp->f_xid;
-+ vx_locks_inc(file_lock);
++ // vx_locks_inc(file_lock);
+
/*
* This might block, so we do it before checking the inode.
*/
-@@ -2557,8 +2600,11 @@ static int locks_show(struct seq_file *f
+@@ -2710,8 +2747,11 @@ static int locks_show(struct seq_file *f
lock_get_status(f, fl, iter->li_pos, "");
@@ -4246,24 +3837,24 @@ diff -NurpP --minimal linux-3.18.5/fs/locks.c linux-3.18.5-vs2.3.7.3/fs/locks.c
return 0;
}
-diff -NurpP --minimal linux-3.18.5/fs/mount.h linux-3.18.5-vs2.3.7.3/fs/mount.h
---- linux-3.18.5/fs/mount.h 2015-01-17 02:40:19.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/mount.h 2015-01-19 10:58:03.000000000 +0000
-@@ -62,6 +62,7 @@ struct mount {
- int mnt_expiry_mark; /* true if marked for expiry */
+diff -NurpP --minimal linux-4.9.76/fs/mount.h linux-4.9.76-vs2.3.9.5/fs/mount.h
+--- linux-4.9.76/fs/mount.h 2018-01-13 21:28:57.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/mount.h 2018-01-10 02:50:49.000000000 +0000
+@@ -69,6 +69,7 @@ struct mount {
struct hlist_head mnt_pins;
- struct path mnt_ex_mountpoint;
+ struct fs_pin mnt_umount;
+ struct dentry *mnt_ex_mountpoint;
+ vtag_t mnt_tag; /* tagging used for vfsmount */
};
#define MNT_NS_INTERNAL ERR_PTR(-EINVAL) /* distinct from any mnt_namespace */
-diff -NurpP --minimal linux-3.18.5/fs/namei.c linux-3.18.5-vs2.3.7.3/fs/namei.c
---- linux-3.18.5/fs/namei.c 2015-01-17 02:40:19.000000000 +0000
-+++ linux-3.18.5-vs2.3.7.3/fs/namei.c 2015-01-22 08:31:30.000000000 +0000
-@@ -34,10 +34,20 @@
- #include <linux/device_cgroup.h>
- #include <linux/fs_struct.h>
- #include <linux/posix_acl.h>
+diff -NurpP --minimal linux-4.9.76/fs/namei.c linux-4.9.76-vs2.3.9.5/fs/namei.c
+--- linux-4.9.76/fs/namei.c 2018-01-13 21:28:57.000000000 +0000
++++ linux-4.9.76-vs2.3.9.5/fs/namei.c 2018-01-13 05:43:43.000000000 +0000
+@@ -37,9 +37,19 @@
+ #include <linux/hash.h>
+ #include <linux/bitops.h>
+ #include <linux/init_task.h>
+#include <linux/proc_fs.h>
+#include <linux/magic.h>
+#include <linux/vserver/inode.h>
@@ -4273,7 +3864,6 @@ diff -NurpP --minimal linux-3.18.5/fs/namei.c linux-3.18.5-vs2.3.7.3/fs/namei.c
+#include <linux/vs_device.h>
+#include <linux/vs_context.h>
+#include <linux/pid_namespace.h>
- #include <linux/hash.h>
#include <asm/uaccess.h>
#include "internal.h"
@@ -4281,7 +3871,7 @@ diff -NurpP --minimal linux-3.18.5/fs/namei.c linux-3.18.5-vs2.3.7.3/fs/namei.c
#include "mount.h"
/* [Feb-1997 T. Schoebel-Theuer]
-@@ -278,6 +288,93 @@ static int check_acl(struct inode *inode
+@@ -285,6 +295,93 @@ static int check_acl(struct inode *inode
return -EAGAIN;
}
@@ -4375,12 +3965,16 @@ diff -NurpP --minimal linux-3.18.5/fs/namei.c linux-3.18.5-vs2.3.7.3/fs/namei.c
/*
* This does the basic permission checking
*/
-@@ -402,10 +499,14 @@ int __inode_permission(struct inode *ino
+@@ -409,7 +506,7 @@ int __inode_permission(struct inode *ino
/*
* Nobody gets write access to an immutable file.
*/
- if (IS_IMMUTABLE(inode))
+ if (IS_IMMUTABLE(inode) && !IS_COW(inode))
+ return -EPERM;
+
+ /*
+@@ -421,6 +518,10 @@ int __inode_permission(struct inode *ino
return -EACCES;
}
@@ -4391,35 +3985,16 @@ diff -NurpP --minimal linux-3.18.5/fs/namei.c linux-3.18.5-vs2.3.7.3/fs/namei.c
retval = do_inode_permission(inode, mask);
if (retval)
return retval;
-@@ -1416,6 +1517,9 @@ static int lookup_fast(struct nameidata
- goto unlazy;
- }
- }
-+
-+ /* FIXME: check dx permission */
-+
- path->mnt = mnt;
- path->dentry = dentry;
- if (likely(__follow_mount_rcu(nd, path, inode)))
-@@ -1442,6 +1546,8 @@ unlazy:
- goto need_lookup;
- }
-
-+ /* FIXME: check dx permission */
-+
- path->mnt = mnt;
- path->dentry = dentry;
- err = follow_managed(path, nd->flags);
-@@ -2434,7 +2540,7 @@ static int may_delete(struct inode *dir,
+@@ -2781,7 +2882,7 @@ static int may_delete(struct inode *dir,
return -EPERM;
if (check_sticky(dir, inode) || IS_APPEND(inode) ||
-- IS_IMMUTABLE(inode) || IS_SWAPFILE(inode))
-+ IS_IXORUNLINK(inode) || IS_SWAPFILE(inode))
+- IS_IMMUTABLE(inode) || IS_SWAPFILE(inode) || HAS_UNMAPPED_ID(inode))
++ IS_IXORUNLINK(inode) || IS_SWAPFILE(inode) || HAS_UNMAPPED_ID(inode))
return -EPERM;
if (isdir) {
if (!d_is_dir(victim))
-@@ -2516,19 +2622,25 @@ int vfs_create(struct inode *dir, struct
+@@ -2869,19 +2970,25 @@ int vfs_create(struct inode *dir, struct
bool want_excl)
{
int error = may_create(dir, dentry);
@@ -4447,7 +4022,7 @@ diff -NurpP --minimal linux-3.18.5/fs/namei.c linux-3.18.5-vs2.3.7.3/fs/namei.c
return error;
}
EXPORT_SYMBOL(vfs_create);
-@@ -2564,6 +2676,15 @@ static int may_open(struct path *path, i
+@@ -2919,6 +3026,15 @@ static int may_open(struct path *path, i
break;
}
@@ -4460,17 +4035,17 @@ diff -NurpP --minimal linux-3.18.5/fs/namei.c linux-3.18.5-vs2.3.7.3/fs/namei.c
+ mark_inode_dirty(inode);
+ }
+#endif
- error = inode_permission(inode, acc_mode);
+ error = inode_permission(inode, MAY_OPEN | acc_mode);
if (error)
return error;
-@@ -3058,6 +3179,16 @@ finish_open:
+@@ -3371,6 +3487,16 @@ finish_open:
}
finish_open_created:
error = may_open(&nd->path, acc_mode, open_flag);
+#ifdef CONFIG_VSERVER_COWBL
+ if (error == -EMLINK) {
+ struct dentry *dentry;
-+ dentry = cow_break_link(name->name);
++ dentry = cow_break_link(nd->name->name);
+ if (IS_ERR(dentry))
+ error = PTR_ERR(dentry);
+ else
@@ -4479,37 +4054,35 @@ diff -NurpP --minimal linux-3.18.5/fs/namei.c linux-3.18.5-vs2.3.7.3/fs/namei.c
+#endif
if (error)
goto out;
-
-@@ -3187,6 +3318,7 @@ static struct file *path_openat(int dfd,
+ BUG_ON(*opened & FILE_OPENED); /* once it's opened, it's opened */
+@@ -3474,6 +3600,9 @@ static struct file *path_openat(struct n
int opened = 0;
int error;
++#ifdef CONFIG_VSERVER_COWBL
+restart:
++#endif
file = get_empty_filp();
if (IS_ERR(file))
return file;
-@@ -3228,6 +3360,16 @@ static struct file *path_openat(int dfd,
- error = do_last(nd, &path, file, op, &opened, pathname);
- put_link(nd, &link, cookie);
+@@ -3507,6 +3636,12 @@ static struct file *path_openat(struct n
+ }
}
-+
+ terminate_walk(nd);
+#ifdef CONFIG_VSERVER_COWBL
+ if (error == -EMLINK) {
-+ if (nd->root.mnt && !(nd->flags & LOOKUP_ROOT))
-+ path_put(&nd->root);
-+ if (base)
-+ fput(base);
++ // path_cleanup(nd);
+ goto restart;
+ }
+#endif
- out:
- if (nd->root.mnt && !(nd->flags & LOOKUP_ROOT))
- path_put(&nd->root);
-@@ -3343,6 +3485,11 @@ struct dentry *kern_path_create(int dfd,
+ out2:
+ if (!(opened & FILE_OPENED)) {
+ BUG_ON(!error);
+@@ -3627,6 +3762,11 @@ static struct dentry *filename_create(in
goto fail;
}
- *path = nd.path;
-+ vxdprintk(VXD_CBIT(misc, 3), "kern_path_create path.dentry = %p (%.*s), dentry = %p (%.*s), d_inode = %p",
+ putname(name);
++ vxdprintk(VXD_CBIT(misc, 3), "filename_create path.dentry = %p (%.*s), dentry = %p (%.*s), d_inode = %p",
+ path->dentry, path->dentry->d_name.len,
+ path->dentry->d_name.name, dentry,
+ dentry->d_name.len, dentry->d_name.name,
@@ -4517,23 +4090,55 @@ diff -NurpP --minimal linux-3.18.5/fs/namei.c linux-3.18.5-vs2.3.7.3/fs/namei.c
return dentry;
fail:
dput(dentry);
-@@ -3899,7 +4046,7 @@ int vfs_link(struct dentry *old_dentry,
+@@ -3745,6 +3885,7 @@ retry:
+ error = vfs_mknod(path.dentry->d_inode,dentry,mode,0);
+ break;
+ }
++
+ out:
+ done_path_create(&path, dentry);
+ if (retry_estale(error, lookup_flags)) {
+@@ -4166,7 +4307,7 @@ int vfs_link(struct dentry *old_dentry,
/*
* A link to an append-only or immutable file cannot be created.
*/
- if (IS_APPEND(inode) || IS_IMMUTABLE(inode))
+ if (IS_APPEND(inode) || IS_IXORUNLINK(inode))
return -EPERM;
- if (!dir->i_op->link)
- return -EPERM;
-@@ -4404,6 +4551,289 @@ int generic_readlink(struct dentry *dent
+ /*
+ * Updating the link count will likely cause i_uid and i_gid to
+@@ -4696,6 +4837,326 @@ const char *vfs_get_link(struct dentry *
}
- EXPORT_SYMBOL(generic_readlink);
+ EXPORT_SYMBOL(vfs_get_link);
+
+#ifdef CONFIG_VSERVER_COWBL
+
+static inline
++void dump_path(const char *name, struct path *path)
++{
++ vxdprintk(VXD_CBIT(misc, 3),
++ "%s: path=%p mnt=%p dentry=%p", name, path,
++ path ? path->mnt : NULL,
++ path ? path->dentry : NULL);
++
++ if (path && path->mnt)
++ vxdprintk(VXD_CBIT(misc, 3),
++ "%s: path mnt_sb=%p[#%d,#%d] mnt_root=%p[#%d]", name,
++ path->mnt->mnt_sb,
++ path->mnt->mnt_sb ? path->mnt->mnt_sb->s_count : -1,
++ path->mnt->mnt_sb ? atomic_read(&path->mnt->mnt_sb->s_active) : -1,
++ path->mnt->mnt_root,
++ path->mnt->mnt_root ? path->mnt->mnt_root->d_lockref.count : -1);
++
++ if (path && path->dentry)
++ vxdprintk(VXD_CBIT(misc, 3),
++ "%s: path dentry=%p[#%d]", name,
++ path->dentry,
++ path->dentry ? path->dentry->d_lockref.count : -1);
++}
++
++static inline
+long do_cow_splice(struct file *in, struct file *out, size_t len)
+{
+ loff_t ppos = 0;
@@ -4545,36 +4150,39 @@ diff -NurpP --minimal linux-3.18.5/fs/namei.c linux-3.18.5-vs2.3.7.3/fs/namei.c
+struct dentry *cow_break_link(const char *pathname)
+{
+ int ret, mode, pathlen, redo = 0, drop = 1;
-+ struct nameidata old_nd, dir_nd;
-+ struct path dir_path, *old_path, *new_path;
++ struct path old_path = {}, par_path = {}, dir_path = {}, *new_path = NULL;
+ struct dentry *dir, *old_dentry, *new_dentry = NULL;
+ struct file *old_file;
+ struct file *new_file;
<Skipped 9094 lines>
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/kernel.git/commitdiff/cc23e8532699ebdfc0c000d1fcba80df5ce5f232
More information about the pld-cvs-commit
mailing list