[kernel] r12064 - in dists/sid/linux-2.6/debian/patches: features/all/vserver series

Bastian Blank waldi at alioth.debian.org
Thu Aug 14 10:00:33 UTC 2008


Author: waldi
Date: Thu Aug 14 10:00:31 2008
New Revision: 12064

Log:
* debian/patches/features/all/vserver/gen-patch: Drop include/**/Kbuild.
* debian/patches/features/all/vserver/bindmount-dev.patch: Fix.
* debian/patches/features/all/vserver/vs2.3.0.34.11.patch: Remove.
* debian/patches/features/all/vserver/vs2.3.0.35.patch: Add.
* debian/patches/series/1-extra: Remove patches.
* debian/patches/series/3-extra: Add new patches.


Added:
   dists/sid/linux-2.6/debian/patches/features/all/vserver/vs2.3.0.35.patch   (contents, props changed)
      - copied, changed from r12046, /dists/sid/linux-2.6/debian/patches/features/all/vserver/vs2.3.0.34.11.patch
   dists/sid/linux-2.6/debian/patches/series/3-extra
Removed:
   dists/sid/linux-2.6/debian/patches/features/all/vserver/vs2.3.0.34.11.patch
Modified:
   dists/sid/linux-2.6/debian/patches/features/all/vserver/bindmount-dev.patch
   dists/sid/linux-2.6/debian/patches/features/all/vserver/gen-patch
   dists/sid/linux-2.6/debian/patches/series/1-extra

Modified: dists/sid/linux-2.6/debian/patches/features/all/vserver/bindmount-dev.patch
==============================================================================
--- dists/sid/linux-2.6/debian/patches/features/all/vserver/bindmount-dev.patch	(original)
+++ dists/sid/linux-2.6/debian/patches/features/all/vserver/bindmount-dev.patch	Thu Aug 14 10:00:31 2008
@@ -7,19 +7,19 @@
 +	if (!capable(CAP_SYS_ADMIN) && (old_nd.path.mnt->mnt_flags & MNT_NODEV))
 +		mnt_flags |= MNT_NODEV;
 +
- 	mnt->mnt_flags = mnt_flags;
- 	if (flags & MS_TAGID) {
- 		mnt->mnt_tag = tag;
+ 	err = graft_tree(mnt, &nd->path);
+ 	if (err) {
+ 		LIST_HEAD(umount_list);
 @@ -1030,6 +1033,9 @@ static int do_remount(struct nameidata *
- 	if (nd->dentry != nd->mnt->mnt_root)
+ 	if (nd->path.dentry != nd->path.mnt->mnt_root)
  		return -EINVAL;
  
 +	if (!capable(CAP_SYS_ADMIN))
 +		mnt_flags |= MNT_NODEV;
 +
  	down_write(&sb->s_umount);
- 	err = do_remount_sb(sb, flags, data, 0);
- 	if (!err)
+ 	if (flags & MS_BIND)
+ 		err = change_mount_flags(nd->path.mnt, flags);
 @@ -1138,6 +1144,9 @@ static int do_new_mount(struct nameidata
  	if (!vx_capable(CAP_SYS_ADMIN, VXC_SECURE_MOUNT))
  		return -EPERM;
@@ -31,8 +31,8 @@
  	if (IS_ERR(mnt))
  		return PTR_ERR(mnt);
 @@ -1489,8 +1498,6 @@ long do_mount(char *dev_name, char *dir_
- 	if (flags & MS_RELATIME)
- 		mnt_flags |= MNT_RELATIME;
+ 	if (flags & MS_RDONLY)
+ 		mnt_flags |= MNT_READONLY;
  
 -	if (!capable(CAP_SYS_ADMIN))
 -		mnt_flags |= MNT_NODEV;

Modified: dists/sid/linux-2.6/debian/patches/features/all/vserver/gen-patch
==============================================================================
--- dists/sid/linux-2.6/debian/patches/features/all/vserver/gen-patch	(original)
+++ dists/sid/linux-2.6/debian/patches/features/all/vserver/gen-patch	Thu Aug 14 10:00:31 2008
@@ -11,4 +11,4 @@
 
 file="$(dirname $0)/$version.patch"
 
-filterdiff -p 1 --strip 1 --addprefix=a/ -x Makefile "$patch" | grep -v "^diff" > "$file"
+filterdiff -p 1 --strip 1 --addprefix=a/ -x Makefile -x include/linux/Kbuild -x include/linux/vserver/Kbuild "$patch" | grep -v "^diff" > "$file"

Copied: dists/sid/linux-2.6/debian/patches/features/all/vserver/vs2.3.0.35.patch (from r12046, /dists/sid/linux-2.6/debian/patches/features/all/vserver/vs2.3.0.34.11.patch)
==============================================================================
--- /dists/sid/linux-2.6/debian/patches/features/all/vserver/vs2.3.0.34.11.patch	(original)
+++ dists/sid/linux-2.6/debian/patches/features/all/vserver/vs2.3.0.35.patch	Thu Aug 14 10:00:31 2008
@@ -1,5 +1,5 @@
 --- a/arch/alpha/Kconfig	2008-04-17 12:05:26.000000000 -0400
-+++ a/arch/alpha/Kconfig	2008-04-19 15:14:51.000000000 -0400
++++ a/arch/alpha/Kconfig	2008-07-16 22:41:36.000000000 -0400
 @@ -671,6 +671,8 @@ config DUMMY_CONSOLE
  	depends on VGA_HOSE
  	default y
@@ -10,7 +10,7 @@
  
  source "crypto/Kconfig"
 --- a/arch/alpha/kernel/entry.S	2008-04-17 11:31:21.000000000 -0400
-+++ a/arch/alpha/kernel/entry.S	2008-04-21 11:09:01.000000000 -0400
++++ a/arch/alpha/kernel/entry.S	2008-07-16 22:41:36.000000000 -0400
 @@ -872,24 +872,15 @@ sys_getxgid:
  	.globl	sys_getxpid
  	.ent	sys_getxpid
@@ -43,8 +43,8 @@
  	ret
  .end sys_getxpid
  
---- a/arch/alpha/kernel/osf_sys.c	2008-05-21 14:30:05.000000000 -0400
-+++ a/arch/alpha/kernel/osf_sys.c	2008-05-21 14:30:40.000000000 -0400
+--- a/arch/alpha/kernel/osf_sys.c	2008-07-14 17:22:23.000000000 -0400
++++ a/arch/alpha/kernel/osf_sys.c	2008-07-16 22:41:36.000000000 -0400
 @@ -883,7 +883,7 @@ osf_gettimeofday(struct timeval32 __user
  {
  	if (tv) {
@@ -55,7 +55,7 @@
  			return -EFAULT;
  	}
 --- a/arch/alpha/kernel/ptrace.c	2008-04-17 11:31:21.000000000 -0400
-+++ a/arch/alpha/kernel/ptrace.c	2008-04-19 15:14:51.000000000 -0400
++++ a/arch/alpha/kernel/ptrace.c	2008-07-16 22:41:36.000000000 -0400
 @@ -15,6 +15,7 @@
  #include <linux/slab.h>
  #include <linux/security.h>
@@ -64,43 +64,8 @@
  
  #include <asm/uaccess.h>
  #include <asm/pgtable.h>
---- a/arch/alpha/kernel/semaphore.c	2008-04-17 11:31:21.000000000 -0400
-+++ a/arch/alpha/kernel/semaphore.c	2008-04-19 15:14:51.000000000 -0400
-@@ -68,8 +68,8 @@ __down_failed(struct semaphore *sem)
- 	DECLARE_WAITQUEUE(wait, tsk);
- 
- #ifdef CONFIG_DEBUG_SEMAPHORE
--	printk("%s(%d): down failed(%p)\n",
--	       tsk->comm, task_pid_nr(tsk), sem);
-+	printk("%s(%d:#%u): down failed(%p)\n",
-+	       tsk->comm, task_pid_nr(tsk), tsk->xid, sem);
- #endif
- 
- 	tsk->state = TASK_UNINTERRUPTIBLE;
-@@ -97,8 +97,8 @@ __down_failed(struct semaphore *sem)
- 	wake_up(&sem->wait);
- 
- #ifdef CONFIG_DEBUG_SEMAPHORE
--	printk("%s(%d): down acquired(%p)\n",
--	       tsk->comm, task_pid_nr(tsk), sem);
-+	printk("%s(%d:#%u): down acquired(%p)\n",
-+	       tsk->comm, task_pid_nr(tsk), tsk->xid, sem);
- #endif
- }
- 
-@@ -110,8 +110,8 @@ __down_failed_interruptible(struct semap
- 	long ret = 0;
- 
- #ifdef CONFIG_DEBUG_SEMAPHORE
--	printk("%s(%d): down failed(%p)\n",
--	       tsk->comm, task_pid_nr(tsk), sem);
-+	printk("%s(%d:#%u): down failed(%p)\n",
-+	       tsk->comm, task_pid_nr(tsk), tsk->xid, sem);
- #endif
- 
- 	tsk->state = TASK_INTERRUPTIBLE;
 --- a/arch/alpha/kernel/systbls.S	2008-04-17 12:05:26.000000000 -0400
-+++ a/arch/alpha/kernel/systbls.S	2008-04-19 15:14:51.000000000 -0400
++++ a/arch/alpha/kernel/systbls.S	2008-07-16 22:41:36.000000000 -0400
 @@ -446,7 +446,7 @@ sys_call_table:
  	.quad sys_stat64			/* 425 */
  	.quad sys_lstat64
@@ -110,9 +75,9 @@
  	.quad sys_ni_syscall			/* sys_mbind */
  	.quad sys_ni_syscall			/* sys_get_mempolicy */
  	.quad sys_ni_syscall			/* sys_set_mempolicy */
---- a/arch/alpha/kernel/traps.c	2008-04-17 11:31:21.000000000 -0400
-+++ a/arch/alpha/kernel/traps.c	2008-04-19 15:14:51.000000000 -0400
-@@ -182,7 +182,8 @@ die_if_kernel(char * str, struct pt_regs
+--- a/arch/alpha/kernel/traps.c	2008-07-14 17:22:23.000000000 -0400
++++ a/arch/alpha/kernel/traps.c	2008-07-16 22:41:36.000000000 -0400
+@@ -183,7 +183,8 @@ die_if_kernel(char * str, struct pt_regs
  #ifdef CONFIG_SMP
  	printk("CPU %d ", hard_smp_processor_id());
  #endif
@@ -123,7 +88,7 @@
  	add_taint(TAINT_DIE);
  	dik_show_trace((unsigned long *)(regs+1));
 --- a/arch/alpha/mm/fault.c	2008-04-17 11:31:21.000000000 -0400
-+++ a/arch/alpha/mm/fault.c	2008-04-19 15:14:51.000000000 -0400
++++ a/arch/alpha/mm/fault.c	2008-07-16 22:41:36.000000000 -0400
 @@ -193,8 +193,8 @@ do_page_fault(unsigned long address, uns
  		down_read(&mm->mmap_sem);
  		goto survive;
@@ -135,9 +100,9 @@
  	if (!user_mode(regs))
  		goto no_context;
  	do_group_exit(SIGKILL);
---- a/arch/arm/Kconfig	2008-04-17 12:05:26.000000000 -0400
-+++ a/arch/arm/Kconfig	2008-04-19 15:14:51.000000000 -0400
-@@ -1180,6 +1180,8 @@ source "fs/Kconfig"
+--- a/arch/arm/Kconfig	2008-07-14 17:22:23.000000000 -0400
++++ a/arch/arm/Kconfig	2008-07-16 22:41:36.000000000 -0400
+@@ -1187,6 +1187,8 @@ source "fs/Kconfig"
  
  source "arch/arm/Kconfig.debug"
  
@@ -146,8 +111,8 @@
  source "security/Kconfig"
  
  source "crypto/Kconfig"
---- a/arch/arm/kernel/calls.S	2008-04-17 12:05:26.000000000 -0400
-+++ a/arch/arm/kernel/calls.S	2008-04-19 15:14:51.000000000 -0400
+--- a/arch/arm/kernel/calls.S	2008-07-14 17:22:23.000000000 -0400
++++ a/arch/arm/kernel/calls.S	2008-07-16 22:41:36.000000000 -0400
 @@ -322,7 +322,7 @@
  /* 310 */	CALL(sys_request_key)
  		CALL(sys_keyctl)
@@ -158,7 +123,7 @@
  /* 315 */	CALL(sys_ioprio_get)
  		CALL(sys_inotify_init)
 --- a/arch/arm/kernel/process.c	2008-04-17 12:05:26.000000000 -0400
-+++ a/arch/arm/kernel/process.c	2008-04-21 11:09:01.000000000 -0400
++++ a/arch/arm/kernel/process.c	2008-07-16 22:41:36.000000000 -0400
 @@ -264,7 +264,8 @@ void __show_regs(struct pt_regs *regs)
  void show_regs(struct pt_regs * regs)
  {
@@ -170,7 +135,7 @@
  	__backtrace();
  }
 --- a/arch/arm/kernel/traps.c	2008-04-17 12:05:26.000000000 -0400
-+++ a/arch/arm/kernel/traps.c	2008-04-19 15:14:51.000000000 -0400
++++ a/arch/arm/kernel/traps.c	2008-07-16 22:41:36.000000000 -0400
 @@ -214,8 +214,8 @@ static void __die(const char *str, int e
  	       str, err, ++die_counter);
  	print_modules();
@@ -183,7 +148,7 @@
  	if (!user_mode(regs) || in_interrupt()) {
  		dump_mem("Stack: ", regs->ARM_sp,
 --- a/arch/arm/mm/fault.c	2008-04-17 12:05:27.000000000 -0400
-+++ a/arch/arm/mm/fault.c	2008-04-19 15:14:51.000000000 -0400
++++ a/arch/arm/mm/fault.c	2008-07-16 22:41:36.000000000 -0400
 @@ -292,7 +292,8 @@ do_page_fault(unsigned long addr, unsign
  		 * happened to us that made us unable to handle
  		 * the page fault gracefully.
@@ -195,7 +160,7 @@
  		return 0;
  	}
 --- a/arch/cris/Kconfig	2008-04-17 12:05:27.000000000 -0400
-+++ a/arch/cris/Kconfig	2008-04-19 15:14:51.000000000 -0400
++++ a/arch/cris/Kconfig	2008-07-16 22:41:36.000000000 -0400
 @@ -679,6 +679,8 @@ source "drivers/usb/Kconfig"
  
  source "arch/cris/Kconfig.debug"
@@ -206,7 +171,7 @@
  
  source "crypto/Kconfig"
 --- a/arch/frv/kernel/kernel_thread.S	2007-02-04 13:44:54.000000000 -0500
-+++ a/arch/frv/kernel/kernel_thread.S	2008-04-21 11:09:01.000000000 -0400
++++ a/arch/frv/kernel/kernel_thread.S	2008-07-16 22:41:36.000000000 -0400
 @@ -37,7 +37,7 @@ kernel_thread:
  
  	# start by forking the current process, but with shared VM
@@ -217,7 +182,7 @@
  	setlo		#0xe4e4,gr9
  	setlos.p	#0,gr10			; third syscall arg	[parent_tidptr]
 --- a/arch/h8300/Kconfig	2008-04-17 12:05:28.000000000 -0400
-+++ a/arch/h8300/Kconfig	2008-04-19 15:14:51.000000000 -0400
++++ a/arch/h8300/Kconfig	2008-07-16 22:41:36.000000000 -0400
 @@ -233,6 +233,8 @@ source "fs/Kconfig"
  
  source "arch/h8300/Kconfig.debug"
@@ -228,7 +193,7 @@
  
  source "crypto/Kconfig"
 --- a/arch/ia64/ia32/ia32_entry.S	2008-04-17 10:37:14.000000000 -0400
-+++ a/arch/ia64/ia32/ia32_entry.S	2008-04-19 15:14:51.000000000 -0400
++++ a/arch/ia64/ia32/ia32_entry.S	2008-07-16 22:41:36.000000000 -0400
 @@ -446,7 +446,7 @@ ia32_syscall_table:
   	data8 sys_tgkill	/* 270 */
   	data8 compat_sys_utimes
@@ -238,9 +203,9 @@
    	data8 sys_ni_syscall
   	data8 sys_ni_syscall	/* 275 */
    	data8 sys_ni_syscall
---- a/arch/ia64/ia32/sys_ia32.c	2008-04-17 12:05:28.000000000 -0400
-+++ a/arch/ia64/ia32/sys_ia32.c	2008-04-19 15:14:51.000000000 -0400
-@@ -1177,7 +1177,7 @@ sys32_gettimeofday (struct compat_timeva
+--- a/arch/ia64/ia32/sys_ia32.c	2008-07-14 17:22:26.000000000 -0400
++++ a/arch/ia64/ia32/sys_ia32.c	2008-07-16 22:41:36.000000000 -0400
+@@ -1178,7 +1178,7 @@ sys32_gettimeofday (struct compat_timeva
  {
  	if (tv) {
  		struct timeval ktv;
@@ -249,9 +214,9 @@
  		if (put_tv32(tv, &ktv))
  			return -EFAULT;
  	}
---- a/arch/ia64/Kconfig	2008-04-17 12:05:28.000000000 -0400
-+++ a/arch/ia64/Kconfig	2008-04-19 15:14:51.000000000 -0400
-@@ -615,6 +615,8 @@ source "arch/ia64/hp/sim/Kconfig"
+--- a/arch/ia64/Kconfig	2008-07-14 17:22:26.000000000 -0400
++++ a/arch/ia64/Kconfig	2008-07-16 22:41:36.000000000 -0400
+@@ -638,6 +638,8 @@ source "arch/ia64/hp/sim/Kconfig"
  
  source "arch/ia64/Kconfig.debug"
  
@@ -260,9 +225,9 @@
  source "security/Kconfig"
  
  source "crypto/Kconfig"
---- a/arch/ia64/kernel/entry.S	2008-04-17 12:05:28.000000000 -0400
-+++ a/arch/ia64/kernel/entry.S	2008-04-19 15:14:51.000000000 -0400
-@@ -1547,7 +1547,7 @@ sys_call_table:
+--- a/arch/ia64/kernel/entry.S	2008-07-14 17:22:26.000000000 -0400
++++ a/arch/ia64/kernel/entry.S	2008-07-16 22:41:36.000000000 -0400
+@@ -1619,7 +1619,7 @@ sys_call_table:
  	data8 sys_mq_notify
  	data8 sys_mq_getsetattr
  	data8 sys_kexec_load
@@ -271,8 +236,8 @@
  	data8 sys_waitid			// 1270
  	data8 sys_add_key
  	data8 sys_request_key
---- a/arch/ia64/kernel/perfmon.c	2008-04-17 12:05:28.000000000 -0400
-+++ a/arch/ia64/kernel/perfmon.c	2008-04-19 15:14:51.000000000 -0400
+--- a/arch/ia64/kernel/perfmon.c	2008-07-14 17:22:27.000000000 -0400
++++ a/arch/ia64/kernel/perfmon.c	2008-07-16 22:41:36.000000000 -0400
 @@ -40,6 +40,7 @@
  #include <linux/capability.h>
  #include <linux/rcupdate.h>
@@ -281,7 +246,7 @@
  
  #include <asm/errno.h>
  #include <asm/intrinsics.h>
-@@ -2374,7 +2375,7 @@ pfm_smpl_buffer_alloc(struct task_struct
+@@ -2376,7 +2377,7 @@ pfm_smpl_buffer_alloc(struct task_struct
  	 */
  	insert_vm_struct(mm, vma);
  
@@ -290,8 +255,8 @@
  	vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file,
  							vma_pages(vma));
  	up_write(&task->mm->mmap_sem);
---- a/arch/ia64/kernel/process.c	2008-04-17 12:05:28.000000000 -0400
-+++ a/arch/ia64/kernel/process.c	2008-04-21 11:09:01.000000000 -0400
+--- a/arch/ia64/kernel/process.c	2008-07-14 17:22:27.000000000 -0400
++++ a/arch/ia64/kernel/process.c	2008-07-16 22:41:36.000000000 -0400
 @@ -105,8 +105,8 @@ show_regs (struct pt_regs *regs)
  	unsigned long ip = regs->cr_iip + ia64_psr(regs)->ri;
  
@@ -303,18 +268,18 @@
  	printk("psr : %016lx ifs : %016lx ip  : [<%016lx>]    %s (%s)\n",
  	       regs->cr_ipsr, regs->cr_ifs, ip, print_tainted(),
  	       init_utsname()->release);
---- a/arch/ia64/kernel/ptrace.c	2008-04-17 12:05:28.000000000 -0400
-+++ a/arch/ia64/kernel/ptrace.c	2008-04-19 15:14:51.000000000 -0400
-@@ -17,6 +17,7 @@
- #include <linux/security.h>
- #include <linux/audit.h>
+--- a/arch/ia64/kernel/ptrace.c	2008-07-14 17:22:27.000000000 -0400
++++ a/arch/ia64/kernel/ptrace.c	2008-07-17 21:01:48.000000000 -0400
+@@ -22,6 +22,7 @@
  #include <linux/signal.h>
+ #include <linux/regset.h>
+ #include <linux/elf.h>
 +#include <linux/vs_base.h>
  
  #include <asm/pgtable.h>
  #include <asm/processor.h>
 --- a/arch/ia64/kernel/traps.c	2008-04-17 12:05:28.000000000 -0400
-+++ a/arch/ia64/kernel/traps.c	2008-04-21 10:33:04.000000000 -0400
++++ a/arch/ia64/kernel/traps.c	2008-07-16 22:41:36.000000000 -0400
 @@ -60,8 +60,9 @@ die (const char *str, struct pt_regs *re
  	put_cpu();
  
@@ -340,7 +305,7 @@
  		}
  	}
 --- a/arch/ia64/mm/fault.c	2008-04-17 12:05:28.000000000 -0400
-+++ a/arch/ia64/mm/fault.c	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/ia64/mm/fault.c	2008-07-16 22:41:36.000000000 -0400
 @@ -10,6 +10,7 @@
  #include <linux/interrupt.h>
  #include <linux/kprobes.h>
@@ -350,7 +315,7 @@
  #include <asm/pgtable.h>
  #include <asm/processor.h>
 --- a/arch/m32r/kernel/traps.c	2008-04-17 11:31:23.000000000 -0400
-+++ a/arch/m32r/kernel/traps.c	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/m32r/kernel/traps.c	2008-07-16 22:41:36.000000000 -0400
 @@ -195,8 +195,9 @@ static void show_registers(struct pt_reg
  	} else {
  		printk("SPI: %08lx\n", sp);
@@ -363,9 +328,9 @@
  
  	/*
  	 * When in-kernel, we also print out the stack and code at the
---- a/arch/m68k/Kconfig	2008-04-17 12:05:28.000000000 -0400
-+++ a/arch/m68k/Kconfig	2008-04-19 15:14:52.000000000 -0400
-@@ -674,6 +674,8 @@ source "fs/Kconfig"
+--- a/arch/m68k/Kconfig	2008-07-14 17:22:27.000000000 -0400
++++ a/arch/m68k/Kconfig	2008-07-16 22:41:36.000000000 -0400
+@@ -667,6 +667,8 @@ source "fs/Kconfig"
  
  source "arch/m68k/Kconfig.debug"
  
@@ -375,7 +340,7 @@
  
  source "crypto/Kconfig"
 --- a/arch/m68k/kernel/ptrace.c	2008-04-17 11:31:23.000000000 -0400
-+++ a/arch/m68k/kernel/ptrace.c	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/m68k/kernel/ptrace.c	2008-07-16 22:41:36.000000000 -0400
 @@ -18,6 +18,7 @@
  #include <linux/ptrace.h>
  #include <linux/user.h>
@@ -393,9 +358,9 @@
  
  	return ret;
  out_eio:
---- a/arch/m68k/kernel/traps.c	2008-04-17 12:05:28.000000000 -0400
-+++ a/arch/m68k/kernel/traps.c	2008-04-19 15:14:52.000000000 -0400
-@@ -898,8 +898,8 @@ void show_registers(struct pt_regs *regs
+--- a/arch/m68k/kernel/traps.c	2008-07-14 17:22:27.000000000 -0400
++++ a/arch/m68k/kernel/traps.c	2008-07-16 22:41:36.000000000 -0400
+@@ -909,8 +909,8 @@ void show_registers(struct pt_regs *regs
  	printk("d4: %08lx    d5: %08lx    a0: %08lx    a1: %08lx\n",
  	       regs->d4, regs->d5, regs->a0, regs->a1);
  
@@ -406,9 +371,9 @@
  	addr = (unsigned long)&fp->un;
  	printk("Frame format=%X ", regs->format);
  	switch (regs->format) {
---- a/arch/m68knommu/Kconfig	2008-04-17 12:05:28.000000000 -0400
-+++ a/arch/m68knommu/Kconfig	2008-04-19 15:14:52.000000000 -0400
-@@ -722,6 +722,8 @@ source "fs/Kconfig"
+--- a/arch/m68knommu/Kconfig	2008-07-14 17:22:27.000000000 -0400
++++ a/arch/m68knommu/Kconfig	2008-07-16 22:41:36.000000000 -0400
+@@ -725,6 +725,8 @@ source "fs/Kconfig"
  
  source "arch/m68knommu/Kconfig.debug"
  
@@ -417,9 +382,9 @@
  source "security/Kconfig"
  
  source "crypto/Kconfig"
---- a/arch/m68knommu/kernel/traps.c	2008-04-17 10:37:14.000000000 -0400
-+++ a/arch/m68knommu/kernel/traps.c	2008-04-19 15:14:52.000000000 -0400
-@@ -78,8 +78,9 @@ void die_if_kernel(char *str, struct pt_
+--- a/arch/m68knommu/kernel/traps.c	2008-07-14 17:22:27.000000000 -0400
++++ a/arch/m68knommu/kernel/traps.c	2008-07-16 22:41:36.000000000 -0400
+@@ -79,8 +79,9 @@ void die_if_kernel(char *str, struct pt_
  	printk(KERN_EMERG "d4: %08lx    d5: %08lx    a0: %08lx    a1: %08lx\n",
  	       fp->d4, fp->d5, fp->a0, fp->a1);
  
@@ -431,9 +396,9 @@
  	show_stack(NULL, (unsigned long *)(fp + 1));
  	add_taint(TAINT_DIE);
  	do_exit(SIGSEGV);
---- a/arch/mips/Kconfig	2008-04-17 12:05:28.000000000 -0400
-+++ a/arch/mips/Kconfig	2008-04-19 15:14:52.000000000 -0400
-@@ -2099,6 +2099,8 @@ source "fs/Kconfig"
+--- a/arch/mips/Kconfig	2008-07-14 17:22:27.000000000 -0400
++++ a/arch/mips/Kconfig	2008-07-16 22:41:36.000000000 -0400
+@@ -2131,6 +2131,8 @@ source "fs/Kconfig"
  
  source "arch/mips/Kconfig.debug"
  
@@ -443,7 +408,7 @@
  
  source "crypto/Kconfig"
 --- a/arch/mips/kernel/linux32.c	2008-04-17 12:05:29.000000000 -0400
-+++ a/arch/mips/kernel/linux32.c	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/mips/kernel/linux32.c	2008-07-16 22:41:36.000000000 -0400
 @@ -209,7 +209,7 @@ sys32_gettimeofday(struct compat_timeval
  {
  	if (tv) {
@@ -454,7 +419,7 @@
  			return -EFAULT;
  	}
 --- a/arch/mips/kernel/ptrace.c	2008-04-17 11:31:23.000000000 -0400
-+++ a/arch/mips/kernel/ptrace.c	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/mips/kernel/ptrace.c	2008-07-16 22:41:36.000000000 -0400
 @@ -25,6 +25,7 @@
  #include <linux/security.h>
  #include <linux/audit.h>
@@ -474,7 +439,7 @@
  	/* when I and D space are separate, these will need to be fixed. */
  	case PTRACE_PEEKTEXT: /* read word at location addr. */
 --- a/arch/mips/kernel/scall32-o32.S	2008-04-17 12:05:29.000000000 -0400
-+++ a/arch/mips/kernel/scall32-o32.S	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/mips/kernel/scall32-o32.S	2008-07-16 22:41:36.000000000 -0400
 @@ -619,7 +619,7 @@ einval:	li	v0, -EINVAL
  	sys	sys_mq_timedreceive	5
  	sys	sys_mq_notify		2	/* 4275 */
@@ -485,7 +450,7 @@
  	sys	sys_ni_syscall		0	/* available, was setaltroot */
  	sys	sys_add_key		5	/* 4280 */
 --- a/arch/mips/kernel/scall64-64.S	2008-04-17 12:05:29.000000000 -0400
-+++ a/arch/mips/kernel/scall64-64.S	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/mips/kernel/scall64-64.S	2008-07-16 22:41:36.000000000 -0400
 @@ -434,7 +434,7 @@ sys_call_table:
  	PTR	sys_mq_timedreceive
  	PTR	sys_mq_notify
@@ -496,7 +461,7 @@
  	PTR	sys_ni_syscall			/* available, was setaltroot */
  	PTR	sys_add_key
 --- a/arch/mips/kernel/scall64-n32.S	2008-04-17 12:05:29.000000000 -0400
-+++ a/arch/mips/kernel/scall64-n32.S	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/mips/kernel/scall64-n32.S	2008-07-16 22:41:36.000000000 -0400
 @@ -360,7 +360,7 @@ EXPORT(sysn32_call_table)
  	PTR	compat_sys_mq_timedreceive
  	PTR	compat_sys_mq_notify
@@ -507,7 +472,7 @@
  	PTR	sys_ni_syscall			/* available, was setaltroot */
  	PTR	sys_add_key
 --- a/arch/mips/kernel/scall64-o32.S	2008-04-17 12:05:29.000000000 -0400
-+++ a/arch/mips/kernel/scall64-o32.S	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/mips/kernel/scall64-o32.S	2008-07-16 22:41:36.000000000 -0400
 @@ -482,7 +482,7 @@ sys_call_table:
  	PTR	compat_sys_mq_timedreceive
  	PTR	compat_sys_mq_notify		/* 4275 */
@@ -517,22 +482,24 @@
  	PTR	sys32_waitid
  	PTR	sys_ni_syscall			/* available, was setaltroot */
  	PTR	sys_add_key			/* 4280 */
---- a/arch/mips/kernel/traps.c	2008-04-17 12:05:29.000000000 -0400
-+++ a/arch/mips/kernel/traps.c	2008-04-19 15:14:52.000000000 -0400
-@@ -313,8 +313,9 @@ void show_registers(const struct pt_regs
- {
+--- a/arch/mips/kernel/traps.c	2008-07-14 17:22:27.000000000 -0400
++++ a/arch/mips/kernel/traps.c	2008-07-17 21:08:35.000000000 -0400
+@@ -324,9 +324,10 @@ void show_registers(const struct pt_regs
+ 
  	__show_regs(regs);
  	print_modules();
--	printk("Process %s (pid: %d, threadinfo=%p, task=%p)\n",
--	        current->comm, task_pid_nr(current), current_thread_info(), current);
-+	printk("Process %s (pid: %d:#%u, threadinfo=%p, task=%p)\n",
+-	printk("Process %s (pid: %d, threadinfo=%p, task=%p, tls=%0*lx)\n",
+-	       current->comm, current->pid, current_thread_info(), current,
+-	      field, current_thread_info()->tp_value);
++	printk("Process %s (pid: %d:#%u, threadinfo=%p, task=%p, tls=%0*lx)\n",
 +		current->comm, task_pid_nr(current), current->xid,
-+		current_thread_info(), current);
- 	show_stacktrace(current, regs);
- 	show_code((unsigned int __user *) regs->cp0_epc);
- 	printk("\n");
++		current_thread_info(), current,
++		field, current_thread_info()->tp_value);
+ 	if (cpu_has_userlocal) {
+ 		unsigned long tls;
+ 
 --- a/arch/mips/mm/fault.c	2008-04-17 11:31:24.000000000 -0400
-+++ a/arch/mips/mm/fault.c	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/mips/mm/fault.c	2008-07-16 22:41:36.000000000 -0400
 @@ -178,7 +178,8 @@ out_of_memory:
  		down_read(&mm->mmap_sem);
  		goto survive;
@@ -544,7 +511,7 @@
  		do_group_exit(SIGKILL);
  	goto no_context;
 --- a/arch/parisc/Kconfig	2008-04-17 12:05:29.000000000 -0400
-+++ a/arch/parisc/Kconfig	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/parisc/Kconfig	2008-07-16 22:41:36.000000000 -0400
 @@ -278,6 +278,8 @@ source "fs/Kconfig"
  
  source "arch/parisc/Kconfig.debug"
@@ -555,7 +522,7 @@
  
  source "crypto/Kconfig"
 --- a/arch/parisc/kernel/syscall_table.S	2008-04-17 12:05:29.000000000 -0400
-+++ a/arch/parisc/kernel/syscall_table.S	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/parisc/kernel/syscall_table.S	2008-07-16 22:41:36.000000000 -0400
 @@ -361,7 +361,7 @@
  	ENTRY_COMP(mbind)		/* 260 */
  	ENTRY_COMP(get_mempolicy)
@@ -565,9 +532,9 @@
  	ENTRY_SAME(add_key)
  	ENTRY_SAME(request_key)		/* 265 */
  	ENTRY_SAME(keyctl)
---- a/arch/parisc/kernel/sys_parisc32.c	2008-04-17 11:31:24.000000000 -0400
-+++ a/arch/parisc/kernel/sys_parisc32.c	2008-04-19 15:14:52.000000000 -0400
-@@ -204,11 +204,11 @@ static inline long get_ts32(struct times
+--- a/arch/parisc/kernel/sys_parisc32.c	2008-07-14 17:22:28.000000000 -0400
++++ a/arch/parisc/kernel/sys_parisc32.c	2008-07-16 22:41:36.000000000 -0400
+@@ -203,11 +203,11 @@ static inline long get_ts32(struct times
  asmlinkage int
  sys32_gettimeofday(struct compat_timeval __user *tv, struct timezone __user *tz)
  {
@@ -581,8 +548,8 @@
  	    if (put_compat_timeval(tv, &ktv))
  		    return -EFAULT;
      }
---- a/arch/parisc/kernel/traps.c	2008-04-17 12:05:29.000000000 -0400
-+++ a/arch/parisc/kernel/traps.c	2008-04-19 15:14:52.000000000 -0400
+--- a/arch/parisc/kernel/traps.c	2008-07-14 17:22:28.000000000 -0400
++++ a/arch/parisc/kernel/traps.c	2008-07-16 22:41:36.000000000 -0400
 @@ -237,8 +237,9 @@ void die_if_kernel(char *str, struct pt_
  		if (err == 0)
  			return; /* STFU */
@@ -607,7 +574,7 @@
  	/* Wot's wrong wif bein' racy? */
  	if (current->thread.flags & PARISC_KERNEL_DEATH) {
 --- a/arch/parisc/mm/fault.c	2008-04-17 11:31:24.000000000 -0400
-+++ a/arch/parisc/mm/fault.c	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/parisc/mm/fault.c	2008-07-16 22:41:36.000000000 -0400
 @@ -210,8 +210,9 @@ bad_area:
  
  #ifdef PRINT_USER_FAULTS
@@ -630,9 +597,9 @@
  	if (user_mode(regs))
  		do_group_exit(SIGKILL);
  	goto no_context;
---- a/arch/powerpc/Kconfig	2008-04-17 12:05:29.000000000 -0400
-+++ a/arch/powerpc/Kconfig	2008-04-19 15:14:52.000000000 -0400
-@@ -706,6 +706,8 @@ source "lib/Kconfig"
+--- a/arch/powerpc/Kconfig	2008-07-14 17:22:28.000000000 -0400
++++ a/arch/powerpc/Kconfig	2008-07-16 22:41:36.000000000 -0400
+@@ -800,6 +800,8 @@ source "lib/Kconfig"
  
  source "arch/powerpc/Kconfig.debug"
  
@@ -641,8 +608,8 @@
  source "security/Kconfig"
  
  config KEYS_COMPAT
---- a/arch/powerpc/kernel/irq.c	2008-04-17 12:05:29.000000000 -0400
-+++ a/arch/powerpc/kernel/irq.c	2008-04-19 15:14:52.000000000 -0400
+--- a/arch/powerpc/kernel/irq.c	2008-07-14 17:22:28.000000000 -0400
++++ a/arch/powerpc/kernel/irq.c	2008-07-16 22:41:36.000000000 -0400
 @@ -53,6 +53,7 @@
  #include <linux/bootmem.h>
  #include <linux/pci.h>
@@ -651,8 +618,8 @@
  
  #include <asm/uaccess.h>
  #include <asm/system.h>
---- a/arch/powerpc/kernel/process.c	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/powerpc/kernel/process.c	2008-04-19 15:14:52.000000000 -0400
+--- a/arch/powerpc/kernel/process.c	2008-07-14 17:22:28.000000000 -0400
++++ a/arch/powerpc/kernel/process.c	2008-07-16 22:41:36.000000000 -0400
 @@ -464,8 +464,9 @@ void show_regs(struct pt_regs * regs)
  #else
  		printk("DAR: "REG", DSISR: "REG"\n", regs->dar, regs->dsisr);
@@ -665,9 +632,9 @@
  
  #ifdef CONFIG_SMP
  	printk(" CPU: %d", raw_smp_processor_id());
---- a/arch/powerpc/kernel/sys_ppc32.c	2008-04-17 11:31:24.000000000 -0400
-+++ a/arch/powerpc/kernel/sys_ppc32.c	2008-04-19 15:14:52.000000000 -0400
-@@ -205,7 +205,7 @@ asmlinkage long compat_sys_gettimeofday(
+--- a/arch/powerpc/kernel/sys_ppc32.c	2008-07-14 17:22:28.000000000 -0400
++++ a/arch/powerpc/kernel/sys_ppc32.c	2008-07-16 22:41:36.000000000 -0400
+@@ -204,7 +204,7 @@ asmlinkage long compat_sys_gettimeofday(
  {
  	if (tv) {
  		struct timeval ktv;
@@ -677,7 +644,7 @@
  			return -EFAULT;
  	}
 --- a/arch/powerpc/kernel/traps.c	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/powerpc/kernel/traps.c	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/powerpc/kernel/traps.c	2008-07-16 22:41:36.000000000 -0400
 @@ -941,8 +941,9 @@ void nonrecoverable_exception(struct pt_
  
  void trace_syscall(struct pt_regs *regs)
@@ -690,18 +657,18 @@
  	       regs->ccr&0x10000000?"Error=":"", regs->gpr[3], print_tainted());
  }
  
---- a/arch/powerpc/kernel/vdso.c	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/powerpc/kernel/vdso.c	2008-04-19 15:14:52.000000000 -0400
-@@ -21,6 +21,7 @@
- #include <linux/elf.h>
+--- a/arch/powerpc/kernel/vdso.c	2008-07-14 17:22:28.000000000 -0400
++++ a/arch/powerpc/kernel/vdso.c	2008-07-17 21:09:13.000000000 -0400
+@@ -22,6 +22,7 @@
  #include <linux/security.h>
  #include <linux/bootmem.h>
+ #include <linux/lmb.h>
 +#include <linux/vs_memory.h>
  
  #include <asm/pgtable.h>
  #include <asm/system.h>
 --- a/arch/powerpc/mm/fault.c	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/powerpc/mm/fault.c	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/powerpc/mm/fault.c	2008-07-16 22:41:36.000000000 -0400
 @@ -378,7 +378,8 @@ out_of_memory:
  		down_read(&mm->mmap_sem);
  		goto survive;
@@ -712,9 +679,9 @@
  	if (user_mode(regs))
  		do_group_exit(SIGKILL);
  	return SIGKILL;
---- a/arch/ppc/Kconfig	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/ppc/Kconfig	2008-04-19 15:14:52.000000000 -0400
-@@ -1261,6 +1261,8 @@ source "lib/Kconfig"
+--- a/arch/ppc/Kconfig	2008-07-14 17:22:29.000000000 -0400
++++ a/arch/ppc/Kconfig	2008-07-16 22:41:36.000000000 -0400
+@@ -1181,6 +1181,8 @@ source "lib/Kconfig"
  
  source "arch/ppc/Kconfig.debug"
  
@@ -724,7 +691,7 @@
  
  source "crypto/Kconfig"
 --- a/arch/ppc/kernel/traps.c	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/ppc/kernel/traps.c	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/ppc/kernel/traps.c	2008-07-16 22:41:36.000000000 -0400
 @@ -669,8 +669,9 @@ void nonrecoverable_exception(struct pt_
  
  void trace_syscall(struct pt_regs *regs)
@@ -738,7 +705,7 @@
  }
  
 --- a/arch/ppc/mm/fault.c	2008-04-17 11:31:25.000000000 -0400
-+++ a/arch/ppc/mm/fault.c	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/ppc/mm/fault.c	2008-07-16 22:41:36.000000000 -0400
 @@ -295,7 +295,8 @@ out_of_memory:
  		down_read(&mm->mmap_sem);
  		goto survive;
@@ -749,9 +716,9 @@
  	if (user_mode(regs))
  		do_group_exit(SIGKILL);
  	return SIGKILL;
---- a/arch/s390/Kconfig	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/s390/Kconfig	2008-04-19 15:14:52.000000000 -0400
-@@ -544,6 +544,8 @@ source "fs/Kconfig"
+--- a/arch/s390/Kconfig	2008-07-14 17:22:29.000000000 -0400
++++ a/arch/s390/Kconfig	2008-07-16 22:41:36.000000000 -0400
+@@ -562,6 +562,8 @@ source "fs/Kconfig"
  
  source "arch/s390/Kconfig.debug"
  
@@ -760,9 +727,9 @@
  source "security/Kconfig"
  
  source "crypto/Kconfig"
---- a/arch/s390/kernel/compat_linux.c	2008-04-17 11:31:25.000000000 -0400
-+++ a/arch/s390/kernel/compat_linux.c	2008-04-19 15:14:52.000000000 -0400
-@@ -567,7 +567,7 @@ asmlinkage long sys32_gettimeofday(struc
+--- a/arch/s390/kernel/compat_linux.c	2008-07-14 17:22:29.000000000 -0400
++++ a/arch/s390/kernel/compat_linux.c	2008-07-16 22:41:36.000000000 -0400
+@@ -566,7 +566,7 @@ asmlinkage long sys32_gettimeofday(struc
  {
  	if (tv) {
  		struct timeval ktv;
@@ -771,23 +738,8 @@
  		if (put_tv32(tv, &ktv))
  			return -EFAULT;
  	}
---- a/arch/s390/kernel/process.c	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/s390/kernel/process.c	2008-04-21 11:09:01.000000000 -0400
-@@ -194,9 +194,9 @@ void show_regs(struct pt_regs *regs)
- 	       init_utsname()->release,
- 	       (int)strcspn(init_utsname()->version, " "),
- 	       init_utsname()->version);
--	printk("Process %s (pid: %d, task: %p, ksp: %p)\n",
--	       current->comm, current->pid, current,
--	       (void *) current->thread.ksp);
-+	printk("Process %s (pid: %d[#%u], task: %p, ksp: %p)\n",
-+	       current->comm, current->pid, current->xid,
-+	       (void *) current, (void *) current->thread.ksp);
- 	show_registers(regs);
- 	/* Show stack backtrace if pt_regs is from kernel mode */
- 	if (!(regs->psw.mask & PSW_MASK_PSTATE))
---- a/arch/s390/kernel/ptrace.c	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/s390/kernel/ptrace.c	2008-04-19 15:14:52.000000000 -0400
+--- a/arch/s390/kernel/ptrace.c	2008-07-14 17:22:29.000000000 -0400
++++ a/arch/s390/kernel/ptrace.c	2008-07-16 22:41:36.000000000 -0400
 @@ -33,6 +33,7 @@
  #include <linux/security.h>
  #include <linux/audit.h>
@@ -796,22 +748,8 @@
  
  #include <asm/segment.h>
  #include <asm/page.h>
-@@ -710,7 +711,13 @@ sys_ptrace(long request, long pid, long 
- 		goto out;
- 	}
- 
-+	if (!vx_check(vx_task_xid(child), VS_WATCH_P | VS_IDENT)) {
-+		ret = -EPERM;
-+		goto out_tsk;
-+	}
-+
- 	ret = do_ptrace(child, request, addr, data);
-+out_tsk:
- 	put_task_struct(child);
- out:
- 	unlock_kernel();
 --- a/arch/s390/kernel/syscalls.S	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/s390/kernel/syscalls.S	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/s390/kernel/syscalls.S	2008-07-16 22:41:36.000000000 -0400
 @@ -271,7 +271,7 @@ SYSCALL(sys_clock_settime,sys_clock_sett
  SYSCALL(sys_clock_gettime,sys_clock_gettime,sys32_clock_gettime_wrapper)	/* 260 */
  SYSCALL(sys_clock_getres,sys_clock_getres,sys32_clock_getres_wrapper)
@@ -821,9 +759,9 @@
  SYSCALL(s390_fadvise64_64,sys_ni_syscall,sys32_fadvise64_64_wrapper)
  SYSCALL(sys_statfs64,sys_statfs64,compat_sys_statfs64_wrapper)
  SYSCALL(sys_fstatfs64,sys_fstatfs64,compat_sys_fstatfs64_wrapper)
---- a/arch/s390/mm/fault.c	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/s390/mm/fault.c	2008-04-19 15:14:52.000000000 -0400
-@@ -217,7 +217,8 @@ static int do_out_of_memory(struct pt_re
+--- a/arch/s390/mm/fault.c	2008-07-14 17:22:29.000000000 -0400
++++ a/arch/s390/mm/fault.c	2008-07-16 22:41:36.000000000 -0400
+@@ -216,7 +216,8 @@ static int do_out_of_memory(struct pt_re
  		down_read(&mm->mmap_sem);
  		return 1;
  	}
@@ -833,9 +771,9 @@
  	if (regs->psw.mask & PSW_MASK_PSTATE)
  		do_group_exit(SIGKILL);
  	do_no_context(regs, error_code, address);
---- a/arch/sh/Kconfig	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/sh/Kconfig	2008-04-19 15:14:52.000000000 -0400
-@@ -913,6 +913,8 @@ source "fs/Kconfig"
+--- a/arch/sh/Kconfig	2008-07-14 17:22:29.000000000 -0400
++++ a/arch/sh/Kconfig	2008-07-16 22:41:36.000000000 -0400
+@@ -927,6 +927,8 @@ source "fs/Kconfig"
  
  source "arch/sh/Kconfig.debug"
  
@@ -844,8 +782,8 @@
  source "security/Kconfig"
  
  source "crypto/Kconfig"
---- a/arch/sh/kernel/irq.c	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/sh/kernel/irq.c	2008-04-19 15:14:52.000000000 -0400
+--- a/arch/sh/kernel/irq.c	2008-07-14 17:22:29.000000000 -0400
++++ a/arch/sh/kernel/irq.c	2008-07-16 22:41:36.000000000 -0400
 @@ -11,6 +11,7 @@
  #include <linux/module.h>
  #include <linux/kernel_stat.h>
@@ -855,7 +793,7 @@
  #include <asm/machvec.h>
  #include <asm/uaccess.h>
 --- a/arch/sh/kernel/vsyscall/vsyscall.c	2008-04-17 10:37:14.000000000 -0400
-+++ a/arch/sh/kernel/vsyscall/vsyscall.c	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/sh/kernel/vsyscall/vsyscall.c	2008-07-16 22:41:36.000000000 -0400
 @@ -19,6 +19,7 @@
  #include <linux/elf.h>
  #include <linux/sched.h>
@@ -864,9 +802,9 @@
  
  /*
   * Should the kernel map a VDSO page into processes and pass its
---- a/arch/sparc/Kconfig	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/sparc/Kconfig	2008-04-19 15:14:52.000000000 -0400
-@@ -330,6 +330,8 @@ source "fs/Kconfig"
+--- a/arch/sparc/Kconfig	2008-07-14 17:22:29.000000000 -0400
++++ a/arch/sparc/Kconfig	2008-07-16 22:41:36.000000000 -0400
+@@ -318,6 +318,8 @@ source "fs/Kconfig"
  
  source "arch/sparc/Kconfig.debug"
  
@@ -875,8 +813,8 @@
  source "security/Kconfig"
  
  source "crypto/Kconfig"
---- a/arch/sparc/kernel/ptrace.c	2008-05-21 14:30:05.000000000 -0400
-+++ a/arch/sparc/kernel/ptrace.c	2008-05-21 14:30:40.000000000 -0400
+--- a/arch/sparc/kernel/ptrace.c	2008-07-14 17:22:29.000000000 -0400
++++ a/arch/sparc/kernel/ptrace.c	2008-07-16 22:41:36.000000000 -0400
 @@ -21,6 +21,7 @@
  #include <linux/signal.h>
  #include <linux/regset.h>
@@ -885,19 +823,8 @@
  
  #include <asm/pgtable.h>
  #include <asm/system.h>
-@@ -270,6 +271,10 @@ static int fpregs32_set(struct task_stru
- 					 33 * sizeof(u32),
- 					 34 * sizeof(u32));
- 	}
-+	if (!vx_check(vx_task_xid(child), VS_WATCH_P | VS_IDENT)) {
-+		pt_error_return(regs, ESRCH);
-+		goto out_tsk;
-+	}
- 
- 	if (!ret)
- 		ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
---- a/arch/sparc/kernel/systbls.S	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/sparc/kernel/systbls.S	2008-04-19 15:14:52.000000000 -0400
+--- a/arch/sparc/kernel/systbls.S	2008-07-14 17:22:29.000000000 -0400
++++ a/arch/sparc/kernel/systbls.S	2008-07-16 22:41:36.000000000 -0400
 @@ -70,7 +70,7 @@ sys_call_table:
  /*250*/	.long sparc_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl
  /*255*/	.long sys_sync_file_range, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep
@@ -907,8 +834,8 @@
  /*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
---- a/arch/sparc/kernel/traps.c	2008-04-17 11:31:25.000000000 -0400
-+++ a/arch/sparc/kernel/traps.c	2008-04-19 15:14:52.000000000 -0400
+--- a/arch/sparc/kernel/traps.c	2008-07-14 17:22:29.000000000 -0400
++++ a/arch/sparc/kernel/traps.c	2008-07-16 22:41:36.000000000 -0400
 @@ -99,7 +99,8 @@ void die_if_kernel(char *str, struct pt_
  "              /_| \\__/ |_\\\n"
  "                 \\__U_/\n");
@@ -919,9 +846,9 @@
  	show_regs(regs);
  	add_taint(TAINT_DIE);
  
---- a/arch/sparc/mm/fault.c	2008-04-17 11:31:25.000000000 -0400
-+++ a/arch/sparc/mm/fault.c	2008-04-19 15:14:52.000000000 -0400
-@@ -367,7 +367,8 @@ no_context:
+--- a/arch/sparc/mm/fault.c	2008-07-14 17:22:29.000000000 -0400
++++ a/arch/sparc/mm/fault.c	2008-07-16 22:41:36.000000000 -0400
+@@ -318,7 +318,8 @@ no_context:
   */
  out_of_memory:
  	up_read(&mm->mmap_sem);
@@ -931,9 +858,9 @@
  	if (from_user)
  		do_group_exit(SIGKILL);
  	goto no_context;
---- a/arch/sparc64/Kconfig	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/sparc64/Kconfig	2008-04-19 15:14:52.000000000 -0400
-@@ -471,6 +471,8 @@ source "fs/Kconfig"
+--- a/arch/sparc64/Kconfig	2008-07-14 17:22:29.000000000 -0400
++++ a/arch/sparc64/Kconfig	2008-07-16 22:41:36.000000000 -0400
+@@ -407,6 +407,8 @@ source "fs/Kconfig"
  
  source "arch/sparc64/Kconfig.debug"
  
@@ -942,18 +869,8 @@
  source "security/Kconfig"
  
  source "crypto/Kconfig"
---- a/arch/sparc64/kernel/binfmt_aout32.c	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/sparc64/kernel/binfmt_aout32.c	2008-04-19 15:14:52.000000000 -0400
-@@ -27,6 +27,7 @@
- #include <linux/binfmts.h>
- #include <linux/personality.h>
- #include <linux/init.h>
-+#include <linux/vs_memory.h>
- 
- #include <asm/system.h>
- #include <asm/uaccess.h>
---- a/arch/sparc64/kernel/ptrace.c	2008-05-21 14:30:05.000000000 -0400
-+++ a/arch/sparc64/kernel/ptrace.c	2008-05-21 14:30:40.000000000 -0400
+--- a/arch/sparc64/kernel/ptrace.c	2008-07-14 17:22:29.000000000 -0400
++++ a/arch/sparc64/kernel/ptrace.c	2008-07-16 22:41:36.000000000 -0400
 @@ -25,6 +25,7 @@
  #include <linux/regset.h>
  #include <linux/compat.h>
@@ -962,20 +879,9 @@
  
  #include <asm/asi.h>
  #include <asm/pgtable.h>
-@@ -222,6 +223,10 @@ static int genregs64_get(struct task_str
- 					  16 * sizeof(u64),
- 					  32 * sizeof(u64));
- 	}
-+	if (!vx_check(vx_task_xid(child), VS_WATCH_P | VS_IDENT)) {
-+		pt_error_return(regs, ESRCH);
-+		goto out_tsk;
-+	}
- 
- 	if (!ret) {
- 		/* TSTATE, TPC, TNPC */
---- a/arch/sparc64/kernel/sys_sparc32.c	2008-05-21 14:30:05.000000000 -0400
-+++ a/arch/sparc64/kernel/sys_sparc32.c	2008-05-21 14:30:40.000000000 -0400
-@@ -722,7 +722,7 @@ asmlinkage long sys32_gettimeofday(struc
+--- a/arch/sparc64/kernel/sys_sparc32.c	2008-07-14 17:22:29.000000000 -0400
++++ a/arch/sparc64/kernel/sys_sparc32.c	2008-07-16 22:41:36.000000000 -0400
+@@ -707,7 +707,7 @@ asmlinkage long sys32_gettimeofday(struc
  {
  	if (tv) {
  		struct timeval ktv;
@@ -984,8 +890,8 @@
  		if (put_tv32(tv, &ktv))
  			return -EFAULT;
  	}
---- a/arch/sparc64/kernel/systbls.S	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/sparc64/kernel/systbls.S	2008-04-19 15:14:52.000000000 -0400
+--- a/arch/sparc64/kernel/systbls.S	2008-07-14 17:22:29.000000000 -0400
++++ a/arch/sparc64/kernel/systbls.S	2008-07-16 22:41:36.000000000 -0400
 @@ -71,7 +71,7 @@ sys_call_table32:
  /*250*/	.word sys32_mremap, sys32_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl
  	.word sys32_sync_file_range, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep
@@ -1004,9 +910,9 @@
  /*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
---- a/arch/sparc64/kernel/traps.c	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/sparc64/kernel/traps.c	2008-04-19 15:14:52.000000000 -0400
-@@ -2183,7 +2183,8 @@ void die_if_kernel(char *str, struct pt_
+--- a/arch/sparc64/kernel/traps.c	2008-07-14 17:22:29.000000000 -0400
++++ a/arch/sparc64/kernel/traps.c	2008-07-16 22:41:36.000000000 -0400
+@@ -2196,7 +2196,8 @@ void die_if_kernel(char *str, struct pt_
  "              /_| \\__/ |_\\\n"
  "                 \\__U_/\n");
  
@@ -1016,8 +922,8 @@
  	notify_die(DIE_OOPS, str, regs, 0, 255, SIGSEGV);
  	__asm__ __volatile__("flushw");
  	__show_regs(regs);
---- a/arch/sparc64/mm/fault.c	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/sparc64/mm/fault.c	2008-04-19 15:14:52.000000000 -0400
+--- a/arch/sparc64/mm/fault.c	2008-07-14 17:22:29.000000000 -0400
++++ a/arch/sparc64/mm/fault.c	2008-07-16 22:41:36.000000000 -0400
 @@ -453,7 +453,8 @@ handle_kernel_fault:
  out_of_memory:
  	insn = get_fault_insn(regs, insn);
@@ -1028,28 +934,8 @@
  	if (!(regs->tstate & TSTATE_PRIV))
  		do_group_exit(SIGKILL);
  	goto handle_kernel_fault;
---- a/arch/sparc64/solaris/fs.c	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/sparc64/solaris/fs.c	2008-04-19 15:14:52.000000000 -0400
-@@ -368,7 +368,7 @@ static int report_statvfs(struct vfsmoun
- 		int j = strlen (p);
- 		
- 		if (j > 15) j = 15;
--		if (IS_RDONLY(inode)) i = 1;
-+		if (IS_RDONLY(inode) || MNT_IS_RDONLY(mnt)) i = 1;
- 		if (mnt->mnt_flags & MNT_NOSUID) i |= 2;
- 		if (!sysv_valid_dev(inode->i_sb->s_dev))
- 			return -EOVERFLOW;
-@@ -404,7 +404,7 @@ static int report_statvfs64(struct vfsmo
- 		int j = strlen (p);
- 		
- 		if (j > 15) j = 15;
--		if (IS_RDONLY(inode)) i = 1;
-+		if (IS_RDONLY(inode) || MNT_IS_RDONLY(mnt)) i = 1;
- 		if (mnt->mnt_flags & MNT_NOSUID) i |= 2;
- 		if (!sysv_valid_dev(inode->i_sb->s_dev))
- 			return -EOVERFLOW;
---- a/arch/um/Kconfig	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/um/Kconfig	2008-04-19 15:14:52.000000000 -0400
+--- a/arch/um/Kconfig	2008-07-14 17:22:29.000000000 -0400
++++ a/arch/um/Kconfig	2008-07-16 22:41:36.000000000 -0400
 @@ -245,6 +245,8 @@ source "drivers/connector/Kconfig"
  
  source "fs/Kconfig"
@@ -1060,7 +946,7 @@
  
  source "crypto/Kconfig"
 --- a/arch/um/kernel/trap.c	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/um/kernel/trap.c	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/um/kernel/trap.c	2008-07-16 22:41:36.000000000 -0400
 @@ -215,7 +215,8 @@ unsigned long segv(struct faultinfo fi, 
  		current->thread.arch.faultinfo = fi;
  		force_sig_info(SIGBUS, &si, current);
@@ -1072,7 +958,7 @@
  	} else {
  		BUG_ON(err != -EFAULT);
 --- a/arch/v850/Kconfig	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/v850/Kconfig	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/v850/Kconfig	2008-07-16 22:41:36.000000000 -0400
 @@ -344,6 +344,8 @@ source "drivers/usb/Kconfig"
  
  source "arch/v850/Kconfig.debug"
@@ -1083,7 +969,7 @@
  
  source "crypto/Kconfig"
 --- a/arch/v850/kernel/ptrace.c	2008-04-17 10:37:14.000000000 -0400
-+++ a/arch/v850/kernel/ptrace.c	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/v850/kernel/ptrace.c	2008-07-16 22:41:36.000000000 -0400
 @@ -23,6 +23,7 @@
  #include <linux/sched.h>
  #include <linux/ptrace.h>
@@ -1102,9 +988,9 @@
  	switch (request) {
  		unsigned long val;
  
---- a/arch/x86/ia32/ia32entry.S	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/x86/ia32/ia32entry.S	2008-04-22 20:07:49.000000000 -0400
-@@ -673,7 +673,7 @@ ia32_sys_call_table:
+--- a/arch/x86/ia32/ia32entry.S	2008-07-14 17:22:30.000000000 -0400
++++ a/arch/x86/ia32/ia32entry.S	2008-07-16 22:41:36.000000000 -0400
+@@ -677,7 +677,7 @@ ia32_sys_call_table:
  	.quad sys_tgkill		/* 270 */
  	.quad compat_sys_utimes
  	.quad sys32_fadvise64_64
@@ -1113,9 +999,9 @@
  	.quad sys_mbind
  	.quad compat_sys_get_mempolicy	/* 275 */
  	.quad sys_set_mempolicy
---- a/arch/x86/Kconfig	2008-05-21 14:30:05.000000000 -0400
-+++ a/arch/x86/Kconfig	2008-05-21 14:30:40.000000000 -0400
-@@ -1623,6 +1623,8 @@ source "fs/Kconfig"
+--- a/arch/x86/Kconfig	2008-07-14 17:22:30.000000000 -0400
++++ a/arch/x86/Kconfig	2008-07-16 22:41:36.000000000 -0400
+@@ -1722,6 +1722,8 @@ source "fs/Kconfig"
  
  source "arch/x86/Kconfig.debug"
  
@@ -1125,7 +1011,7 @@
  
  source "crypto/Kconfig"
 --- a/arch/x86/kernel/syscall_table_32.S	2008-04-17 12:05:30.000000000 -0400
-+++ a/arch/x86/kernel/syscall_table_32.S	2008-04-19 15:14:52.000000000 -0400
++++ a/arch/x86/kernel/syscall_table_32.S	2008-07-16 22:41:36.000000000 -0400
 @@ -272,7 +272,7 @@ ENTRY(sys_call_table)
  	.long sys_tgkill	/* 270 */
  	.long sys_utimes
@@ -1136,7 +1022,7 @@
  	.long sys_get_mempolicy
  	.long sys_set_mempolicy
 --- a/Documentation/vserver/debug.txt	1969-12-31 19:00:00.000000000 -0500
-+++ a/Documentation/vserver/debug.txt	2008-04-19 15:14:51.000000000 -0400
++++ a/Documentation/vserver/debug.txt	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,154 @@
 +
 +debug_cvirt:
@@ -1293,7 +1179,7 @@
 +	"vx_acc_pages[%5d,%s,%2d]: %5d += %5d"
 +	"vx_pages_avail[%5d,%s,%2d]: %5ld > %5d + %5d"
 --- a/drivers/block/Kconfig	2008-04-17 12:05:31.000000000 -0400
-+++ a/drivers/block/Kconfig	2008-04-19 15:14:52.000000000 -0400
++++ a/drivers/block/Kconfig	2008-07-16 22:41:36.000000000 -0400
 @@ -263,6 +263,13 @@ config BLK_DEV_CRYPTOLOOP
  	  instead, which can be configured to be on-disk compatible with the
  	  cryptoloop device.
@@ -1308,8 +1194,8 @@
  config BLK_DEV_NBD
  	tristate "Network block device support"
  	depends on NET
---- a/drivers/block/loop.c	2008-04-17 12:05:32.000000000 -0400
-+++ a/drivers/block/loop.c	2008-04-19 15:14:52.000000000 -0400
+--- a/drivers/block/loop.c	2008-07-14 17:22:32.000000000 -0400
++++ a/drivers/block/loop.c	2008-07-16 22:41:36.000000000 -0400
 @@ -76,6 +76,7 @@
  #include <linux/gfp.h>
  #include <linux/kthread.h>
@@ -1318,7 +1204,7 @@
  
  #include <asm/uaccess.h>
  
-@@ -789,6 +790,7 @@ static int loop_set_fd(struct loop_devic
+@@ -794,6 +795,7 @@ static int loop_set_fd(struct loop_devic
  	lo->lo_blocksize = lo_blocksize;
  	lo->lo_device = bdev;
  	lo->lo_flags = lo_flags;
@@ -1326,7 +1212,7 @@
  	lo->lo_backing_file = file;
  	lo->transfer = transfer_none;
  	lo->ioctl = NULL;
-@@ -908,6 +910,7 @@ static int loop_clr_fd(struct loop_devic
+@@ -915,6 +917,7 @@ static int loop_clr_fd(struct loop_devic
  	lo->lo_encrypt_key_size = 0;
  	lo->lo_flags = 0;
  	lo->lo_thread = NULL;
@@ -1334,7 +1220,7 @@
  	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);
-@@ -929,7 +932,7 @@ loop_set_status(struct loop_device *lo, 
+@@ -938,7 +941,7 @@ loop_set_status(struct loop_device *lo, 
  	struct loop_func_table *xfer;
  
  	if (lo->lo_encrypt_key_size && lo->lo_key_owner != current->uid &&
@@ -1343,7 +1229,7 @@
  		return -EPERM;
  	if (lo->lo_state != Lo_bound)
  		return -ENXIO;
-@@ -1013,7 +1016,8 @@ loop_get_status(struct loop_device *lo, 
+@@ -1022,7 +1025,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;
@@ -1353,7 +1239,7 @@
  		info->lo_encrypt_key_size = lo->lo_encrypt_key_size;
  		memcpy(info->lo_encrypt_key, lo->lo_encrypt_key,
  		       lo->lo_encrypt_key_size);
-@@ -1322,6 +1326,9 @@ static int lo_open(struct inode *inode, 
+@@ -1331,6 +1335,9 @@ static int lo_open(struct inode *inode, 
  {
  	struct loop_device *lo = inode->i_bdev->bd_disk->private_data;
  
@@ -1364,7 +1250,7 @@
  	lo->lo_refcnt++;
  	mutex_unlock(&lo->lo_ctl_mutex);
 --- a/drivers/block/Makefile	2008-04-17 12:05:31.000000000 -0400
-+++ a/drivers/block/Makefile	2008-04-19 15:14:52.000000000 -0400
++++ a/drivers/block/Makefile	2008-07-16 22:41:36.000000000 -0400
 @@ -29,5 +29,6 @@ obj-$(CONFIG_VIRTIO_BLK)	+= virtio_blk.o
  obj-$(CONFIG_VIODASD)		+= viodasd.o
  obj-$(CONFIG_BLK_DEV_SX8)	+= sx8.o
@@ -1373,8 +1259,8 @@
  
  obj-$(CONFIG_XEN_BLKDEV_FRONTEND)	+= xen-blkfront.o
 --- a/drivers/block/vroot.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/drivers/block/vroot.c	2008-04-19 15:14:52.000000000 -0400
-@@ -0,0 +1,280 @@
++++ a/drivers/block/vroot.c	2008-08-11 23:21:07.000000000 -0400
+@@ -0,0 +1,283 @@
 +/*
 + *  linux/drivers/block/vroot.c
 + *
@@ -1586,6 +1472,9 @@
 +		disks[i] = alloc_disk(1);
 +		if (!disks[i])
 +			goto out_mem3;
++		disks[i]->queue = blk_alloc_queue(GFP_KERNEL);
++		if (!disks[i]->queue)
++			goto out_mem3;
 +	}
 +
 +	for (i = 0; i < max_vroot; i++) {
@@ -1655,8 +1544,8 @@
 +
 +#endif
 +
---- a/drivers/char/sysrq.c	2008-04-17 11:31:27.000000000 -0400
-+++ a/drivers/char/sysrq.c	2008-04-19 15:14:52.000000000 -0400
+--- a/drivers/char/sysrq.c	2008-07-14 17:22:33.000000000 -0400
++++ a/drivers/char/sysrq.c	2008-07-16 22:41:36.000000000 -0400
 @@ -37,6 +37,7 @@
  #include <linux/irq.h>
  #include <linux/hrtimer.h>
@@ -1665,7 +1554,7 @@
  
  #include <asm/ptrace.h>
  #include <asm/irq_regs.h>
-@@ -310,6 +311,21 @@ static struct sysrq_key_op sysrq_unrt_op
+@@ -351,6 +352,21 @@ static struct sysrq_key_op sysrq_unrt_op
  	.enable_mask	= SYSRQ_ENABLE_RTNICE,
  };
  
@@ -1687,9 +1576,9 @@
  /* Key Operations table and lock */
  static DEFINE_SPINLOCK(sysrq_key_table_lock);
  
-@@ -358,7 +374,11 @@ static struct sysrq_key_op *sysrq_key_ta
- 	/* x: May be registered on ppc/powerpc for xmon */
+@@ -404,7 +420,11 @@ static struct sysrq_key_op *sysrq_key_ta
  	NULL,				/* x */
+ 	/* y: May be registered on sparc64 for global register dump */
  	NULL,				/* y */
 -	NULL				/* z */
 +#ifdef CONFIG_VSERVER_DEBUG
@@ -1700,7 +1589,7 @@
  };
  
  /* key2index calculation, -1 on invalid index */
-@@ -370,6 +390,8 @@ static int sysrq_key_table_key2index(int
+@@ -416,6 +436,8 @@ static int sysrq_key_table_key2index(int
  		retval = key - '0';
  	else if ((key >= 'a') && (key <= 'z'))
  		retval = key + 10 - 'a';
@@ -1709,8 +1598,8 @@
  	else
  		retval = -1;
  	return retval;
---- a/drivers/char/tty_io.c	2008-04-17 12:05:32.000000000 -0400
-+++ a/drivers/char/tty_io.c	2008-04-19 15:14:52.000000000 -0400
+--- a/drivers/char/tty_io.c	2008-07-14 17:22:33.000000000 -0400
++++ a/drivers/char/tty_io.c	2008-07-16 22:41:36.000000000 -0400
 @@ -105,6 +105,7 @@
  
  #include <linux/kmod.h>
@@ -1719,7 +1608,7 @@
  
  #undef TTY_DEBUG_HANGUP
  
-@@ -3142,6 +3143,7 @@ static int tiocspgrp(struct tty_struct *
+@@ -3230,6 +3231,7 @@ static int tiocspgrp(struct tty_struct *
  		return -ENOTTY;
  	if (get_user(pgrp_nr, p))
  		return -EFAULT;
@@ -1728,7 +1617,7 @@
  		return -EINVAL;
  	rcu_read_lock();
 --- a/drivers/infiniband/hw/ipath/ipath_user_pages.c	2008-04-17 10:37:17.000000000 -0400
-+++ a/drivers/infiniband/hw/ipath/ipath_user_pages.c	2008-04-19 15:14:52.000000000 -0400
++++ a/drivers/infiniband/hw/ipath/ipath_user_pages.c	2008-07-16 22:41:36.000000000 -0400
 @@ -33,6 +33,7 @@
  
  #include <linux/mm.h>
@@ -1774,8 +1663,8 @@
  	up_write(&work->mm->mmap_sem);
  	mmput(work->mm);
  	kfree(work);
---- a/drivers/md/dm.c	2008-04-17 12:05:33.000000000 -0400
-+++ a/drivers/md/dm.c	2008-04-19 15:14:52.000000000 -0400
+--- a/drivers/md/dm.c	2008-07-14 17:22:35.000000000 -0400
++++ a/drivers/md/dm.c	2008-07-16 22:41:36.000000000 -0400
 @@ -22,6 +22,7 @@
  #include <linux/hdreg.h>
  #include <linux/blktrace_api.h>
@@ -1792,7 +1681,7 @@
  
  	unsigned long flags;
  
-@@ -250,6 +252,7 @@ static void __exit dm_exit(void)
+@@ -252,6 +254,7 @@ static void __exit dm_exit(void)
  static int dm_blk_open(struct inode *inode, struct file *file)
  {
  	struct mapped_device *md;
@@ -1800,7 +1689,7 @@
  
  	spin_lock(&_minor_lock);
  
-@@ -258,18 +261,19 @@ static int dm_blk_open(struct inode *ino
+@@ -260,18 +263,19 @@ static int dm_blk_open(struct inode *ino
  		goto out;
  
  	if (test_bit(DMF_FREEING, &md->flags) ||
@@ -1826,7 +1715,7 @@
  }
  
  static int dm_blk_close(struct inode *inode, struct file *file)
-@@ -465,6 +469,14 @@ int dm_set_geometry(struct mapped_device
+@@ -467,6 +471,14 @@ int dm_set_geometry(struct mapped_device
  	return 0;
  }
  
@@ -1849,9 +1738,9 @@
  	md->queue = blk_alloc_queue(GFP_KERNEL);
  	if (!md->queue)
  		goto bad_queue;
---- a/drivers/md/dm.h	2008-04-17 11:31:28.000000000 -0400
-+++ a/drivers/md/dm.h	2008-04-19 15:14:52.000000000 -0400
-@@ -127,6 +127,8 @@ void dm_put_target_type(struct target_ty
+--- a/drivers/md/dm.h	2008-07-14 17:22:35.000000000 -0400
++++ a/drivers/md/dm.h	2008-07-16 22:41:36.000000000 -0400
+@@ -66,6 +66,8 @@ void dm_put_target_type(struct target_ty
  int dm_target_iterate(void (*iter_func)(struct target_type *tt,
  					void *param), void *param);
  
@@ -1861,7 +1750,7 @@
   * Useful inlines.
   *---------------------------------------------------------------*/
 --- a/drivers/md/dm-ioctl.c	2008-04-17 12:05:33.000000000 -0400
-+++ a/drivers/md/dm-ioctl.c	2008-04-21 10:45:53.000000000 -0400
++++ a/drivers/md/dm-ioctl.c	2008-07-16 22:41:36.000000000 -0400
 @@ -16,6 +16,7 @@
  #include <linux/dm-ioctl.h>
  #include <linux/hdreg.h>
@@ -1943,17 +1832,17 @@
  		return -EACCES;
  
  	if (_IOC_TYPE(command) != DM_IOCTL)
---- a/drivers/net/tun.c	2008-04-17 12:05:36.000000000 -0400
-+++ a/drivers/net/tun.c	2008-04-19 15:39:04.000000000 -0400
-@@ -62,6 +62,7 @@
- #include <linux/if_ether.h>
+--- a/drivers/net/tun.c	2008-07-14 17:22:40.000000000 -0400
++++ a/drivers/net/tun.c	2008-07-17 21:09:54.000000000 -0400
+@@ -63,6 +63,7 @@
  #include <linux/if_tun.h>
  #include <linux/crc32.h>
+ #include <linux/nsproxy.h>
 +#include <linux/vs_network.h>
  #include <net/net_namespace.h>
+ #include <net/netns/generic.h>
  
- #include <asm/system.h>
-@@ -86,6 +87,7 @@ struct tun_struct {
+@@ -88,6 +89,7 @@ struct tun_struct {
  	int			attached;
  	uid_t			owner;
  	gid_t			group;
@@ -1961,7 +1850,7 @@
  
  	wait_queue_head_t	read_wait;
  	struct sk_buff_head	readq;
-@@ -465,6 +467,7 @@ static void tun_setup(struct net_device 
+@@ -486,6 +488,7 @@ static void tun_setup(struct net_device 
  
  	tun->owner = -1;
  	tun->group = -1;
@@ -1969,9 +1858,9 @@
  
  	dev->open = tun_net_open;
  	dev->hard_start_xmit = tun_net_xmit;
-@@ -494,6 +497,9 @@ static int tun_set_iff(struct file *file
- 
- 	tun = tun_get_by_name(ifr->ifr_name);
+@@ -518,6 +521,9 @@ static int tun_set_iff(struct net *net, 
+ 	tn = net_generic(net, tun_net_id);
+ 	tun = tun_get_by_name(tn, ifr->ifr_name);
  	if (tun) {
 +		if (!nx_check(tun->nid, VS_IDENT | VS_HOSTID | VS_ADMIN_P))
 +			return -EPERM;
@@ -1979,7 +1868,7 @@
  		if (tun->attached)
  			return -EBUSY;
  
-@@ -502,7 +508,7 @@ static int tun_set_iff(struct file *file
+@@ -526,7 +532,7 @@ static int tun_set_iff(struct net *net, 
  		      current->euid != tun->owner) ||
  		     (tun->group != -1 &&
  		      current->egid != tun->group)) &&
@@ -1987,8 +1876,8 @@
 +		     !cap_raised(current->cap_effective, CAP_NET_ADMIN))
  			return -EPERM;
  	}
- 	else if (__dev_get_by_name(&init_net, ifr->ifr_name))
-@@ -513,7 +519,7 @@ static int tun_set_iff(struct file *file
+ 	else if (__dev_get_by_name(net, ifr->ifr_name))
+@@ -537,7 +543,7 @@ static int tun_set_iff(struct net *net, 
  
  		err = -EINVAL;
  
@@ -1997,7 +1886,7 @@
  			return -EPERM;
  
  		/* Set dev type */
-@@ -656,6 +662,16 @@ static int tun_chr_ioctl(struct inode *i
+@@ -688,6 +694,16 @@ static int tun_chr_ioctl(struct inode *i
  		DBG(KERN_INFO "%s: group set to %d\n", tun->dev->name, tun->group);
  		break;
  
@@ -2012,10 +1901,10 @@
 +		break;
 +
  	case TUNSETLINK:
- 		/* Only allow setting the type when the interface is down */
- 		if (tun->dev->flags & IFF_UP) {
+ 	{
+ 		int ret;
 --- a/fs/attr.c	2008-04-17 11:31:35.000000000 -0400
-+++ a/fs/attr.c	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/attr.c	2008-07-16 22:41:36.000000000 -0400
 @@ -14,6 +14,9 @@
  #include <linux/fcntl.h>
  #include <linux/quotaops.h>
@@ -2073,8 +1962,8 @@
  				error = DQUOT_TRANSFER(inode, attr) ? -EDQUOT : 0;
  			if (!error)
  				error = inode_setattr(inode, attr);
---- a/fs/binfmt_aout.c	2008-04-17 12:05:39.000000000 -0400
-+++ a/fs/binfmt_aout.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/binfmt_aout.c	2008-07-14 17:22:48.000000000 -0400
++++ a/fs/binfmt_aout.c	2008-07-16 22:41:36.000000000 -0400
 @@ -24,6 +24,7 @@
  #include <linux/binfmts.h>
  #include <linux/personality.h>
@@ -2083,9 +1972,9 @@
  
  #include <asm/system.h>
  #include <asm/uaccess.h>
---- a/fs/binfmt_elf.c	2008-04-17 12:05:39.000000000 -0400
-+++ a/fs/binfmt_elf.c	2008-04-19 15:14:52.000000000 -0400
-@@ -39,6 +39,7 @@
+--- a/fs/binfmt_elf.c	2008-07-14 17:22:48.000000000 -0400
++++ a/fs/binfmt_elf.c	2008-07-16 22:41:36.000000000 -0400
+@@ -38,6 +38,7 @@
  #include <linux/random.h>
  #include <linux/elf.h>
  #include <linux/utsname.h>
@@ -2093,8 +1982,8 @@
  #include <asm/uaccess.h>
  #include <asm/param.h>
  #include <asm/page.h>
---- a/fs/binfmt_flat.c	2008-04-17 12:05:39.000000000 -0400
-+++ a/fs/binfmt_flat.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/binfmt_flat.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/binfmt_flat.c	2008-07-16 22:41:36.000000000 -0400
 @@ -35,6 +35,7 @@
  #include <linux/init.h>
  #include <linux/flat.h>
@@ -2103,8 +1992,8 @@
  
  #include <asm/byteorder.h>
  #include <asm/system.h>
---- a/fs/binfmt_som.c	2008-04-17 12:05:39.000000000 -0400
-+++ a/fs/binfmt_som.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/binfmt_som.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/binfmt_som.c	2008-07-16 22:41:36.000000000 -0400
 @@ -28,6 +28,7 @@
  #include <linux/shm.h>
  #include <linux/personality.h>
@@ -2113,9 +2002,9 @@
  
  #include <asm/uaccess.h>
  #include <asm/pgtable.h>
---- a/fs/block_dev.c	2008-04-17 12:05:39.000000000 -0400
-+++ a/fs/block_dev.c	2008-04-19 15:14:52.000000000 -0400
-@@ -23,6 +23,7 @@
+--- a/fs/block_dev.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/block_dev.c	2008-07-16 22:41:36.000000000 -0400
+@@ -24,6 +24,7 @@
  #include <linux/uio.h>
  #include <linux/namei.h>
  #include <linux/log2.h>
@@ -2123,7 +2012,7 @@
  #include <asm/uaccess.h>
  #include "internal.h"
  
-@@ -388,6 +389,7 @@ struct block_device *bdget(dev_t dev)
+@@ -389,6 +390,7 @@ struct block_device *bdget(dev_t dev)
  		bdev->bd_invalidated = 0;
  		inode->i_mode = S_IFBLK;
  		inode->i_rdev = dev;
@@ -2131,7 +2020,7 @@
  		inode->i_bdev = bdev;
  		inode->i_data.a_ops = &def_blk_aops;
  		mapping_set_gfp_mask(&inode->i_data, GFP_USER);
-@@ -424,6 +426,11 @@ EXPORT_SYMBOL(bdput);
+@@ -425,6 +427,11 @@ EXPORT_SYMBOL(bdput);
  static struct block_device *bd_acquire(struct inode *inode)
  {
  	struct block_device *bdev;
@@ -2143,7 +2032,7 @@
  
  	spin_lock(&bdev_lock);
  	bdev = inode->i_bdev;
-@@ -434,7 +441,7 @@ static struct block_device *bd_acquire(s
+@@ -435,7 +442,7 @@ static struct block_device *bd_acquire(s
  	}
  	spin_unlock(&bdev_lock);
  
@@ -2152,8 +2041,8 @@
  	if (bdev) {
  		spin_lock(&bdev_lock);
  		if (!inode->i_bdev) {
---- a/fs/char_dev.c	2008-04-17 12:05:39.000000000 -0400
-+++ a/fs/char_dev.c	2008-04-29 18:44:50.000000000 -0400
+--- a/fs/char_dev.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/char_dev.c	2008-07-16 22:41:36.000000000 -0400
 @@ -21,6 +21,8 @@
  #include <linux/cdev.h>
  #include <linux/mutex.h>
@@ -2163,7 +2052,7 @@
  
  #ifdef CONFIG_KMOD
  #include <linux/kmod.h>
-@@ -362,14 +364,21 @@ static int chrdev_open(struct inode *ino
+@@ -361,14 +363,21 @@ static int chrdev_open(struct inode *ino
  	struct cdev *p;
  	struct cdev *new = NULL;
  	int ret = 0;
@@ -2186,9 +2075,9 @@
  		if (!kobj)
  			return -ENXIO;
  		new = container_of(kobj, struct cdev, kobj);
---- a/fs/dcache.c	2008-04-17 12:05:39.000000000 -0400
-+++ a/fs/dcache.c	2008-04-19 17:06:15.000000000 -0400
-@@ -31,6 +31,7 @@
+--- a/fs/dcache.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/dcache.c	2008-07-16 22:41:36.000000000 -0400
+@@ -32,6 +32,7 @@
  #include <linux/seqlock.h>
  #include <linux/swap.h>
  #include <linux/bootmem.h>
@@ -2196,7 +2085,7 @@
  #include "internal.h"
  
  
-@@ -184,6 +185,7 @@ void dput(struct dentry *dentry)
+@@ -187,6 +188,7 @@ void dput(struct dentry *dentry)
  	if (!dentry)
  		return;
  
@@ -2204,7 +2093,7 @@
  repeat:
  	if (atomic_read(&dentry->d_count) == 1)
  		might_sleep();
-@@ -197,6 +199,8 @@ repeat:
+@@ -200,6 +202,8 @@ repeat:
  		return;
  	}
  
@@ -2213,7 +2102,7 @@
  	/*
  	 * AV: ->d_delete() is _NOT_ allowed to block now.
  	 */
-@@ -288,6 +292,7 @@ static inline struct dentry * __dget_loc
+@@ -291,6 +295,7 @@ static inline struct dentry * __dget_loc
  {
  	atomic_inc(&dentry->d_count);
  	dentry_lru_remove(dentry);
@@ -2221,7 +2110,7 @@
  	return dentry;
  }
  
-@@ -885,6 +890,9 @@ struct dentry *d_alloc(struct dentry * p
+@@ -888,6 +893,9 @@ struct dentry *d_alloc(struct dentry * p
  	struct dentry *dentry;
  	char *dname;
  
@@ -2231,7 +2120,7 @@
  	dentry = kmem_cache_alloc(dentry_cache, GFP_KERNEL);
  	if (!dentry)
  		return NULL;
-@@ -933,6 +941,7 @@ struct dentry *d_alloc(struct dentry * p
+@@ -936,6 +944,7 @@ struct dentry *d_alloc(struct dentry * p
  	if (parent)
  		list_add(&dentry->d_u.d_child, &parent->d_subdirs);
  	dentry_stat.nr_dentry++;
@@ -2239,7 +2128,7 @@
  	spin_unlock(&dcache_lock);
  
  	return dentry;
-@@ -1282,6 +1291,7 @@ struct dentry * __d_lookup(struct dentry
+@@ -1285,6 +1294,7 @@ struct dentry * __d_lookup(struct dentry
  
  		if (!d_unhashed(dentry)) {
  			atomic_inc(&dentry->d_count);
@@ -2247,20 +2136,20 @@
  			found = dentry;
  		}
  		spin_unlock(&dentry->d_lock);
---- a/fs/devpts/inode.c	2008-04-17 12:05:39.000000000 -0400
-+++ a/fs/devpts/inode.c	2008-04-21 09:23:34.000000000 -0400
-@@ -17,15 +17,30 @@
- #include <linux/namei.h>
- #include <linux/mount.h>
+--- a/fs/devpts/inode.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/devpts/inode.c	2008-07-17 17:43:28.000000000 -0400
+@@ -19,15 +19,29 @@
  #include <linux/tty.h>
+ #include <linux/mutex.h>
+ #include <linux/idr.h>
 +#include <linux/magic.h>
  #include <linux/devpts_fs.h>
  #include <linux/parser.h>
  #include <linux/fsnotify.h>
  #include <linux/seq_file.h>
-+#include <linux/vs_base.h>
- 
+-
 -#define DEVPTS_SUPER_MAGIC 0x1cd1
++#include <linux/vs_base.h>
  
  #define DEVPTS_DEFAULT_MODE 0600
  
@@ -2278,10 +2167,10 @@
 +	.permission     = devpts_permission,
 +};
 +
- static struct vfsmount *devpts_mnt;
- static struct dentry *devpts_root;
- 
-@@ -106,6 +121,25 @@ static int devpts_show_options(struct se
+ extern int pty_limit;			/* Config limit on Unix98 ptys */
+ static DEFINE_IDR(allocated_ptys);
+ static DEFINE_MUTEX(allocated_ptys_lock);
+@@ -112,6 +126,25 @@ static int devpts_show_options(struct se
  	return 0;
  }
  
@@ -2307,7 +2196,7 @@
  static const struct super_operations devpts_sops = {
  	.statfs		= simple_statfs,
  	.remount_fs	= devpts_remount,
-@@ -132,8 +166,10 @@ devpts_fill_super(struct super_block *s,
+@@ -138,8 +171,10 @@ devpts_fill_super(struct super_block *s,
  	inode->i_uid = inode->i_gid = 0;
  	inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR;
  	inode->i_op = &simple_dir_inode_operations;
@@ -2319,7 +2208,7 @@
  
  	devpts_root = s->s_root = d_alloc_root(inode);
  	if (s->s_root)
-@@ -191,6 +227,9 @@ int devpts_pty_new(struct tty_struct *tt
+@@ -232,6 +267,9 @@ int devpts_pty_new(struct tty_struct *tt
  	inode->i_gid = config.setgid ? config.gid : current->fsgid;
  	inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
  	init_special_inode(inode, S_IFCHR|config.mode, device);
@@ -2329,65 +2218,9 @@
  	inode->i_private = tty;
  
  	dentry = get_node(number);
---- a/fs/ecryptfs/inode.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ecryptfs/inode.c	2008-04-19 15:14:52.000000000 -0400
-@@ -400,7 +400,7 @@ static int ecryptfs_link(struct dentry *
- 	dget(lower_new_dentry);
- 	lower_dir_dentry = lock_parent(lower_new_dentry);
- 	rc = vfs_link(lower_old_dentry, lower_dir_dentry->d_inode,
--		      lower_new_dentry);
-+		      lower_new_dentry, NULL);
- 	if (rc || !lower_new_dentry->d_inode)
- 		goto out_lock;
- 	rc = ecryptfs_interpose(lower_new_dentry, new_dentry, dir->i_sb, 0);
-@@ -428,7 +428,7 @@ static int ecryptfs_unlink(struct inode 
- 	struct dentry *lower_dir_dentry;
- 
- 	lower_dir_dentry = lock_parent(lower_dentry);
--	rc = vfs_unlink(lower_dir_inode, lower_dentry);
-+	rc = vfs_unlink(lower_dir_inode, lower_dentry, NULL);
- 	if (rc) {
- 		printk(KERN_ERR "Error in vfs_unlink; rc = [%d]\n", rc);
- 		goto out_unlock;
-@@ -466,7 +466,7 @@ static int ecryptfs_symlink(struct inode
- 		goto out_lock;
- 	}
- 	rc = vfs_symlink(lower_dir_dentry->d_inode, lower_dentry,
--			 encoded_symname, mode);
-+			 encoded_symname, mode, NULL);
- 	kfree(encoded_symname);
- 	if (rc || !lower_dentry->d_inode)
- 		goto out_lock;
-@@ -491,7 +491,7 @@ static int ecryptfs_mkdir(struct inode *
- 
- 	lower_dentry = ecryptfs_dentry_to_lower(dentry);
- 	lower_dir_dentry = lock_parent(lower_dentry);
--	rc = vfs_mkdir(lower_dir_dentry->d_inode, lower_dentry, mode);
-+	rc = vfs_mkdir(lower_dir_dentry->d_inode, lower_dentry, mode, NULL);
- 	if (rc || !lower_dentry->d_inode)
- 		goto out;
- 	rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb, 0);
-@@ -517,7 +517,7 @@ static int ecryptfs_rmdir(struct inode *
- 	dget(dentry);
- 	lower_dir_dentry = lock_parent(lower_dentry);
- 	dget(lower_dentry);
--	rc = vfs_rmdir(lower_dir_dentry->d_inode, lower_dentry);
-+	rc = vfs_rmdir(lower_dir_dentry->d_inode, lower_dentry, NULL);
- 	dput(lower_dentry);
- 	if (!rc)
- 		d_delete(lower_dentry);
-@@ -539,7 +539,7 @@ ecryptfs_mknod(struct inode *dir, struct
- 
- 	lower_dentry = ecryptfs_dentry_to_lower(dentry);
- 	lower_dir_dentry = lock_parent(lower_dentry);
--	rc = vfs_mknod(lower_dir_dentry->d_inode, lower_dentry, mode, dev);
-+	rc = vfs_mknod(lower_dir_dentry->d_inode, lower_dentry, mode, dev, NULL);
- 	if (rc || !lower_dentry->d_inode)
- 		goto out;
- 	rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb, 0);
---- a/fs/exec.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/exec.c	2008-04-19 15:14:52.000000000 -0400
-@@ -249,7 +249,9 @@ static int __bprm_mm_init(struct linux_b
+--- a/fs/exec.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/exec.c	2008-07-16 22:41:36.000000000 -0400
+@@ -254,7 +254,9 @@ static int __bprm_mm_init(struct linux_b
  		goto err;
  	}
  
@@ -2398,7 +2231,7 @@
  	up_write(&mm->mmap_sem);
  
  	bprm->p = vma->vm_end - sizeof(void *);
-@@ -1452,7 +1454,7 @@ static int format_corename(char *corenam
+@@ -1447,7 +1449,7 @@ static int format_corename(char *corenam
  			/* UNIX time of coredump */
  			case 't': {
  				struct timeval tv;
@@ -2407,8 +2240,8 @@
  				rc = snprintf(out_ptr, out_end - out_ptr,
  					      "%lu", tv.tv_sec);
  				if (rc > out_end - out_ptr)
---- a/fs/ext2/balloc.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext2/balloc.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/ext2/balloc.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext2/balloc.c	2008-07-16 22:41:36.000000000 -0400
 @@ -16,6 +16,8 @@
  #include <linux/sched.h>
  #include <linux/buffer_head.h>
@@ -2446,7 +2279,7 @@
  
  	sbi = EXT2_SB(sb);
  	es = EXT2_SB(sb)->s_es;
-@@ -1403,6 +1410,7 @@ allocated:
+@@ -1408,6 +1415,7 @@ allocated:
  
  	*errp = 0;
  	brelse(bitmap_bh);
@@ -2454,7 +2287,7 @@
  	DQUOT_FREE_BLOCK(inode, *count-num);
  	*count = num;
  	return ret_block;
-@@ -1413,8 +1421,10 @@ out:
+@@ -1418,8 +1426,10 @@ out:
  	/*
  	 * Undo the block allocation
  	 */
@@ -2467,7 +2300,7 @@
  	return 0;
  }
 --- a/fs/ext2/ext2.h	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext2/ext2.h	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/ext2/ext2.h	2008-07-16 22:41:36.000000000 -0400
 @@ -168,6 +168,7 @@ extern const struct file_operations ext2
  extern const struct address_space_operations ext2_aops;
  extern const struct address_space_operations ext2_aops_xip;
@@ -2477,15 +2310,15 @@
  /* namei.c */
  extern const struct inode_operations ext2_dir_inode_operations;
 --- a/fs/ext2/file.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext2/file.c	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/ext2/file.c	2008-07-16 22:41:36.000000000 -0400
 @@ -86,4 +86,5 @@ const struct inode_operations ext2_file_
  #endif
  	.setattr	= ext2_setattr,
  	.permission	= ext2_permission,
 +	.sync_flags	= ext2_sync_flags,
  };
---- a/fs/ext2/ialloc.c	2008-04-17 11:31:35.000000000 -0400
-+++ a/fs/ext2/ialloc.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/ext2/ialloc.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext2/ialloc.c	2008-07-16 22:41:36.000000000 -0400
 @@ -17,6 +17,8 @@
  #include <linux/backing-dev.h>
  #include <linux/buffer_head.h>
@@ -2495,7 +2328,7 @@
  #include "ext2.h"
  #include "xattr.h"
  #include "acl.h"
-@@ -125,6 +127,7 @@ void ext2_free_inode (struct inode * ino
+@@ -123,6 +125,7 @@ void ext2_free_inode (struct inode * ino
  		ext2_xattr_delete_inode(inode);
  	    	DQUOT_FREE_INODE(inode);
  		DQUOT_DROP(inode);
@@ -2503,7 +2336,7 @@
  	}
  
  	es = EXT2_SB(sb)->s_es;
-@@ -456,6 +459,11 @@ struct inode *ext2_new_inode(struct inod
+@@ -454,6 +457,11 @@ struct inode *ext2_new_inode(struct inod
  	if (!inode)
  		return ERR_PTR(-ENOMEM);
  
@@ -2515,17 +2348,17 @@
  	ei = EXT2_I(inode);
  	sbi = EXT2_SB(sb);
  	es = sbi->s_es;
-@@ -569,7 +577,8 @@ got:
+@@ -565,7 +573,8 @@ got:
  	inode->i_blocks = 0;
  	inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME_SEC;
  	memset(ei->i_data, 0, sizeof(ei->i_data));
 -	ei->i_flags = EXT2_I(dir)->i_flags & ~EXT2_BTREE_FL;
 +	ei->i_flags = EXT2_I(dir)->i_flags &
-+		~(EXT2_BTREE_FL|EXT2_IUNLINK_FL|EXT2_BARRIER_FL);
++		~(EXT2_BTREE_FL|EXT2_IXUNLINK_FL|EXT2_BARRIER_FL);
  	if (S_ISLNK(mode))
  		ei->i_flags &= ~(EXT2_IMMUTABLE_FL|EXT2_APPEND_FL);
  	/* dirsync is only applied to directories */
-@@ -614,12 +623,15 @@ fail_free_drop:
+@@ -610,12 +619,15 @@ fail_free_drop:
  
  fail_drop:
  	DQUOT_DROP(inode);
@@ -2541,8 +2374,8 @@
  	make_bad_inode(inode);
  	iput(inode);
  	return ERR_PTR(err);
---- a/fs/ext2/inode.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext2/inode.c	2008-04-21 10:14:57.000000000 -0400
+--- a/fs/ext2/inode.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext2/inode.c	2008-07-16 22:41:36.000000000 -0400
 @@ -31,6 +31,7 @@
  #include <linux/writeback.h>
  #include <linux/buffer_head.h>
@@ -2551,7 +2384,7 @@
  #include "ext2.h"
  #include "acl.h"
  #include "xip.h"
-@@ -1011,7 +1012,7 @@ void ext2_truncate(struct inode *inode)
+@@ -1010,7 +1011,7 @@ void ext2_truncate(struct inode *inode)
  		return;
  	if (ext2_inode_is_fast_symlink(inode))
  		return;
@@ -2560,20 +2393,19 @@
  		return;
  
  	blocksize = inode->i_sb->s_blocksize;
-@@ -1149,13 +1150,20 @@ void ext2_set_inode_flags(struct inode *
+@@ -1148,38 +1149,72 @@ 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_IUNLINK | S_BARRIER |
++	inode->i_flags &= ~(S_IMMUTABLE | S_IXUNLINK |
 +		S_SYNC | S_APPEND | S_NOATIME | S_DIRSYNC);
 +
++
 +	if (flags & EXT2_IMMUTABLE_FL)
 +		inode->i_flags |= S_IMMUTABLE;
-+	if (flags & EXT2_IUNLINK_FL)
-+		inode->i_flags |= S_IUNLINK;
-+	if (flags & EXT2_BARRIER_FL)
-+		inode->i_flags |= S_BARRIER;
++	if (flags & EXT2_IXUNLINK_FL)
++		inode->i_flags |= S_IXUNLINK;
 +
  	if (flags & EXT2_SYNC_FL)
  		inode->i_flags |= S_SYNC;
@@ -2584,30 +2416,56 @@
  	if (flags & EXT2_NOATIME_FL)
  		inode->i_flags |= S_NOATIME;
  	if (flags & EXT2_DIRSYNC_FL)
-@@ -1181,6 +1189,30 @@ void ext2_get_inode_flags(struct ext2_in
+ 		inode->i_flags |= S_DIRSYNC;
++
++	inode->i_vflags &= ~(V_BARRIER | V_COW);
++
++	if (flags & EXT2_BARRIER_FL)
++		inode->i_vflags |= V_BARRIER;
++	if (flags & EXT2_COW_FL)
++		inode->i_vflags |= V_COW;
+ }
+ 
+ /* Propagate flags from i_flags to EXT2_I(inode)->i_flags */
+ void ext2_get_inode_flags(struct ext2_inode_info *ei)
+ {
+ 	unsigned int flags = ei->vfs_inode.i_flags;
++	unsigned int vflags = ei->vfs_inode.i_vflags;
++
++	ei->i_flags &= ~(EXT2_SYNC_FL | EXT2_APPEND_FL |
++			EXT2_IMMUTABLE_FL | EXT2_IXUNLINK_FL |
++			EXT2_NOATIME_FL | EXT2_DIRSYNC_FL |
++			EXT2_BARRIER_FL | EXT2_COW_FL);
++
++	if (flags & S_IMMUTABLE)
++		ei->i_flags |= EXT2_IMMUTABLE_FL;
++	if (flags & S_IXUNLINK)
++		ei->i_flags |= EXT2_IXUNLINK_FL;
+ 
+-	ei->i_flags &= ~(EXT2_SYNC_FL|EXT2_APPEND_FL|
+-			EXT2_IMMUTABLE_FL|EXT2_NOATIME_FL|EXT2_DIRSYNC_FL);
+ 	if (flags & S_SYNC)
+ 		ei->i_flags |= EXT2_SYNC_FL;
+ 	if (flags & S_APPEND)
+ 		ei->i_flags |= EXT2_APPEND_FL;
+-	if (flags & S_IMMUTABLE)
+-		ei->i_flags |= EXT2_IMMUTABLE_FL;
+ 	if (flags & S_NOATIME)
+ 		ei->i_flags |= EXT2_NOATIME_FL;
+ 	if (flags & S_DIRSYNC)
  		ei->i_flags |= EXT2_DIRSYNC_FL;
++
++	if (vflags & V_BARRIER)
++		ei->i_flags |= EXT2_BARRIER_FL;
++	if (vflags & V_COW)
++		ei->i_flags |= EXT2_COW_FL;
  }
  
 +int ext2_sync_flags(struct inode *inode)
 +{
-+	unsigned int oldflags, newflags;
-+
-+	oldflags = EXT2_I(inode)->i_flags;
-+	newflags = oldflags & ~(EXT2_IMMUTABLE_FL |
-+		EXT2_IUNLINK_FL | EXT2_BARRIER_FL);
-+
-+	if (IS_IMMUTABLE(inode))
-+		newflags |= EXT2_IMMUTABLE_FL;
-+	if (IS_IUNLINK(inode))
-+		newflags |= EXT2_IUNLINK_FL;
-+	if (IS_BARRIER(inode))
-+		newflags |= EXT2_BARRIER_FL;
-+
-+	if (oldflags ^ newflags) {
-+		EXT2_I(inode)->i_flags = newflags;
-+		inode->i_ctime = CURRENT_TIME;
-+		mark_inode_dirty(inode);
-+	}
++	ext2_get_inode_flags(EXT2_I(inode));
++	inode->i_ctime = CURRENT_TIME;
++	mark_inode_dirty(inode);
 +	return 0;
 +}
 +
@@ -2615,7 +2473,7 @@
  struct inode *ext2_iget (struct super_block *sb, unsigned long ino)
  {
  	struct ext2_inode_info *ei;
-@@ -1188,6 +1220,8 @@ struct inode *ext2_iget (struct super_bl
+@@ -1187,6 +1222,8 @@ struct inode *ext2_iget (struct super_bl
  	struct ext2_inode *raw_inode;
  	struct inode *inode;
  	long ret = -EIO;
@@ -2624,7 +2482,7 @@
  	int n;
  
  	inode = iget_locked(sb, ino);
-@@ -1210,12 +1244,17 @@ struct inode *ext2_iget (struct super_bl
+@@ -1209,12 +1246,17 @@ struct inode *ext2_iget (struct super_bl
  	}
  
  	inode->i_mode = le16_to_cpu(raw_inode->i_mode);
@@ -2646,7 +2504,7 @@
  	inode->i_nlink = 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);
-@@ -1311,8 +1350,8 @@ static int ext2_update_inode(struct inod
+@@ -1310,8 +1352,8 @@ static int ext2_update_inode(struct inod
  	struct ext2_inode_info *ei = EXT2_I(inode);
  	struct super_block *sb = inode->i_sb;
  	ino_t ino = inode->i_ino;
@@ -2657,7 +2515,7 @@
  	struct buffer_head * bh;
  	struct ext2_inode * raw_inode = ext2_get_inode(sb, ino, &bh);
  	int n;
-@@ -1348,6 +1387,9 @@ static int ext2_update_inode(struct inod
+@@ -1347,6 +1389,9 @@ static int ext2_update_inode(struct inod
  		raw_inode->i_uid_high = 0;
  		raw_inode->i_gid_high = 0;
  	}
@@ -2667,7 +2525,7 @@
  	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);
-@@ -1434,7 +1476,8 @@ int ext2_setattr(struct dentry *dentry, 
+@@ -1433,7 +1478,8 @@ int ext2_setattr(struct dentry *dentry, 
  	if (error)
  		return error;
  	if ((iattr->ia_valid & ATTR_UID && iattr->ia_uid != inode->i_uid) ||
@@ -2677,49 +2535,41 @@
  		error = DQUOT_TRANSFER(inode, iattr) ? -EDQUOT : 0;
  		if (error)
  			return error;
---- a/fs/ext2/ioctl.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext2/ioctl.c	2008-04-19 15:14:52.000000000 -0400
-@@ -13,6 +13,7 @@
- #include <linux/sched.h>
+--- a/fs/ext2/ioctl.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext2/ioctl.c	2008-07-16 22:41:36.000000000 -0400
+@@ -14,6 +14,7 @@
  #include <linux/compat.h>
+ #include <linux/mount.h>
  #include <linux/smp_lock.h>
 +#include <linux/mount.h>
  #include <asm/current.h>
  #include <asm/uaccess.h>
  
-@@ -34,7 +35,8 @@ long ext2_ioctl(struct file *filp, unsig
- 	case EXT2_IOC_SETFLAGS: {
- 		unsigned int oldflags;
- 
--		if (IS_RDONLY(inode))
-+		if (IS_RDONLY(inode) ||
-+			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
- 			return -EROFS;
- 
- 		if (!is_owner_or_cap(inode))
-@@ -60,7 +62,9 @@ long ext2_ioctl(struct file *filp, unsig
+@@ -53,6 +54,11 @@ long ext2_ioctl(struct file *filp, unsig
+ 		if (!S_ISDIR(inode->i_mode))
+ 			flags &= ~EXT2_DIRSYNC_FL;
+ 
++		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 */
+ 		if (IS_NOQUOTA(inode)) {
+@@ -68,7 +74,9 @@ long ext2_ioctl(struct file *filp, unsig
  		 *
  		 * This test looks nicer. Thanks to Pauline Middelink
  		 */
 -		if ((flags ^ oldflags) & (EXT2_APPEND_FL | EXT2_IMMUTABLE_FL)) {
 +		if ((oldflags & EXT2_IMMUTABLE_FL) ||
 +			((flags ^ oldflags) & (EXT2_APPEND_FL |
-+			EXT2_IMMUTABLE_FL | EXT2_IUNLINK_FL))) {
++			EXT2_IMMUTABLE_FL | EXT2_IXUNLINK_FL))) {
  			if (!capable(CAP_LINUX_IMMUTABLE)) {
  				mutex_unlock(&inode->i_mutex);
- 				return -EPERM;
-@@ -82,7 +86,8 @@ long ext2_ioctl(struct file *filp, unsig
- 	case EXT2_IOC_SETVERSION:
- 		if (!is_owner_or_cap(inode))
- 			return -EPERM;
--		if (IS_RDONLY(inode))
-+		if (IS_RDONLY(inode) ||
-+			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
- 			return -EROFS;
- 		if (get_user(inode->i_generation, (int __user *) arg))
- 			return -EFAULT;	
+ 				ret = -EPERM;
 --- a/fs/ext2/namei.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext2/namei.c	2008-04-21 10:12:49.000000000 -0400
++++ a/fs/ext2/namei.c	2008-07-16 22:41:36.000000000 -0400
 @@ -31,6 +31,7 @@
   */
  
@@ -2750,9 +2600,9 @@
  	.permission	= ext2_permission,
 +	.sync_flags	= ext2_sync_flags,
  };
---- a/fs/ext2/super.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext2/super.c	2008-04-19 15:14:52.000000000 -0400
-@@ -390,7 +390,8 @@ enum {
+--- a/fs/ext2/super.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext2/super.c	2008-07-16 22:41:36.000000000 -0400
+@@ -389,7 +389,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,
@@ -2762,7 +2612,7 @@
  };
  
  static match_table_t tokens = {
-@@ -418,6 +419,9 @@ static match_table_t tokens = {
+@@ -417,6 +418,9 @@ static match_table_t tokens = {
  	{Opt_acl, "acl"},
  	{Opt_noacl, "noacl"},
  	{Opt_xip, "xip"},
@@ -2772,7 +2622,7 @@
  	{Opt_grpquota, "grpquota"},
  	{Opt_ignore, "noquota"},
  	{Opt_quota, "quota"},
-@@ -488,6 +492,20 @@ static int parse_options (char * options
+@@ -487,6 +491,20 @@ static int parse_options (char * options
  		case Opt_nouid32:
  			set_opt (sbi->s_mount_opt, NO_UID32);
  			break;
@@ -2793,7 +2643,7 @@
  		case Opt_nocheck:
  			clear_opt (sbi->s_mount_opt, CHECK);
  			break;
-@@ -831,6 +849,8 @@ static int ext2_fill_super(struct super_
+@@ -829,6 +847,8 @@ static int ext2_fill_super(struct super_
  	if (!parse_options ((char *) data, sbi))
  		goto failed_mount;
  
@@ -2802,7 +2652,7 @@
  	sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
  		((EXT2_SB(sb)->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ?
  		 MS_POSIXACL : 0);
-@@ -1164,6 +1184,13 @@ static int ext2_remount (struct super_bl
+@@ -1161,6 +1181,13 @@ static int ext2_remount (struct super_bl
  		goto restore_opts;
  	}
  
@@ -2817,7 +2667,7 @@
  		((sbi->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
  
 --- a/fs/ext2/symlink.c	2008-04-17 10:32:27.000000000 -0400
-+++ a/fs/ext2/symlink.c	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/ext2/symlink.c	2008-07-16 22:41:36.000000000 -0400
 @@ -38,6 +38,7 @@ const struct inode_operations ext2_symli
  	.listxattr	= ext2_listxattr,
  	.removexattr	= generic_removexattr,
@@ -2832,8 +2682,8 @@
  #endif
 +	.sync_flags	= ext2_sync_flags,
  };
---- a/fs/ext2/xattr.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext2/xattr.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/ext2/xattr.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext2/xattr.c	2008-07-16 22:41:36.000000000 -0400
 @@ -60,6 +60,7 @@
  #include <linux/mbcache.h>
  #include <linux/quotaops.h>
@@ -2855,15 +2705,15 @@
  					unlock_buffer(new_bh);
  					goto cleanup;
  				}
-@@ -735,6 +740,7 @@ ext2_xattr_set2(struct inode *inode, str
- 				le32_to_cpu(HDR(old_bh)->h_refcount) - 1);
+@@ -731,6 +736,7 @@ ext2_xattr_set2(struct inode *inode, str
+ 			le32_add_cpu(&HDR(old_bh)->h_refcount, -1);
  			if (ce)
  				mb_cache_entry_release(ce);
 +			DLIMIT_FREE_BLOCK(inode, 1);
  			DQUOT_FREE_BLOCK(inode, 1);
  			mark_buffer_dirty(old_bh);
  			ea_bdebug(old_bh, "refcount now=%d",
-@@ -799,6 +805,7 @@ ext2_xattr_delete_inode(struct inode *in
+@@ -794,6 +800,7 @@ ext2_xattr_delete_inode(struct inode *in
  		mark_buffer_dirty(bh);
  		if (IS_SYNC(inode))
  			sync_dirty_buffer(bh);
@@ -2871,8 +2721,8 @@
  		DQUOT_FREE_BLOCK(inode, 1);
  	}
  	EXT2_I(inode)->i_file_acl = 0;
---- a/fs/ext3/balloc.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext3/balloc.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/ext3/balloc.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext3/balloc.c	2008-07-16 22:41:36.000000000 -0400
 @@ -19,6 +19,8 @@
  #include <linux/ext3_jbd.h>
  #include <linux/quotaops.h>
@@ -2962,7 +2812,7 @@
  		*errp = -ENOSPC;
  		goto out;
  	}
-@@ -1710,12 +1731,16 @@ allocated:
+@@ -1714,12 +1735,16 @@ allocated:
  	*errp = 0;
  	brelse(bitmap_bh);
  	DQUOT_FREE_BLOCK(inode, *count-num);
@@ -2980,7 +2830,7 @@
  		*errp = fatal;
  		ext3_std_error(sb, fatal);
 --- a/fs/ext3/file.c	2008-04-17 10:37:23.000000000 -0400
-+++ a/fs/ext3/file.c	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/ext3/file.c	2008-07-16 22:41:36.000000000 -0400
 @@ -134,5 +134,6 @@ const struct inode_operations ext3_file_
  	.removexattr	= generic_removexattr,
  #endif
@@ -2988,8 +2838,8 @@
 +	.sync_flags	= ext3_sync_flags,
  };
  
---- a/fs/ext3/ialloc.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext3/ialloc.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/ext3/ialloc.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext3/ialloc.c	2008-07-16 22:41:36.000000000 -0400
 @@ -23,6 +23,8 @@
  #include <linux/buffer_head.h>
  #include <linux/random.h>
@@ -3026,7 +2876,7 @@
  
 -	ei->i_flags = EXT3_I(dir)->i_flags & ~EXT3_INDEX_FL;
 +	ei->i_flags = EXT3_I(dir)->i_flags &
-+		~(EXT3_INDEX_FL|EXT3_IUNLINK_FL|EXT3_BARRIER_FL);
++		~(EXT3_INDEX_FL|EXT3_IXUNLINK_FL|EXT3_BARRIER_FL);
  	if (S_ISLNK(mode))
  		ei->i_flags &= ~(EXT3_IMMUTABLE_FL|EXT3_APPEND_FL);
  	/* dirsync only applies to directories */
@@ -3047,8 +2897,8 @@
  	inode->i_flags |= S_NOQUOTA;
  	inode->i_nlink = 0;
  	iput(inode);
---- a/fs/ext3/inode.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext3/inode.c	2008-04-20 13:25:49.000000000 -0400
+--- a/fs/ext3/inode.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext3/inode.c	2008-07-16 22:41:36.000000000 -0400
 @@ -36,6 +36,7 @@
  #include <linux/mpage.h>
  #include <linux/uio.h>
@@ -3057,7 +2907,7 @@
  #include "xattr.h"
  #include "acl.h"
  
-@@ -2300,7 +2301,7 @@ void ext3_truncate(struct inode *inode)
+@@ -2302,7 +2303,7 @@ void ext3_truncate(struct inode *inode)
  		return;
  	if (ext3_inode_is_fast_symlink(inode))
  		return;
@@ -3066,20 +2916,18 @@
  		return;
  
  	/*
-@@ -2622,13 +2623,20 @@ void ext3_set_inode_flags(struct inode *
+@@ -2611,36 +2612,84 @@ 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_IUNLINK | S_BARRIER |
++	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_IUNLINK_FL)
-+		inode->i_flags |= S_IUNLINK;
-+	if (flags & EXT3_BARRIER_FL)
-+		inode->i_flags |= S_BARRIER;
++	if (flags & EXT3_IXUNLINK_FL)
++		inode->i_flags |= S_IXUNLINK;
 +
  	if (flags & EXT3_SYNC_FL)
  		inode->i_flags |= S_SYNC;
@@ -3090,53 +2938,77 @@
  	if (flags & EXT3_NOATIME_FL)
  		inode->i_flags |= S_NOATIME;
  	if (flags & EXT3_DIRSYNC_FL)
-@@ -2654,6 +2662,45 @@ void ext3_get_inode_flags(struct ext3_in
+ 		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;
- }
- 
-+int ext3_sync_flags(struct inode *inode)
-+{
-+	unsigned int oldflags, newflags;
-+	int err = 0;
 +
-+	oldflags = EXT3_I(inode)->i_flags;
-+	newflags = oldflags & ~(EXT3_IMMUTABLE_FL |
-+		EXT3_IUNLINK_FL | EXT3_BARRIER_FL);
-+
-+	if (IS_IMMUTABLE(inode))
-+		newflags |= EXT3_IMMUTABLE_FL;
-+	if (IS_IUNLINK(inode))
-+		newflags |= EXT3_IUNLINK_FL;
-+	if (IS_BARRIER(inode))
-+		newflags |= EXT3_BARRIER_FL;
++	if (vflags & V_BARRIER)
++		ei->i_flags |= EXT3_BARRIER_FL;
++	if (vflags & V_COW)
++		ei->i_flags |= EXT3_COW_FL;
++}
 +
-+	if (oldflags ^ newflags) {
-+		handle_t *handle;
-+		struct ext3_iloc iloc;
++int ext3_sync_flags(struct inode *inode)
++{
++	struct ext3_iloc iloc;
++	handle_t *handle;
++	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;
++	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;
 +
-+		EXT3_I(inode)->i_flags = newflags;
-+		inode->i_ctime = CURRENT_TIME;
++	ext3_get_inode_flags(EXT3_I(inode));
++	inode->i_ctime = CURRENT_TIME;
 +
-+		err = ext3_mark_iloc_dirty(handle, inode, &iloc);
-+	flags_err:
-+		ext3_journal_stop(handle);
-+	}
++	err = ext3_mark_iloc_dirty(handle, inode, &iloc);
++flags_err:
++	ext3_journal_stop(handle);
 +	return err;
-+}
-+
+ }
+ 
  struct inode *ext3_iget(struct super_block *sb, unsigned long ino)
- {
- 	struct ext3_iloc iloc;
-@@ -2663,6 +2710,8 @@ struct inode *ext3_iget(struct super_blo
+@@ -2652,6 +2701,8 @@ struct inode *ext3_iget(struct super_blo
  	struct inode *inode;
  	long ret;
  	int block;
@@ -3145,7 +3017,7 @@
  
  	inode = iget_locked(sb, ino);
  	if (!inode)
-@@ -2683,12 +2732,17 @@ struct inode *ext3_iget(struct super_blo
+@@ -2672,12 +2723,17 @@ struct inode *ext3_iget(struct super_blo
  	bh = iloc.bh;
  	raw_inode = ext3_raw_inode(&iloc);
  	inode->i_mode = le16_to_cpu(raw_inode->i_mode);
@@ -3167,7 +3039,7 @@
  	inode->i_nlink = 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);
-@@ -2817,6 +2871,8 @@ static int ext3_do_update_inode(handle_t
+@@ -2806,6 +2862,8 @@ static int ext3_do_update_inode(handle_t
  	struct ext3_inode *raw_inode = ext3_raw_inode(iloc);
  	struct ext3_inode_info *ei = EXT3_I(inode);
  	struct buffer_head *bh = iloc->bh;
@@ -3176,7 +3048,7 @@
  	int err = 0, rc, block;
  
  	/* For fields not not tracking in the in-memory inode,
-@@ -2827,29 +2883,32 @@ static int ext3_do_update_inode(handle_t
+@@ -2816,29 +2874,32 @@ static int ext3_do_update_inode(handle_t
  	ext3_get_inode_flags(ei);
  	raw_inode->i_mode = cpu_to_le16(inode->i_mode);
  	if(!(test_opt(inode->i_sb, NO_UID32))) {
@@ -3215,7 +3087,7 @@
  	raw_inode->i_links_count = cpu_to_le16(inode->i_nlink);
  	raw_inode->i_size = cpu_to_le32(ei->i_disksize);
  	raw_inode->i_atime = cpu_to_le32(inode->i_atime.tv_sec);
-@@ -3002,7 +3061,8 @@ int ext3_setattr(struct dentry *dentry, 
+@@ -2991,7 +3052,8 @@ int ext3_setattr(struct dentry *dentry, 
  		return error;
  
  	if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) ||
@@ -3225,7 +3097,7 @@
  		handle_t *handle;
  
  		/* (user+group)*(old+new) structure, inode write (sb,
-@@ -3024,6 +3084,8 @@ int ext3_setattr(struct dentry *dentry, 
+@@ -3013,6 +3075,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;
@@ -3234,8 +3106,8 @@
  		error = ext3_mark_inode_dirty(handle, inode);
  		ext3_journal_stop(handle);
  	}
---- a/fs/ext3/ioctl.c	2008-04-17 11:31:35.000000000 -0400
-+++ a/fs/ext3/ioctl.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/ext3/ioctl.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext3/ioctl.c	2008-07-16 22:41:36.000000000 -0400
 @@ -8,6 +8,7 @@
   */
  
@@ -3244,7 +3116,7 @@
  #include <linux/jbd.h>
  #include <linux/capability.h>
  #include <linux/ext3_fs.h>
-@@ -15,6 +16,7 @@
+@@ -16,6 +17,7 @@
  #include <linux/time.h>
  #include <linux/compat.h>
  #include <linux/smp_lock.h>
@@ -3252,69 +3124,31 @@
  #include <asm/uaccess.h>
  
  int ext3_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
-@@ -38,7 +40,8 @@ int ext3_ioctl (struct inode * inode, st
- 		unsigned int oldflags;
- 		unsigned int jflag;
- 
--		if (IS_RDONLY(inode))
-+		if (IS_RDONLY(inode) ||
-+			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
- 			return -EROFS;
- 
- 		if (!is_owner_or_cap(inode))
-@@ -67,7 +70,9 @@ int ext3_ioctl (struct inode * inode, st
+@@ -56,6 +58,11 @@ int ext3_ioctl (struct inode * inode, st
+ 		if (!S_ISDIR(inode->i_mode))
+ 			flags &= ~EXT3_DIRSYNC_FL;
+ 
++		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 */
+ 		if (IS_NOQUOTA(inode)) {
+@@ -74,7 +81,9 @@ int ext3_ioctl (struct inode * inode, st
  		 *
  		 * 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_IUNLINK_FL))) {
++			EXT3_IMMUTABLE_FL | EXT3_IXUNLINK_FL))) {
  			if (!capable(CAP_LINUX_IMMUTABLE)) {
  				mutex_unlock(&inode->i_mutex);
- 				return -EPERM;
-@@ -129,7 +134,8 @@ flags_err:
- 
- 		if (!is_owner_or_cap(inode))
- 			return -EPERM;
--		if (IS_RDONLY(inode))
-+		if (IS_RDONLY(inode) ||
-+			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
- 			return -EROFS;
- 		if (get_user(generation, (int __user *) arg))
- 			return -EFAULT;
-@@ -183,7 +189,8 @@ flags_err:
- 		if (!test_opt(inode->i_sb, RESERVATION) ||!S_ISREG(inode->i_mode))
- 			return -ENOTTY;
- 
--		if (IS_RDONLY(inode))
-+		if (IS_RDONLY(inode) ||
-+			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
- 			return -EROFS;
- 
- 		if (!is_owner_or_cap(inode))
-@@ -218,7 +225,8 @@ flags_err:
- 		if (!capable(CAP_SYS_RESOURCE))
- 			return -EPERM;
- 
--		if (IS_RDONLY(inode))
-+		if (IS_RDONLY(inode) ||
-+			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
- 			return -EROFS;
- 
- 		if (get_user(n_blocks_count, (__u32 __user *)arg))
-@@ -239,7 +247,8 @@ flags_err:
- 		if (!capable(CAP_SYS_RESOURCE))
- 			return -EPERM;
- 
--		if (IS_RDONLY(inode))
-+		if (IS_RDONLY(inode) ||
-+			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
- 			return -EROFS;
- 
- 		if (copy_from_user(&input, (struct ext3_new_group_input __user *)arg,
---- a/fs/ext3/namei.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext3/namei.c	2008-04-19 15:14:52.000000000 -0400
+ 				err = -EPERM;
+--- a/fs/ext3/namei.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext3/namei.c	2008-07-16 22:41:36.000000000 -0400
 @@ -36,6 +36,7 @@
  #include <linux/quotaops.h>
  #include <linux/buffer_head.h>
@@ -3323,7 +3157,7 @@
  
  #include "namei.h"
  #include "xattr.h"
-@@ -907,6 +908,7 @@ restart:
+@@ -912,6 +913,7 @@ restart:
  				if (bh)
  					ll_rw_block(READ_META, 1, &bh);
  			}
@@ -3331,7 +3165,7 @@
  		}
  		if ((bh = bh_use[ra_ptr++]) == NULL)
  			goto next;
-@@ -2417,6 +2419,7 @@ const struct inode_operations ext3_dir_i
+@@ -2424,6 +2426,7 @@ const struct inode_operations ext3_dir_i
  	.removexattr	= generic_removexattr,
  #endif
  	.permission	= ext3_permission,
@@ -3339,15 +3173,15 @@
  };
  
  const struct inode_operations ext3_special_inode_operations = {
-@@ -2428,4 +2431,5 @@ const struct inode_operations ext3_speci
+@@ -2435,4 +2438,5 @@ const struct inode_operations ext3_speci
  	.removexattr	= generic_removexattr,
  #endif
  	.permission	= ext3_permission,
 +	.sync_flags	= ext3_sync_flags,
  };
---- a/fs/ext3/super.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext3/super.c	2008-04-20 13:26:55.000000000 -0400
-@@ -756,7 +756,7 @@ enum {
+--- a/fs/ext3/super.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext3/super.c	2008-07-17 17:20:52.000000000 -0400
+@@ -757,7 +757,7 @@ enum {
  	Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota,
  	Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota,
  	Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
@@ -3356,7 +3190,7 @@
  };
  
  static match_table_t tokens = {
-@@ -807,6 +807,9 @@ static match_table_t tokens = {
+@@ -808,6 +808,9 @@ static match_table_t tokens = {
  	{Opt_usrquota, "usrquota"},
  	{Opt_barrier, "barrier=%u"},
  	{Opt_resize, "resize"},
@@ -3366,7 +3200,7 @@
  	{Opt_err, NULL},
  };
  
-@@ -899,6 +902,20 @@ static int parse_options (char *options,
+@@ -900,6 +903,20 @@ static int parse_options (char *options,
  		case Opt_nouid32:
  			set_opt (sbi->s_mount_opt, NO_UID32);
  			break;
@@ -3387,7 +3221,7 @@
  		case Opt_nocheck:
  			clear_opt (sbi->s_mount_opt, CHECK);
  			break;
-@@ -1591,6 +1608,9 @@ static int ext3_fill_super (struct super
+@@ -1594,6 +1611,9 @@ static int ext3_fill_super (struct super
  			    NULL, 0))
  		goto failed_mount;
  
@@ -3397,21 +3231,22 @@
  	sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
  		((sbi->s_mount_opt & EXT3_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
  
-@@ -2428,6 +2448,12 @@ static int ext3_remount (struct super_bl
- 
+@@ -2432,6 +2452,13 @@ static int ext3_remount (struct super_bl
  	if (sbi->s_mount_opt & EXT3_MOUNT_ABORT)
- 		ext3_abort(sb, __FUNCTION__, "Abort forced by user");
+ 		ext3_abort(sb, __func__, "Abort forced by user");
+ 
 +	if ((sbi->s_mount_opt & EXT3_MOUNT_TAGGED) &&
 +		!(sb->s_flags & MS_TAGGED)) {
 +		printk("EXT3-fs: %s: tagging not permitted on remount.\n",
 +			sb->s_id);
 +		return -EINVAL;
 +	}
- 
++
  	sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
  		((sbi->s_mount_opt & EXT3_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
+ 
 --- a/fs/ext3/symlink.c	2008-04-17 10:32:27.000000000 -0400
-+++ a/fs/ext3/symlink.c	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/ext3/symlink.c	2008-07-16 22:41:36.000000000 -0400
 @@ -40,6 +40,7 @@ const struct inode_operations ext3_symli
  	.listxattr	= ext3_listxattr,
  	.removexattr	= generic_removexattr,
@@ -3426,8 +3261,8 @@
  #endif
 +	.sync_flags	= ext3_sync_flags,
  };
---- a/fs/ext3/xattr.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext3/xattr.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/ext3/xattr.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext3/xattr.c	2008-07-16 22:41:36.000000000 -0400
 @@ -58,6 +58,7 @@
  #include <linux/mbcache.h>
  #include <linux/quotaops.h>
@@ -3436,7 +3271,7 @@
  #include "xattr.h"
  #include "acl.h"
  
-@@ -496,6 +497,7 @@ ext3_xattr_release_block(handle_t *handl
+@@ -498,6 +499,7 @@ ext3_xattr_release_block(handle_t *handl
  		error = ext3_journal_dirty_metadata(handle, bh);
  		if (IS_SYNC(inode))
  			handle->h_sync = 1;
@@ -3444,7 +3279,7 @@
  		DQUOT_FREE_BLOCK(inode, 1);
  		ea_bdebug(bh, "refcount now=%d; releasing",
  			  le32_to_cpu(BHDR(bh)->h_refcount));
-@@ -769,11 +771,14 @@ inserted:
+@@ -771,11 +773,14 @@ inserted:
  			if (new_bh == bs->bh)
  				ea_bdebug(new_bh, "keeping");
  			else {
@@ -3469,18 +3304,18 @@
  	goto cleanup;
  
  bad_block:
---- a/fs/ext4/balloc.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext4/balloc.c	2008-04-21 10:23:33.000000000 -0400
-@@ -19,6 +19,8 @@
- #include <linux/ext4_jbd2.h>
+--- a/fs/ext4/balloc.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext4/balloc.c	2008-07-17 20:27:00.000000000 -0400
+@@ -17,6 +17,8 @@
+ #include <linux/jbd2.h>
  #include <linux/quotaops.h>
  #include <linux/buffer_head.h>
 +#include <linux/vs_dlimit.h>
 +#include <linux/vs_tag.h>
- 
+ #include "ext4.h"
+ #include "ext4_jbd2.h"
  #include "group.h"
- /*
-@@ -810,8 +812,10 @@ void ext4_free_blocks(handle_t *handle, 
+@@ -861,8 +863,10 @@ void ext4_free_blocks(handle_t *handle, 
  	else
  		ext4_mb_free_blocks(handle, inode, block, count,
  						metadata, &dquot_freed_blocks);
@@ -3492,7 +3327,7 @@
  	return;
  }
  
-@@ -1551,18 +1555,33 @@ out:
+@@ -1602,18 +1606,33 @@ out:
   *
   * Check if filesystem has at least 1 free block available for allocation.
   */
@@ -3532,7 +3367,7 @@
  }
  
  /**
-@@ -1579,7 +1598,7 @@ static int ext4_has_free_blocks(struct e
+@@ -1630,7 +1649,7 @@ static int ext4_has_free_blocks(struct e
   */
  int ext4_should_retry_alloc(struct super_block *sb, int *retries)
  {
@@ -3541,7 +3376,7 @@
  		return 0;
  
  	jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id);
-@@ -1639,6 +1658,8 @@ ext4_fsblk_t ext4_new_blocks_old(handle_
+@@ -1690,6 +1709,8 @@ ext4_fsblk_t ext4_new_blocks_old(handle_
  		*errp = -EDQUOT;
  		return 0;
  	}
@@ -3550,7 +3385,7 @@
  
  	sbi = EXT4_SB(sb);
  	es = EXT4_SB(sb)->s_es;
-@@ -1655,7 +1676,7 @@ ext4_fsblk_t ext4_new_blocks_old(handle_
+@@ -1706,7 +1727,7 @@ ext4_fsblk_t ext4_new_blocks_old(handle_
  	if (block_i && ((windowsz = block_i->rsv_window_node.rsv_goal_size) > 0))
  		my_rsv = &block_i->rsv_window_node;
  
@@ -3559,7 +3394,7 @@
  		*errp = -ENOSPC;
  		goto out;
  	}
-@@ -1841,12 +1862,16 @@ allocated:
+@@ -1896,12 +1917,16 @@ allocated:
  	*errp = 0;
  	brelse(bitmap_bh);
  	DQUOT_FREE_BLOCK(inode, *count-num);
@@ -3576,8 +3411,40 @@
  	if (fatal) {
  		*errp = fatal;
  		ext4_std_error(sb, fatal);
---- a/fs/ext4/file.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext4/file.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/ext4/ext4.h	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext4/ext4.h	2008-08-11 21:57:27.000000000 -0400
+@@ -230,8 +230,12 @@ struct ext4_group_desc
+ #define EXT4_HUGE_FILE_FL               0x00040000 /* Set to each huge file */
+ #define EXT4_EXTENTS_FL			0x00080000 /* Inode uses extents */
+ #define EXT4_EXT_MIGRATE		0x00100000 /* Inode is migrating */
++#define EXT4_IXUNLINK_FL		0x01000000 /* Immutable invert on unlink */
+ #define EXT4_RESERVED_FL		0x80000000 /* reserved for ext4 lib */
+ 
++#define EXT4_BARRIER_FL			0x10000000 /* Barrier for chroot() */
++#define EXT4_COW_FL			0x20000000 /* Copy on Write marker */
++
+ #define EXT4_FL_USER_VISIBLE		0x000BDFFF /* User visible flags */
+ #define EXT4_FL_USER_MODIFIABLE		0x000380FF /* User modifiable flags */
+ 
+@@ -527,6 +531,8 @@ do {									       \
+ #define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT	0x1000000 /* Journal Async Commit */
+ #define EXT4_MOUNT_I_VERSION            0x2000000 /* i_version support */
+ #define EXT4_MOUNT_MBALLOC		0x4000000 /* Buddy allocation support */
++#define EXT4_MOUNT_TAGGED		(1<<24) /* Enable Context Tags */
++
+ /* Compatibility, for having both ext2_fs.h and ext4_fs.h included at once */
+ #ifndef _LINUX_EXT2_FS_H
+ #define clear_opt(o, opt)		o &= ~EXT4_MOUNT_##opt
+@@ -1029,6 +1035,7 @@ int ext4_get_blocks_handle(handle_t *han
+ 				ext4_lblk_t iblock, unsigned long maxblocks,
+ 				struct buffer_head *bh_result,
+ 				int create, int extend_disksize);
++extern int ext4_sync_flags(struct inode *inode);
+ 
+ extern struct inode *ext4_iget(struct super_block *, unsigned long);
+ extern int  ext4_write_inode (struct inode *, int);
+--- a/fs/ext4/file.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext4/file.c	2008-07-29 18:35:50.000000000 -0400
 @@ -152,5 +152,6 @@ const struct inode_operations ext4_file_
  #endif
  	.permission	= ext4_permission,
@@ -3585,18 +3452,18 @@
 +	.sync_flags	= ext4_sync_flags,
  };
  
---- a/fs/ext4/ialloc.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext4/ialloc.c	2008-04-21 10:29:28.000000000 -0400
-@@ -24,6 +24,8 @@
+--- a/fs/ext4/ialloc.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext4/ialloc.c	2008-07-16 22:41:36.000000000 -0400
+@@ -22,6 +22,8 @@
  #include <linux/random.h>
  #include <linux/bitops.h>
  #include <linux/blkdev.h>
 +#include <linux/vs_dlimit.h>
 +#include <linux/vs_tag.h>
  #include <asm/byteorder.h>
- 
- #include "xattr.h"
-@@ -186,6 +188,7 @@ void ext4_free_inode (handle_t *handle, 
+ #include "ext4.h"
+ #include "ext4_jbd2.h"
+@@ -185,6 +187,7 @@ void ext4_free_inode (handle_t *handle, 
  	ext4_xattr_delete_inode(handle, inode);
  	DQUOT_FREE_INODE(inode);
  	DQUOT_DROP(inode);
@@ -3604,7 +3471,7 @@
  
  	is_directory = S_ISDIR(inode->i_mode);
  
-@@ -513,6 +516,12 @@ struct inode *ext4_new_inode(handle_t *h
+@@ -510,6 +513,12 @@ struct inode *ext4_new_inode(handle_t *h
  	inode = new_inode(sb);
  	if (!inode)
  		return ERR_PTR(-ENOMEM);
@@ -3617,17 +3484,17 @@
  	ei = EXT4_I(inode);
  
  	sbi = EXT4_SB(sb);
-@@ -707,7 +716,8 @@ got:
+@@ -702,7 +711,8 @@ got:
  	 * newly created directory and file only if -o extent mount option is
  	 * specified
  	 */
 -	ei->i_flags = EXT4_I(dir)->i_flags & ~(EXT4_INDEX_FL|EXT4_EXTENTS_FL);
 +	ei->i_flags = EXT4_I(dir)->i_flags &
-+		~(EXT4_INDEX_FL|EXT4_EXTENTS_FL|EXT4_IUNLINK_FL|EXT4_BARRIER_FL);
++		~(EXT4_INDEX_FL|EXT4_EXTENTS_FL|EXT4_IXUNLINK_FL|EXT4_BARRIER_FL);
  	if (S_ISLNK(mode))
  		ei->i_flags &= ~(EXT4_IMMUTABLE_FL|EXT4_APPEND_FL);
  	/* dirsync only applies to directories */
-@@ -766,6 +776,8 @@ got:
+@@ -762,6 +772,8 @@ got:
  fail:
  	ext4_std_error(sb, err);
  out:
@@ -3636,7 +3503,7 @@
  	iput(inode);
  	ret = ERR_PTR(err);
  really_out:
-@@ -777,6 +789,7 @@ fail_free_drop:
+@@ -773,6 +785,7 @@ fail_free_drop:
  
  fail_drop:
  	DQUOT_DROP(inode);
@@ -3644,17 +3511,17 @@
  	inode->i_flags |= S_NOQUOTA;
  	inode->i_nlink = 0;
  	iput(inode);
---- a/fs/ext4/inode.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext4/inode.c	2008-04-21 10:20:53.000000000 -0400
-@@ -36,6 +36,7 @@
+--- a/fs/ext4/inode.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext4/inode.c	2008-07-17 20:26:11.000000000 -0400
+@@ -35,6 +35,7 @@
  #include <linux/mpage.h>
  #include <linux/uio.h>
  #include <linux/bio.h>
 +#include <linux/vs_tag.h>
+ #include "ext4_jbd2.h"
  #include "xattr.h"
  #include "acl.h"
- 
-@@ -2342,7 +2343,7 @@ void ext4_truncate(struct inode *inode)
+@@ -2354,7 +2355,7 @@ void ext4_truncate(struct inode *inode)
  		return;
  	if (ext4_inode_is_fast_symlink(inode))
  		return;
@@ -3663,20 +3530,18 @@
  		return;
  
  	/*
-@@ -2671,13 +2672,20 @@ void ext4_set_inode_flags(struct inode *
+@@ -2669,37 +2670,86 @@ void ext4_set_inode_flags(struct inode *
  {
  	unsigned int flags = EXT4_I(inode)->i_flags;
  
 -	inode->i_flags &= ~(S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC);
-+	inode->i_flags &= ~(S_IMMUTABLE | S_IUNLINK | S_BARRIER |
++	inode->i_flags &= ~(S_IMMUTABLE | S_IXUNLINK |
 +		S_SYNC | S_APPEND | S_NOATIME | S_DIRSYNC);
 +
 +	if (flags & EXT4_IMMUTABLE_FL)
 +		inode->i_flags |= S_IMMUTABLE;
-+	if (flags & EXT4_IUNLINK_FL)
-+		inode->i_flags |= S_IUNLINK;
-+	if (flags & EXT4_BARRIER_FL)
-+		inode->i_flags |= S_BARRIER;
++	if (flags & EXT4_IXUNLINK_FL)
++		inode->i_flags |= S_IXUNLINK;
 +
  	if (flags & EXT4_SYNC_FL)
  		inode->i_flags |= S_SYNC;
@@ -3687,54 +3552,79 @@
  	if (flags & EXT4_NOATIME_FL)
  		inode->i_flags |= S_NOATIME;
  	if (flags & EXT4_DIRSYNC_FL)
-@@ -2702,6 +2710,46 @@ void ext4_get_inode_flags(struct ext4_in
+ 		inode->i_flags |= S_DIRSYNC;
++
++	inode->i_vflags &= ~(V_BARRIER | V_COW);
++
++	if (flags & EXT4_BARRIER_FL)
++		inode->i_vflags |= V_BARRIER;
++	if (flags & EXT4_COW_FL)
++		inode->i_vflags |= V_COW;
+ }
+ 
+ /* Propagate flags from i_flags to EXT4_I(inode)->i_flags */
+ void ext4_get_inode_flags(struct ext4_inode_info *ei)
+ {
+ 	unsigned int flags = ei->vfs_inode.i_flags;
++	unsigned int vflags = ei->vfs_inode.i_vflags;
++
++	ei->i_flags &= ~(EXT4_SYNC_FL | EXT4_APPEND_FL |
++			EXT4_IMMUTABLE_FL | EXT4_IXUNLINK_FL |
++			EXT4_NOATIME_FL | EXT4_DIRSYNC_FL |
++			EXT4_BARRIER_FL | EXT4_COW_FL);
++
++	if (flags & S_IMMUTABLE)
++		ei->i_flags |= EXT4_IMMUTABLE_FL;
++	if (flags & S_IXUNLINK)
++		ei->i_flags |= EXT4_IXUNLINK_FL;
+ 
+-	ei->i_flags &= ~(EXT4_SYNC_FL|EXT4_APPEND_FL|
+-			EXT4_IMMUTABLE_FL|EXT4_NOATIME_FL|EXT4_DIRSYNC_FL);
+ 	if (flags & S_SYNC)
+ 		ei->i_flags |= EXT4_SYNC_FL;
+ 	if (flags & S_APPEND)
+ 		ei->i_flags |= EXT4_APPEND_FL;
+-	if (flags & S_IMMUTABLE)
+-		ei->i_flags |= EXT4_IMMUTABLE_FL;
+ 	if (flags & S_NOATIME)
+ 		ei->i_flags |= EXT4_NOATIME_FL;
  	if (flags & S_DIRSYNC)
  		ei->i_flags |= EXT4_DIRSYNC_FL;
++
++	if (vflags & V_BARRIER)
++		ei->i_flags |= EXT4_BARRIER_FL;
++	if (vflags & V_COW)
++		ei->i_flags |= EXT4_COW_FL;
  }
 +
 +int ext4_sync_flags(struct inode *inode)
 +{
-+	unsigned int oldflags, newflags;
-+	int err = 0;
-+
-+	oldflags = EXT4_I(inode)->i_flags;
-+	newflags = oldflags & ~(EXT4_IMMUTABLE_FL |
-+		EXT4_IUNLINK_FL | EXT4_BARRIER_FL);
-+
-+	if (IS_IMMUTABLE(inode))
-+		newflags |= EXT4_IMMUTABLE_FL;
-+	if (IS_IUNLINK(inode))
-+		newflags |= EXT4_IUNLINK_FL;
-+	if (IS_BARRIER(inode))
-+		newflags |= EXT4_BARRIER_FL;
-+
-+	if (oldflags ^ newflags) {
-+		handle_t *handle;
-+		struct ext4_iloc iloc;
++	struct ext4_iloc iloc;
++	handle_t *handle;
++	int err;
 +
-+		handle = ext4_journal_start(inode, 1);
-+		if (IS_ERR(handle))
-+			return PTR_ERR(handle);
-+		if (IS_SYNC(inode))
-+			handle->h_sync = 1;
-+		err = ext4_reserve_inode_write(handle, inode, &iloc);
-+		if (err)
-+			goto flags_err;
++	handle = ext4_journal_start(inode, 1);
++	if (IS_ERR(handle))
++		return PTR_ERR(handle);
++	if (IS_SYNC(inode))
++		handle->h_sync = 1;
++	err = ext4_reserve_inode_write(handle, inode, &iloc);
++	if (err)
++		goto flags_err;
 +
-+		EXT4_I(inode)->i_flags = newflags;
-+		inode->i_ctime = CURRENT_TIME;
++	ext4_get_inode_flags(EXT4_I(inode));
++	inode->i_ctime = CURRENT_TIME;
 +
-+		err = ext4_mark_iloc_dirty(handle, inode, &iloc);
-+	flags_err:
-+		ext4_journal_stop(handle);
-+	}
++	err = ext4_mark_iloc_dirty(handle, inode, &iloc);
++flags_err:
++	ext4_journal_stop(handle);
 +	return err;
 +}
 +
  static blkcnt_t ext4_inode_blocks(struct ext4_inode *raw_inode,
  					struct ext4_inode_info *ei)
  {
-@@ -2734,6 +2782,8 @@ struct inode *ext4_iget(struct super_blo
+@@ -2732,6 +2782,8 @@ struct inode *ext4_iget(struct super_blo
  	struct inode *inode;
  	long ret;
  	int block;
@@ -3743,7 +3633,7 @@
  
  	inode = iget_locked(sb, ino);
  	if (!inode)
-@@ -2754,12 +2804,17 @@ struct inode *ext4_iget(struct super_blo
+@@ -2752,12 +2804,17 @@ struct inode *ext4_iget(struct super_blo
  	bh = iloc.bh;
  	raw_inode = ext4_raw_inode(&iloc);
  	inode->i_mode = le16_to_cpu(raw_inode->i_mode);
@@ -3765,7 +3655,7 @@
  	inode->i_nlink = le16_to_cpu(raw_inode->i_links_count);
  
  	ei->i_state = 0;
-@@ -2933,6 +2988,8 @@ static int ext4_do_update_inode(handle_t
+@@ -2931,6 +2988,8 @@ static int ext4_do_update_inode(handle_t
  	struct ext4_inode *raw_inode = ext4_raw_inode(iloc);
  	struct ext4_inode_info *ei = EXT4_I(inode);
  	struct buffer_head *bh = iloc->bh;
@@ -3774,7 +3664,7 @@
  	int err = 0, rc, block;
  
  	/* For fields not not tracking in the in-memory inode,
-@@ -2943,29 +3000,32 @@ static int ext4_do_update_inode(handle_t
+@@ -2941,29 +3000,32 @@ static int ext4_do_update_inode(handle_t
  	ext4_get_inode_flags(ei);
  	raw_inode->i_mode = cpu_to_le16(inode->i_mode);
  	if(!(test_opt(inode->i_sb, NO_UID32))) {
@@ -3813,7 +3703,7 @@
  	raw_inode->i_links_count = cpu_to_le16(inode->i_nlink);
  
  	EXT4_INODE_SET_XTIME(i_ctime, inode, raw_inode);
-@@ -3121,7 +3181,8 @@ int ext4_setattr(struct dentry *dentry, 
+@@ -3120,7 +3182,8 @@ int ext4_setattr(struct dentry *dentry, 
  		return error;
  
  	if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) ||
@@ -3823,7 +3713,7 @@
  		handle_t *handle;
  
  		/* (user+group)*(old+new) structure, inode write (sb,
-@@ -3143,6 +3204,8 @@ int ext4_setattr(struct dentry *dentry, 
+@@ -3142,6 +3205,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;
@@ -3832,96 +3722,57 @@
  		error = ext4_mark_inode_dirty(handle, inode);
  		ext4_journal_stop(handle);
  	}
---- a/fs/ext4/ioctl.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext4/ioctl.c	2008-04-19 15:14:52.000000000 -0400
-@@ -8,6 +8,7 @@
+--- a/fs/ext4/ioctl.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext4/ioctl.c	2008-07-17 20:58:51.000000000 -0400
+@@ -8,12 +8,14 @@
   */
  
  #include <linux/fs.h>
 +#include <linux/mount.h>
  #include <linux/jbd2.h>
  #include <linux/capability.h>
- #include <linux/ext4_fs.h>
-@@ -15,6 +16,7 @@
  #include <linux/time.h>
  #include <linux/compat.h>
  #include <linux/smp_lock.h>
+ #include <linux/mount.h>
 +#include <linux/vs_tag.h>
  #include <asm/uaccess.h>
- 
- int ext4_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
-@@ -38,7 +40,8 @@ int ext4_ioctl (struct inode * inode, st
- 		unsigned int oldflags;
- 		unsigned int jflag;
- 
--		if (IS_RDONLY(inode))
-+		if (IS_RDONLY(inode) ||
-+			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
- 			return -EROFS;
- 
- 		if (!is_owner_or_cap(inode))
-@@ -67,7 +70,9 @@ int ext4_ioctl (struct inode * inode, st
+ #include "ext4_jbd2.h"
+ #include "ext4.h"
+@@ -52,6 +54,11 @@ long ext4_ioctl(struct file *filp, unsig
+ 		if (!S_ISDIR(inode->i_mode))
+ 			flags &= ~EXT4_DIRSYNC_FL;
+ 
++		if (IS_BARRIER(inode)) {
++			vxwprintk_task(1, "messing with the barrier.");
++			return -EACCES;
++		}
++
+ 		err = -EPERM;
+ 		mutex_lock(&inode->i_mutex);
+ 		/* Is it quota file? Do not allow user to mess with it */
+@@ -69,7 +76,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_IUNLINK_FL))) {
- 			if (!capable(CAP_LINUX_IMMUTABLE)) {
- 				mutex_unlock(&inode->i_mutex);
- 				return -EPERM;
-@@ -129,7 +134,8 @@ flags_err:
- 
- 		if (!is_owner_or_cap(inode))
- 			return -EPERM;
--		if (IS_RDONLY(inode))
-+		if (IS_RDONLY(inode) ||
-+			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
- 			return -EROFS;
- 		if (get_user(generation, (int __user *) arg))
- 			return -EFAULT;
-@@ -183,7 +189,8 @@ flags_err:
- 		if (!test_opt(inode->i_sb, RESERVATION) ||!S_ISREG(inode->i_mode))
- 			return -ENOTTY;
- 
--		if (IS_RDONLY(inode))
-+		if (IS_RDONLY(inode) ||
-+			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
- 			return -EROFS;
- 
- 		if (!is_owner_or_cap(inode))
-@@ -218,7 +225,8 @@ flags_err:
- 		if (!capable(CAP_SYS_RESOURCE))
- 			return -EPERM;
- 
--		if (IS_RDONLY(inode))
-+		if (IS_RDONLY(inode) ||
-+			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
- 			return -EROFS;
- 
- 		if (get_user(n_blocks_count, (__u32 __user *)arg))
-@@ -239,7 +247,8 @@ flags_err:
- 		if (!capable(CAP_SYS_RESOURCE))
- 			return -EPERM;
- 
--		if (IS_RDONLY(inode))
-+		if (IS_RDONLY(inode) ||
-+			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
- 			return -EROFS;
- 
- 		if (copy_from_user(&input, (struct ext4_new_group_input __user *)arg,
---- a/fs/ext4/namei.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext4/namei.c	2008-04-19 15:14:52.000000000 -0400
-@@ -36,6 +36,7 @@
++			EXT4_IMMUTABLE_FL | EXT4_IXUNLINK_FL))) {
+ 			if (!capable(CAP_LINUX_IMMUTABLE))
+ 				goto flags_out;
+ 		}
+--- a/fs/ext4/namei.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext4/namei.c	2008-07-17 20:24:56.000000000 -0400
+@@ -34,6 +34,7 @@
  #include <linux/quotaops.h>
  #include <linux/buffer_head.h>
  #include <linux/bio.h>
 +#include <linux/vs_tag.h>
+ #include "ext4.h"
+ #include "ext4_jbd2.h"
  
- #include "namei.h"
- #include "xattr.h"
-@@ -908,6 +909,7 @@ restart:
+@@ -913,6 +914,7 @@ restart:
  				if (bh)
  					ll_rw_block(READ_META, 1, &bh);
  			}
@@ -3929,7 +3780,7 @@
  		}
  		if ((bh = bh_use[ra_ptr++]) == NULL)
  			goto next;
-@@ -2448,6 +2450,7 @@ const struct inode_operations ext4_dir_i
+@@ -2458,6 +2460,7 @@ const struct inode_operations ext4_dir_i
  	.removexattr	= generic_removexattr,
  #endif
  	.permission	= ext4_permission,
@@ -3937,15 +3788,15 @@
  };
  
  const struct inode_operations ext4_special_inode_operations = {
-@@ -2459,4 +2462,5 @@ const struct inode_operations ext4_speci
+@@ -2469,4 +2472,5 @@ const struct inode_operations ext4_speci
  	.removexattr	= generic_removexattr,
  #endif
  	.permission	= ext4_permission,
 +	.sync_flags	= ext4_sync_flags,
  };
---- a/fs/ext4/super.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext4/super.c	2008-04-21 10:31:22.000000000 -0400
-@@ -887,6 +887,7 @@ enum {
+--- a/fs/ext4/super.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext4/super.c	2008-07-17 21:00:22.000000000 -0400
+@@ -895,6 +895,7 @@ enum {
  	Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
  	Opt_grpquota, Opt_extents, Opt_noextents, Opt_i_version,
  	Opt_mballoc, Opt_nomballoc, Opt_stripe,
@@ -3953,20 +3804,17 @@
  };
  
  static match_table_t tokens = {
-@@ -944,8 +945,11 @@ static match_table_t tokens = {
- 	{Opt_mballoc, "mballoc"},
+@@ -953,6 +954,9 @@ static match_table_t tokens = {
  	{Opt_nomballoc, "nomballoc"},
  	{Opt_stripe, "stripe=%u"},
--	{Opt_err, NULL},
  	{Opt_resize, "resize"},
 +	{Opt_tag, "tag"},
 +	{Opt_notag, "notag"},
 +	{Opt_tagid, "tagid=%u"},
-+	{Opt_err, NULL},
+ 	{Opt_err, NULL},
  };
  
- static ext4_fsblk_t get_sb_block(void **data)
-@@ -1037,6 +1041,20 @@ static int parse_options (char *options,
+@@ -1045,6 +1049,20 @@ static int parse_options (char *options,
  		case Opt_nouid32:
  			set_opt (sbi->s_mount_opt, NO_UID32);
  			break;
@@ -3987,7 +3835,7 @@
  		case Opt_nocheck:
  			clear_opt (sbi->s_mount_opt, CHECK);
  			break;
-@@ -1909,6 +1927,9 @@ static int ext4_fill_super (struct super
+@@ -1932,6 +1950,9 @@ static int ext4_fill_super (struct super
  			    NULL, 0))
  		goto failed_mount;
  
@@ -3997,21 +3845,22 @@
  	sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
  		((sbi->s_mount_opt & EXT4_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
  
-@@ -2828,6 +2849,12 @@ static int ext4_remount (struct super_bl
- 
+@@ -2875,6 +2896,13 @@ static int ext4_remount (struct super_bl
  	if (sbi->s_mount_opt & EXT4_MOUNT_ABORT)
- 		ext4_abort(sb, __FUNCTION__, "Abort forced by user");
+ 		ext4_abort(sb, __func__, "Abort forced by user");
+ 
 +	if ((sbi->s_mount_opt & EXT4_MOUNT_TAGGED) &&
 +		!(sb->s_flags & MS_TAGGED)) {
 +		printk("EXT4-fs: %s: tagging not permitted on remount.\n",
 +			sb->s_id);
 +		return -EINVAL;
 +	}
- 
++
  	sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
  		((sbi->s_mount_opt & EXT4_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
---- a/fs/ext4/symlink.c	2008-04-17 10:32:27.000000000 -0400
-+++ a/fs/ext4/symlink.c	2008-04-19 15:14:52.000000000 -0400
+ 
+--- a/fs/ext4/symlink.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext4/symlink.c	2008-07-16 22:41:36.000000000 -0400
 @@ -40,6 +40,7 @@ const struct inode_operations ext4_symli
  	.listxattr	= ext4_listxattr,
  	.removexattr	= generic_removexattr,
@@ -4026,17 +3875,17 @@
  #endif
 +	.sync_flags	= ext4_sync_flags,
  };
---- a/fs/ext4/xattr.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ext4/xattr.c	2008-04-19 15:14:52.000000000 -0400
-@@ -58,6 +58,7 @@
+--- a/fs/ext4/xattr.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ext4/xattr.c	2008-07-17 20:24:11.000000000 -0400
+@@ -56,6 +56,7 @@
  #include <linux/mbcache.h>
  #include <linux/quotaops.h>
  #include <linux/rwsem.h>
 +#include <linux/vs_dlimit.h>
+ #include "ext4_jbd2.h"
+ #include "ext4.h"
  #include "xattr.h"
- #include "acl.h"
- 
-@@ -489,6 +490,7 @@ ext4_xattr_release_block(handle_t *handl
+@@ -490,6 +491,7 @@ ext4_xattr_release_block(handle_t *handl
  		error = ext4_journal_dirty_metadata(handle, bh);
  		if (IS_SYNC(inode))
  			handle->h_sync = 1;
@@ -4044,7 +3893,7 @@
  		DQUOT_FREE_BLOCK(inode, 1);
  		ea_bdebug(bh, "refcount now=%d; releasing",
  			  le32_to_cpu(BHDR(bh)->h_refcount));
-@@ -779,11 +781,14 @@ inserted:
+@@ -780,11 +782,14 @@ inserted:
  			if (new_bh == bs->bh)
  				ea_bdebug(new_bh, "keeping");
  			else {
@@ -4060,7 +3909,7 @@
  				error = ext4_journal_get_write_access(handle,
  								      new_bh);
  				if (error)
-@@ -860,6 +865,8 @@ cleanup:
+@@ -858,6 +863,8 @@ cleanup:
  
  cleanup_dquot:
  	DQUOT_FREE_BLOCK(inode, 1);
@@ -4069,9 +3918,9 @@
  	goto cleanup;
  
  bad_block:
---- a/fs/fcntl.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/fcntl.c	2008-04-19 15:14:52.000000000 -0400
-@@ -19,6 +19,7 @@
+--- a/fs/fcntl.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/fcntl.c	2008-07-17 17:22:30.000000000 -0400
+@@ -20,6 +20,7 @@
  #include <linux/signal.h>
  #include <linux/rcupdate.h>
  #include <linux/pid_namespace.h>
@@ -4079,7 +3928,7 @@
  
  #include <asm/poll.h>
  #include <asm/siginfo.h>
-@@ -85,6 +86,8 @@ repeat:
+@@ -88,6 +89,8 @@ repeat:
  	error = -EMFILE;
  	if (newfd >= current->signal->rlim[RLIMIT_NOFILE].rlim_cur)
  		goto out;
@@ -4088,15 +3937,20 @@
  
  	error = expand_files(files, newfd);
  	if (error < 0)
-@@ -128,6 +131,7 @@ static int dupfd(struct file *file, unsi
- 		else
- 			FD_CLR(fd, fdt->close_on_exec);
- 		spin_unlock(&files->file_lock);
-+		vx_openfd_inc(fd);
+@@ -118,9 +121,10 @@ out:
+ static int dupfd(struct file *file, unsigned int start, int cloexec)
+ {
+ 	int fd = locate_fd(start, cloexec);
+-	if (fd >= 0)
++	if (fd >= 0) {
  		fd_install(fd, file);
- 	} else {
- 		spin_unlock(&files->file_lock);
-@@ -180,6 +184,9 @@ asmlinkage long sys_dup2(unsigned int ol
+-	else
++		vx_openfd_inc(fd);
++	} else
+ 		fput(file);
+ 
+ 	return fd;
+@@ -169,6 +173,9 @@ asmlinkage long sys_dup2(unsigned int ol
  
  	if (tofree)
  		filp_close(tofree, files);
@@ -4106,9 +3960,28 @@
  	err = newfd;
  out:
  	return err;
---- a/fs/file_table.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/file_table.c	2008-04-19 15:14:52.000000000 -0400
-@@ -20,6 +20,8 @@
+--- a/fs/file.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/file.c	2008-07-27 14:14:05.000000000 -0400
+@@ -18,6 +18,7 @@
+ #include <linux/spinlock.h>
+ #include <linux/rcupdate.h>
+ #include <linux/workqueue.h>
++#include <linux/vs_limit.h>
+ 
+ struct fdtable_defer {
+ 	spinlock_t lock;
+@@ -357,6 +358,8 @@ struct files_struct *dup_fd(struct files
+ 		struct file *f = *old_fds++;
+ 		if (f) {
+ 			get_file(f);
++			/* TODO: sum it first for check and performance */
++			vx_openfd_inc(open_files - i);
+ 		} else {
+ 			/*
+ 			 * The fd may be claimed in the fd bitmap but not yet
+--- a/fs/file_table.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/file_table.c	2008-07-16 22:41:36.000000000 -0400
+@@ -21,6 +21,8 @@
  #include <linux/fsnotify.h>
  #include <linux/sysctl.h>
  #include <linux/percpu_counter.h>
@@ -4117,7 +3990,7 @@
  
  #include <asm/atomic.h>
  
-@@ -124,6 +126,8 @@ struct file *get_empty_filp(void)
+@@ -126,6 +128,8 @@ struct file *get_empty_filp(void)
  	f->f_gid = tsk->fsgid;
  	eventpoll_init_file(f);
  	/* f->f_version: 0 */
@@ -4126,16 +3999,16 @@
  	return f;
  
  over:
-@@ -239,6 +243,8 @@ void __fput(struct file *file)
- 	if (file->f_mode & FMODE_WRITE)
- 		put_write_access(inode);
+@@ -276,6 +280,8 @@ void __fput(struct file *file)
+ 		cdev_put(inode->i_cdev);
+ 	fops_put(file->f_op);
  	put_pid(file->f_owner.pid);
 +	vx_files_dec(file);
 +	file->f_xid = 0;
  	file_kill(file);
- 	file->f_path.dentry = NULL;
- 	file->f_path.mnt = NULL;
-@@ -304,6 +310,8 @@ void put_filp(struct file *file)
+ 	if (file->f_mode & FMODE_WRITE)
+ 		drop_file_write_access(file);
+@@ -343,6 +349,8 @@ void put_filp(struct file *file)
  {
  	if (atomic_dec_and_test(&file->f_count)) {
  		security_file_free(file);
@@ -4144,28 +4017,18 @@
  		file_kill(file);
  		file_free(file);
  	}
---- a/fs/hfsplus/ioctl.c	2008-04-17 10:37:23.000000000 -0400
-+++ a/fs/hfsplus/ioctl.c	2008-04-19 15:14:52.000000000 -0400
-@@ -16,6 +16,7 @@
- #include <linux/fs.h>
+--- a/fs/hfsplus/ioctl.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/hfsplus/ioctl.c	2008-07-16 22:41:36.000000000 -0400
+@@ -17,6 +17,7 @@
+ #include <linux/mount.h>
  #include <linux/sched.h>
  #include <linux/xattr.h>
 +#include <linux/mount.h>
  #include <asm/uaccess.h>
  #include "hfsplus_fs.h"
  
-@@ -35,7 +36,8 @@ int hfsplus_ioctl(struct inode *inode, s
- 			flags |= FS_NODUMP_FL; /* EXT2_NODUMP_FL */
- 		return put_user(flags, (int __user *)arg);
- 	case HFSPLUS_IOC_EXT2_SETFLAGS: {
--		if (IS_RDONLY(inode))
-+		if (IS_RDONLY(inode) ||
-+			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
- 			return -EROFS;
- 
- 		if (!is_owner_or_cap(inode))
---- a/fs/inode.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/inode.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/inode.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/inode.c	2008-07-16 22:41:36.000000000 -0400
 @@ -124,6 +124,9 @@ static struct inode *alloc_inode(struct 
  		struct address_space * const mapping = &inode->i_data;
  
@@ -4193,7 +4056,7 @@
  /**
   * clear_inode - clear an inode
   * @inode: inode to clear
-@@ -1434,9 +1440,11 @@ void init_special_inode(struct inode *in
+@@ -1426,9 +1432,11 @@ void init_special_inode(struct inode *in
  	if (S_ISCHR(mode)) {
  		inode->i_fop = &def_chr_fops;
  		inode->i_rdev = rdev;
@@ -4205,8 +4068,8 @@
  	} else if (S_ISFIFO(mode))
  		inode->i_fop = &def_fifo_fops;
  	else if (S_ISSOCK(mode))
---- a/fs/ioctl.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ioctl.c	2008-04-21 09:25:46.000000000 -0400
+--- a/fs/ioctl.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/ioctl.c	2008-07-16 22:41:36.000000000 -0400
 @@ -13,6 +13,9 @@
  #include <linux/security.h>
  #include <linux/module.h>
@@ -4218,7 +4081,7 @@
  #include <asm/ioctls.h>
  
 --- a/fs/ioprio.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ioprio.c	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/ioprio.c	2008-07-16 22:41:36.000000000 -0400
 @@ -26,6 +26,7 @@
  #include <linux/syscalls.h>
  #include <linux/security.h>
@@ -4246,7 +4109,7 @@
  				if (tmpio < 0)
  					continue;
 --- a/fs/jfs/acl.c	2007-02-04 13:44:54.000000000 -0500
-+++ a/fs/jfs/acl.c	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/jfs/acl.c	2008-07-16 22:41:36.000000000 -0400
 @@ -232,7 +232,8 @@ int jfs_setattr(struct dentry *dentry, s
  		return rc;
  
@@ -4258,7 +4121,7 @@
  			return -EDQUOT;
  	}
 --- a/fs/jfs/file.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/jfs/file.c	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/jfs/file.c	2008-07-16 22:41:36.000000000 -0400
 @@ -98,6 +98,7 @@ const struct inode_operations jfs_file_i
  	.setattr	= jfs_setattr,
  	.permission	= jfs_permission,
@@ -4268,7 +4131,7 @@
  
  const struct file_operations jfs_file_operations = {
 --- a/fs/jfs/inode.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/jfs/inode.c	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/jfs/inode.c	2008-07-16 22:41:36.000000000 -0400
 @@ -22,6 +22,7 @@
  #include <linux/buffer_head.h>
  #include <linux/pagemap.h>
@@ -4285,56 +4148,59 @@
  	}
  
  	clear_inode(inode);
---- a/fs/jfs/ioctl.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/jfs/ioctl.c	2008-04-21 09:25:22.000000000 -0400
-@@ -10,6 +10,7 @@
- #include <linux/capability.h>
+--- a/fs/jfs/ioctl.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/jfs/ioctl.c	2008-07-16 22:41:36.000000000 -0400
+@@ -11,6 +11,7 @@
+ #include <linux/mount.h>
  #include <linux/time.h>
  #include <linux/sched.h>
 +#include <linux/mount.h>
  #include <asm/current.h>
  #include <asm/uaccess.h>
  
-@@ -66,7 +67,8 @@ long jfs_ioctl(struct file *filp, unsign
- 	case JFS_IOC_SETFLAGS: {
- 		unsigned int oldflags;
- 
--		if (IS_RDONLY(inode))
-+		if (IS_RDONLY(inode) ||
-+			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
- 			return -EROFS;
- 
- 		if (!is_owner_or_cap(inode))
-@@ -94,8 +96,8 @@ long jfs_ioctl(struct file *filp, unsign
+@@ -85,6 +86,11 @@ long jfs_ioctl(struct file *filp, unsign
+ 		if (!S_ISDIR(inode->i_mode))
+ 			flags &= ~JFS_DIRSYNC_FL;
+ 
++		if (IS_BARRIER(inode)) {
++			vxwprintk_task(1, "messing with the barrier.");
++			return -EACCES;
++		}
++
+ 		/* Is it quota file? Do not allow user to mess with it */
+ 		if (IS_NOQUOTA(inode)) {
+ 			err = -EPERM;
+@@ -102,8 +108,8 @@ long jfs_ioctl(struct file *filp, unsign
  		 * the relevant capability.
  		 */
  		if ((oldflags & JFS_IMMUTABLE_FL) ||
 -			((flags ^ oldflags) &
 -			(JFS_APPEND_FL | JFS_IMMUTABLE_FL))) {
 +			((flags ^ oldflags) & (JFS_APPEND_FL |
-+			JFS_IMMUTABLE_FL | JFS_IUNLINK_FL))) {
++			JFS_IMMUTABLE_FL | JFS_IXUNLINK_FL))) {
  			if (!capable(CAP_LINUX_IMMUTABLE)) {
  				mutex_unlock(&inode->i_mutex);
- 				return -EPERM;
+ 				err = -EPERM;
 --- a/fs/jfs/jfs_dinode.h	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/jfs/jfs_dinode.h	2008-04-19 15:14:52.000000000 -0400
-@@ -162,9 +162,12 @@ struct dinode {
++++ a/fs/jfs/jfs_dinode.h	2008-07-16 22:41:36.000000000 -0400
+@@ -161,9 +161,13 @@ struct dinode {
+ 
  #define JFS_APPEND_FL		0x01000000 /* writes to file may only append */
  #define JFS_IMMUTABLE_FL	0x02000000 /* Immutable file */
++#define JFS_IXUNLINK_FL		0x04000000 /* Immutable invert on unlink */
  
 -#define JFS_FL_USER_VISIBLE	0x03F80000
-+#define JFS_BARRIER_FL		0x04000000 /* Barrier for chroot() */
-+#define JFS_IUNLINK_FL		0x08000000 /* Immutable unlink */
-+
-+#define JFS_FL_USER_VISIBLE	0x0FF80000
- #define JFS_FL_USER_MODIFIABLE	0x03F80000
--#define JFS_FL_INHERIT		0x03C80000
-+#define JFS_FL_INHERIT		0x0BC80000
+-#define JFS_FL_USER_MODIFIABLE	0x03F80000
++#define JFS_BARRIER_FL		0x10000000 /* Barrier for chroot() */
++#define JFS_COW_FL		0x20000000 /* Copy on Write marker */
++
++#define JFS_FL_USER_VISIBLE	0x07F80000
++#define JFS_FL_USER_MODIFIABLE	0x07F80000
+ #define JFS_FL_INHERIT		0x03C80000
  
  /* These are identical to EXT[23]_IOC_GETFLAGS/SETFLAGS */
- #define JFS_IOC_GETFLAGS	_IOR('f', 1, long)
 --- a/fs/jfs/jfs_dtree.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/jfs/jfs_dtree.c	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/jfs/jfs_dtree.c	2008-07-16 22:41:36.000000000 -0400
 @@ -102,6 +102,7 @@
  
  #include <linux/fs.h>
@@ -4447,7 +4313,7 @@
  				DQUOT_FREE_BLOCK(ip, xlen);
  
 --- a/fs/jfs/jfs_extent.c	2008-04-17 10:37:23.000000000 -0400
-+++ a/fs/jfs/jfs_extent.c	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/jfs/jfs_extent.c	2008-07-16 22:41:36.000000000 -0400
 @@ -18,6 +18,7 @@
  
  #include <linux/fs.h>
@@ -4510,7 +4376,7 @@
  			goto exit;
  		}
 --- a/fs/jfs/jfs_filsys.h	2008-04-17 10:37:23.000000000 -0400
-+++ a/fs/jfs/jfs_filsys.h	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/jfs/jfs_filsys.h	2008-07-16 22:41:36.000000000 -0400
 @@ -263,6 +263,7 @@
  #define JFS_NAME_MAX	255
  #define JFS_PATH_MAX	BPSIZE
@@ -4519,8 +4385,8 @@
  
  /*
   *	file system state (superblock state)
---- a/fs/jfs/jfs_imap.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/jfs/jfs_imap.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/jfs/jfs_imap.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/jfs/jfs_imap.c	2008-07-16 22:41:36.000000000 -0400
 @@ -45,6 +45,7 @@
  #include <linux/buffer_head.h>
  #include <linux/pagemap.h>
@@ -4529,7 +4395,7 @@
  
  #include "jfs_incore.h"
  #include "jfs_inode.h"
-@@ -3061,6 +3062,8 @@ static int copy_from_dinode(struct dinod
+@@ -3058,6 +3059,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);
@@ -4538,7 +4404,7 @@
  
  	jfs_ip->fileset = le32_to_cpu(dip->di_fileset);
  	jfs_ip->mode2 = le32_to_cpu(dip->di_mode);
-@@ -3081,14 +3084,18 @@ static int copy_from_dinode(struct dinod
+@@ -3078,14 +3081,18 @@ static int copy_from_dinode(struct dinod
  	}
  	ip->i_nlink = le32_to_cpu(dip->di_nlink);
  
@@ -4559,7 +4425,7 @@
  	if (sbi->gid == -1)
  		ip->i_gid = jfs_ip->saved_gid;
  	else {
-@@ -3153,14 +3160,12 @@ static void copy_to_dinode(struct dinode
+@@ -3150,14 +3157,12 @@ 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);
@@ -4581,7 +4447,7 @@
  	/*
  	 * mode2 is only needed for storing the higher order bits.
 --- a/fs/jfs/jfs_inode.c	2008-04-17 10:33:02.000000000 -0400
-+++ a/fs/jfs/jfs_inode.c	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/jfs/jfs_inode.c	2008-07-16 22:41:36.000000000 -0400
 @@ -18,6 +18,8 @@
  
  #include <linux/fs.h>
@@ -4591,21 +4457,19 @@
  #include "jfs_incore.h"
  #include "jfs_inode.h"
  #include "jfs_filsys.h"
-@@ -30,19 +32,47 @@ void jfs_set_inode_flags(struct inode *i
+@@ -30,29 +32,46 @@ void jfs_set_inode_flags(struct inode *i
  {
  	unsigned int flags = JFS_IP(inode)->mode2;
  
 -	inode->i_flags &= ~(S_IMMUTABLE | S_APPEND |
 -		S_NOATIME | S_DIRSYNC | S_SYNC);
-+	inode->i_flags &= ~(S_IMMUTABLE | S_IUNLINK | S_BARRIER |
++	inode->i_flags &= ~(S_IMMUTABLE | S_IXUNLINK |
 +		S_SYNC | S_APPEND | S_NOATIME | S_DIRSYNC);
  
  	if (flags & JFS_IMMUTABLE_FL)
  		inode->i_flags |= S_IMMUTABLE;
-+	if (flags & JFS_IUNLINK_FL)
-+		inode->i_flags |= S_IUNLINK;
-+	if (flags & JFS_BARRIER_FL)
-+		inode->i_flags |= S_BARRIER;
++	if (flags & JFS_IXUNLINK_FL)
++		inode->i_flags |= S_IXUNLINK;
 +
 +	if (flags & JFS_SYNC_FL)
 +		inode->i_flags |= S_SYNC;
@@ -4617,33 +4481,56 @@
  		inode->i_flags |= S_DIRSYNC;
 -	if (flags & JFS_SYNC_FL)
 -		inode->i_flags |= S_SYNC;
-+}
 +
-+int jfs_sync_flags(struct inode *inode)
-+{
-+	unsigned int oldflags, newflags;
++	inode->i_vflags &= ~(V_BARRIER | V_COW);
++
++	if (flags & JFS_BARRIER_FL)
++		inode->i_vflags |= V_BARRIER;
++	if (flags & JFS_COW_FL)
++		inode->i_vflags |= V_COW;
+ }
+ 
+ void jfs_get_inode_flags(struct jfs_inode_info *jfs_ip)
+ {
+ 	unsigned int flags = jfs_ip->vfs_inode.i_flags;
++	unsigned int vflags = jfs_ip->vfs_inode.i_vflags;
 +
-+	oldflags = JFS_IP(inode)->mode2;
-+	newflags = oldflags & ~(JFS_IMMUTABLE_FL |
-+		JFS_IUNLINK_FL | JFS_BARRIER_FL);
-+
-+	if (IS_IMMUTABLE(inode))
-+		newflags |= JFS_IMMUTABLE_FL;
-+	if (IS_IUNLINK(inode))
-+		newflags |= JFS_IUNLINK_FL;
-+	if (IS_BARRIER(inode))
-+		newflags |= JFS_BARRIER_FL;
++	jfs_ip->mode2 &= ~(JFS_IMMUTABLE_FL | JFS_IXUNLINK_FL |
++			   JFS_APPEND_FL | JFS_NOATIME_FL |
++			   JFS_DIRSYNC_FL | JFS_SYNC_FL |
++			   JFS_BARRIER_FL | JFS_COW_FL);
+ 
+-	jfs_ip->mode2 &= ~(JFS_IMMUTABLE_FL | JFS_APPEND_FL | JFS_NOATIME_FL |
+-			   JFS_DIRSYNC_FL | JFS_SYNC_FL);
+ 	if (flags & S_IMMUTABLE)
+ 		jfs_ip->mode2 |= JFS_IMMUTABLE_FL;
++	if (flags & S_IXUNLINK)
++		jfs_ip->mode2 |= JFS_IXUNLINK_FL;
++
+ 	if (flags & S_APPEND)
+ 		jfs_ip->mode2 |= JFS_APPEND_FL;
+ 	if (flags & S_NOATIME)
+@@ -61,6 +80,19 @@ void jfs_get_inode_flags(struct jfs_inod
+ 		jfs_ip->mode2 |= JFS_DIRSYNC_FL;
+ 	if (flags & S_SYNC)
+ 		jfs_ip->mode2 |= JFS_SYNC_FL;
++
++	if (vflags & V_BARRIER)
++		jfs_ip->mode2 |= JFS_BARRIER_FL;
++	if (vflags & V_COW)
++		jfs_ip->mode2 |= JFS_COW_FL;
++}
 +
-+	if (oldflags ^ newflags) {
-+		JFS_IP(inode)->mode2 = newflags;
-+		inode->i_ctime = CURRENT_TIME;
-+		mark_inode_dirty(inode);
-+	}
++int jfs_sync_flags(struct inode *inode)
++{
++	jfs_get_inode_flags(JFS_IP(inode));
++	inode->i_ctime = CURRENT_TIME;
++	mark_inode_dirty(inode);
 +	return 0;
  }
  
- void jfs_get_inode_flags(struct jfs_inode_info *jfs_ip)
-@@ -108,10 +138,17 @@ struct inode *ialloc(struct inode *paren
+ /*
+@@ -108,10 +140,17 @@ struct inode *ialloc(struct inode *paren
  	jfs_inode->saved_uid = inode->i_uid;
  	jfs_inode->saved_gid = inode->i_gid;
  
@@ -4662,7 +4549,7 @@
  		inode->i_flags |= S_NOQUOTA;
  		inode->i_nlink = 0;
 --- a/fs/jfs/jfs_inode.h	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/jfs/jfs_inode.h	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/jfs/jfs_inode.h	2008-07-16 22:41:36.000000000 -0400
 @@ -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);
@@ -4671,8 +4558,8 @@
  extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
  
  extern const struct address_space_operations jfs_aops;
---- a/fs/jfs/jfs_xtree.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/jfs/jfs_xtree.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/jfs/jfs_xtree.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/jfs/jfs_xtree.c	2008-07-16 22:41:36.000000000 -0400
 @@ -21,6 +21,7 @@
  
  #include <linux/fs.h>
@@ -4702,7 +4589,7 @@
  				DQUOT_FREE_BLOCK(ip, xlen);
  			}
  			return rc;
-@@ -1236,6 +1243,7 @@ xtSplitPage(tid_t tid, struct inode *ip,
+@@ -1232,6 +1239,7 @@ xtSplitPage(tid_t tid, struct inode *ip,
  	struct tlock *tlck;
  	struct xtlock *sxtlck = NULL, *rxtlck = NULL;
  	int quota_allocation = 0;
@@ -4710,7 +4597,7 @@
  
  	smp = split->mp;
  	sp = XT_PAGE(ip, smp);
-@@ -1255,6 +1263,13 @@ xtSplitPage(tid_t tid, struct inode *ip,
+@@ -1251,6 +1259,13 @@ xtSplitPage(tid_t tid, struct inode *ip,
  
  	quota_allocation += lengthPXD(pxd);
  
@@ -4724,7 +4611,7 @@
  	/*
  	 * allocate the new right page for the split
  	 */
-@@ -1456,6 +1471,9 @@ xtSplitPage(tid_t tid, struct inode *ip,
+@@ -1452,6 +1467,9 @@ xtSplitPage(tid_t tid, struct inode *ip,
  
        clean_up:
  
@@ -4734,7 +4621,7 @@
  	/* Rollback quota allocation. */
  	if (quota_allocation)
  		DQUOT_FREE_BLOCK(ip, quota_allocation);
-@@ -1519,6 +1537,12 @@ xtSplitRoot(tid_t tid,
+@@ -1515,6 +1533,12 @@ xtSplitRoot(tid_t tid,
  		release_metapage(rmp);
  		return -EDQUOT;
  	}
@@ -4747,7 +4634,7 @@
  
  	jfs_info("xtSplitRoot: ip:0x%p rmp:0x%p", ip, rmp);
  
-@@ -3948,6 +3972,8 @@ s64 xtTruncate(tid_t tid, struct inode *
+@@ -3938,6 +3962,8 @@ s64 xtTruncate(tid_t tid, struct inode *
  	else
  		ip->i_size = newsize;
  
@@ -4757,7 +4644,7 @@
  	DQUOT_FREE_BLOCK(ip, nfreed);
  
 --- a/fs/jfs/namei.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/jfs/namei.c	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/jfs/namei.c	2008-07-16 22:41:36.000000000 -0400
 @@ -21,6 +21,7 @@
  #include <linux/ctype.h>
  #include <linux/quotaops.h>
@@ -4783,7 +4670,7 @@
  
  const struct file_operations jfs_dir_operations = {
 --- a/fs/jfs/super.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/jfs/super.c	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/jfs/super.c	2008-07-16 22:41:36.000000000 -0400
 @@ -195,7 +195,8 @@ static void jfs_put_super(struct super_b
  enum {
  	Opt_integrity, Opt_nointegrity, Opt_iocharset, Opt_resize,
@@ -4851,7 +4738,7 @@
  	if (newLVSize) {
  		printk(KERN_ERR "resize option for remount only\n");
 --- a/fs/jfs/xattr.c	2008-04-17 10:37:23.000000000 -0400
-+++ a/fs/jfs/xattr.c	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/jfs/xattr.c	2008-07-16 22:41:36.000000000 -0400
 @@ -23,6 +23,7 @@
  #include <linux/posix_acl_xattr.h>
  #include <linux/quotaops.h>
@@ -4929,8 +4816,8 @@
  
  	inode->i_ctime = CURRENT_TIME;
  
---- a/fs/libfs.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/libfs.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/libfs.c	2008-08-12 01:41:51.000000000 -0400
++++ a/fs/libfs.c	2008-08-12 01:42:21.000000000 -0400
 @@ -125,7 +125,8 @@ static inline unsigned char dt_type(stru
   * both impossible due to the lock on directory.
   */
@@ -4969,7 +4856,7 @@
  ssize_t generic_read_dir(struct file *filp, char __user *buf, size_t siz, loff_t *ppos)
  {
  	return -EISDIR;
-@@ -778,6 +793,7 @@ EXPORT_SYMBOL(dcache_dir_close);
+@@ -823,6 +838,7 @@ EXPORT_SYMBOL(dcache_dir_close);
  EXPORT_SYMBOL(dcache_dir_lseek);
  EXPORT_SYMBOL(dcache_dir_open);
  EXPORT_SYMBOL(dcache_readdir);
@@ -4977,17 +4864,17 @@
  EXPORT_SYMBOL(generic_read_dir);
  EXPORT_SYMBOL(get_sb_pseudo);
  EXPORT_SYMBOL(simple_write_begin);
---- a/fs/locks.c	2008-05-21 14:30:05.000000000 -0400
-+++ a/fs/locks.c	2008-05-21 14:30:41.000000000 -0400
-@@ -126,6 +126,8 @@
+--- a/fs/locks.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/locks.c	2008-07-16 22:41:36.000000000 -0400
+@@ -127,6 +127,8 @@
  #include <linux/time.h>
  #include <linux/rcupdate.h>
  #include <linux/pid_namespace.h>
 +#include <linux/vs_base.h>
 +#include <linux/vs_limit.h>
  
- #include <asm/semaphore.h>
  #include <asm/uaccess.h>
+ 
 @@ -148,6 +150,8 @@ static struct kmem_cache *filelock_cache
  /* Allocate an empty lock structure. */
  static struct file_lock *locks_alloc_lock(void)
@@ -5013,7 +4900,7 @@
  }
  
  EXPORT_SYMBOL(locks_init_lock);
-@@ -246,6 +252,7 @@ void locks_copy_lock(struct file_lock *n
+@@ -247,6 +253,7 @@ void locks_copy_lock(struct file_lock *n
  	new->fl_file = fl->fl_file;
  	new->fl_ops = fl->fl_ops;
  	new->fl_lmops = fl->fl_lmops;
@@ -5021,7 +4908,7 @@
  
  	locks_copy_private(new, fl);
  }
-@@ -284,6 +291,11 @@ static int flock_make_lock(struct file *
+@@ -285,6 +292,11 @@ static int flock_make_lock(struct file *
  	fl->fl_flags = FL_FLOCK;
  	fl->fl_type = type;
  	fl->fl_end = OFFSET_MAX;
@@ -5033,7 +4920,7 @@
  	
  	*lock = fl;
  	return 0;
-@@ -449,6 +461,7 @@ static int lease_init(struct file *filp,
+@@ -450,6 +462,7 @@ static int lease_init(struct file *filp,
  
  	fl->fl_owner = current->files;
  	fl->fl_pid = current->tgid;
@@ -5041,7 +4928,7 @@
  
  	fl->fl_file = filp;
  	fl->fl_flags = FL_LEASE;
-@@ -468,6 +481,11 @@ static struct file_lock *lease_alloc(str
+@@ -469,6 +482,11 @@ static struct file_lock *lease_alloc(str
  	if (fl == NULL)
  		return ERR_PTR(error);
  
@@ -5053,15 +4940,15 @@
  	error = lease_init(filp, type, fl);
  	if (error) {
  		locks_free_lock(fl);
-@@ -774,6 +792,7 @@ static int flock_lock_file(struct file *
+@@ -769,6 +787,7 @@ static int flock_lock_file(struct file *
  	if (found)
- 		cond_resched();
+ 		cond_resched_bkl();
  
 +	new_fl->fl_xid = -1;
  find_conflict:
  	for_each_lock(inode, before) {
  		struct file_lock *fl = *before;
-@@ -792,6 +811,7 @@ find_conflict:
+@@ -787,6 +806,7 @@ find_conflict:
  		goto out;
  	locks_copy_lock(new_fl, request);
  	locks_insert_lock(before, new_fl);
@@ -5069,7 +4956,7 @@
  	new_fl = NULL;
  	error = 0;
  
-@@ -802,7 +822,8 @@ out:
+@@ -797,7 +817,8 @@ out:
  	return error;
  }
  
@@ -5079,7 +4966,7 @@
  {
  	struct file_lock *fl;
  	struct file_lock *new_fl = NULL;
-@@ -812,6 +833,8 @@ static int __posix_lock_file(struct inod
+@@ -807,6 +828,8 @@ static int __posix_lock_file(struct inod
  	struct file_lock **before;
  	int error, added = 0;
  
@@ -5088,7 +4975,7 @@
  	/*
  	 * We may need two file_lock structures for this operation,
  	 * so we get them in advance to avoid races.
-@@ -822,7 +845,11 @@ static int __posix_lock_file(struct inod
+@@ -817,7 +840,11 @@ static int __posix_lock_file(struct inod
  	    (request->fl_type != F_UNLCK ||
  	     request->fl_start != 0 || request->fl_end != OFFSET_MAX)) {
  		new_fl = locks_alloc_lock();
@@ -5100,7 +4987,7 @@
  	}
  
  	lock_kernel();
-@@ -1021,7 +1048,8 @@ static int __posix_lock_file(struct inod
+@@ -1016,7 +1043,8 @@ static int __posix_lock_file(struct inod
  int posix_lock_file(struct file *filp, struct file_lock *fl,
  			struct file_lock *conflock)
  {
@@ -5110,7 +4997,7 @@
  }
  EXPORT_SYMBOL(posix_lock_file);
  
-@@ -1111,7 +1139,7 @@ int locks_mandatory_area(int read_write,
+@@ -1106,7 +1134,7 @@ int locks_mandatory_area(int read_write,
  	fl.fl_end = offset + count - 1;
  
  	for (;;) {
@@ -5119,7 +5006,7 @@
  		if (error != -EAGAIN)
  			break;
  		if (!(fl.fl_flags & FL_SLEEP))
-@@ -1425,6 +1453,7 @@ int generic_setlease(struct file *filp, 
+@@ -1423,6 +1451,7 @@ int generic_setlease(struct file *filp, 
  
  	locks_copy_lock(new_fl, lease);
  	locks_insert_lock(before, new_fl);
@@ -5127,7 +5014,7 @@
  
  	*flp = new_fl;
  	return 0;
-@@ -1756,6 +1785,11 @@ int fcntl_setlk(unsigned int fd, struct 
+@@ -1753,6 +1782,11 @@ int fcntl_setlk(unsigned int fd, struct 
  	if (file_lock == NULL)
  		return -ENOLCK;
  
@@ -5139,7 +5026,7 @@
  	/*
  	 * This might block, so we do it before checking the inode.
  	 */
-@@ -1893,6 +1927,11 @@ int fcntl_setlk64(unsigned int fd, struc
+@@ -1890,6 +1924,11 @@ int fcntl_setlk64(unsigned int fd, struc
  	if (file_lock == NULL)
  		return -ENOLCK;
  
@@ -5151,7 +5038,7 @@
  	/*
  	 * This might block, so we do it before checking the inode.
  	 */
-@@ -2176,8 +2215,11 @@ static int locks_show(struct seq_file *f
+@@ -2173,8 +2212,11 @@ static int locks_show(struct seq_file *f
  
  	lock_get_status(f, fl, (long)f->private, "");
  
@@ -5164,12 +5051,12 @@
  
  	f->private++;
  	return 0;
---- a/fs/namei.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/namei.c	2008-04-22 19:23:22.000000000 -0400
-@@ -30,6 +30,13 @@
- #include <linux/capability.h>
+--- a/fs/namei.c	2008-08-12 01:41:51.000000000 -0400
++++ a/fs/namei.c	2008-08-12 01:42:21.000000000 -0400
+@@ -31,6 +31,13 @@
  #include <linux/file.h>
  #include <linux/fcntl.h>
+ #include <linux/device_cgroup.h>
 +#include <linux/proc_fs.h>
 +#include <linux/vserver/inode.h>
 +#include <linux/vs_base.h>
@@ -5180,7 +5067,7 @@
  #include <asm/namei.h>
  #include <asm/uaccess.h>
  
-@@ -225,6 +232,28 @@ int generic_permission(struct inode *ino
+@@ -226,6 +233,28 @@ int generic_permission(struct inode *ino
  	return -EACCES;
  }
  
@@ -5209,15 +5096,7 @@
  int permission(struct inode *inode, int mask, struct nameidata *nd)
  {
  	int retval, submask;
-@@ -239,14 +268,14 @@ int permission(struct inode *inode, int 
- 		/*
- 		 * Nobody gets write access to a read-only fs.
- 		 */
--		if (IS_RDONLY(inode) &&
-+		if ((IS_RDONLY(inode) || (nd && MNT_IS_RDONLY(nd->path.mnt))) &&
- 		    (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)))
- 			return -EROFS;
- 
+@@ -247,7 +276,7 @@ int permission(struct inode *inode, int 
  		/*
  		 * Nobody gets write access to an immutable file.
  		 */
@@ -5226,7 +5105,7 @@
  			return -EACCES;
  	}
  
-@@ -261,6 +290,11 @@ int permission(struct inode *inode, int 
+@@ -262,6 +291,11 @@ int permission(struct inode *inode, int 
  
  	/* Ordinary permission routines do not understand MAY_APPEND. */
  	submask = mask & ~MAY_APPEND;
@@ -5238,7 +5117,7 @@
  	if (inode->i_op && inode->i_op->permission) {
  		retval = inode->i_op->permission(inode, submask, nd);
  		if (!retval) {
-@@ -459,6 +493,8 @@ static int exec_permission_lite(struct i
+@@ -464,6 +498,8 @@ static int exec_permission_lite(struct i
  {
  	umode_t	mode = inode->i_mode;
  
@@ -5247,7 +5126,7 @@
  	if (inode->i_op && inode->i_op->permission)
  		return -EAGAIN;
  
-@@ -789,7 +825,8 @@ static __always_inline void follow_dotdo
+@@ -800,7 +836,8 @@ static __always_inline void follow_dotdo
  		if (nd->path.dentry == fs->root.dentry &&
  		    nd->path.mnt == fs->root.mnt) {
                          read_unlock(&fs->lock);
@@ -5257,7 +5136,7 @@
  		}
                  read_unlock(&fs->lock);
  		spin_lock(&dcache_lock);
-@@ -826,16 +863,39 @@ static int do_lookup(struct nameidata *n
+@@ -837,16 +874,39 @@ static int do_lookup(struct nameidata *n
  {
  	struct vfsmount *mnt = nd->path.mnt;
  	struct dentry *dentry = __d_lookup(nd->path.dentry, name);
@@ -5297,24 +5176,7 @@
  
  need_lookup:
  	dentry = real_lookup(nd->path.dentry, name, nd);
-@@ -1464,7 +1524,8 @@ static inline int check_sticky(struct in
-  * 10. We don't allow removal of NFS sillyrenamed files; it's handled by
-  *     nfs_async_unlink().
-  */
--static int may_delete(struct inode *dir,struct dentry *victim,int isdir)
-+static int may_delete(struct inode *dir, struct dentry *victim,
-+	int isdir, struct nameidata *nd)
- {
- 	int error;
- 
-@@ -1474,13 +1535,13 @@ static int may_delete(struct inode *dir,
- 	BUG_ON(victim->d_parent->d_inode != dir);
- 	audit_inode_child(victim->d_name.name, victim, dir);
- 
--	error = permission(dir,MAY_WRITE | MAY_EXEC, NULL);
-+	error = permission(dir,MAY_WRITE | MAY_EXEC, nd);
- 	if (error)
- 		return error;
+@@ -1499,7 +1559,7 @@ static int may_delete(struct inode *dir,
  	if (IS_APPEND(dir))
  		return -EPERM;
  	if (check_sticky(dir, victim->d_inode)||IS_APPEND(victim->d_inode)||
@@ -5323,24 +5185,24 @@
  		return -EPERM;
  	if (isdir) {
  		if (!S_ISDIR(victim->d_inode->i_mode))
-@@ -1626,6 +1687,14 @@ int may_open(struct nameidata *nd, int a
- 	} else if (IS_RDONLY(inode) && (acc_mode & MAY_WRITE))
- 		return -EROFS;
+@@ -1644,6 +1704,14 @@ int may_open(struct nameidata *nd, int a
+ 		flag &= ~O_TRUNC;
+ 	}
  
 +#ifdef	CONFIG_VSERVER_COWBL
 +	if (IS_COW(inode) && (flag & FMODE_WRITE)) {
 +		if (IS_COW_LINK(inode))
 +			return -EMLINK;
-+		inode->i_flags &= ~(S_IUNLINK|S_IMMUTABLE);
++		inode->i_flags &= ~(S_IXUNLINK|S_IMMUTABLE);
 +		mark_inode_dirty(inode);
 +	}
 +#endif
  	error = vfs_permission(nd, acc_mode);
  	if (error)
  		return error;
-@@ -1717,6 +1786,11 @@ int open_namei(int dfd, const char *path
- 	struct dentry *dir;
- 	int count = 0;
+@@ -1770,6 +1838,11 @@ struct file *do_filp_open(int dfd, const
+ 	int will_write;
+ 	int flag = open_to_namei_flags(open_flag);
  
 +#ifdef	CONFIG_VSERVER_COWBL
 +	int rflag = flag;
@@ -5350,10 +5212,10 @@
  	acc_mode = ACC_MODE(flag);
  
  	/* O_TRUNC implies we need access checks for write permissions */
-@@ -1810,6 +1884,22 @@ do_last:
- 		goto exit;
- ok:
- 	error = may_open(nd, acc_mode, flag);
+@@ -1893,6 +1966,22 @@ ok:
+ 			goto exit;
+ 	}
+ 	error = may_open(&nd, acc_mode, flag);
 +#ifdef	CONFIG_VSERVER_COWBL
 +	if (error == -EMLINK) {
 +		struct dentry *dentry;
@@ -5363,27 +5225,17 @@
 +			goto exit;
 +		}
 +		dput(dentry);
-+		release_open_intent(nd);
-+		path_put(&nd->path);
++		release_open_intent(&nd);
++		path_put(&nd.path);
 +		flag = rflag;
 +		mode = rmode;
 +		goto restart;
 +	}
 +#endif
- 	if (error)
- 		goto exit;
- 	return 0;
-@@ -1921,16 +2011,25 @@ fail:
- }
- EXPORT_SYMBOL_GPL(lookup_create);
- 
--int vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
-+int vfs_mknod(struct inode *dir, struct dentry *dentry,
-+	int mode, dev_t dev, struct nameidata *nd)
- {
--	int error = may_create(dir, dentry, NULL);
-+	int error = may_create(dir, dentry, nd);
- 
+ 	if (error) {
+ 		if (will_write)
+ 			mnt_drop_write(nd.path.mnt);
+@@ -2045,9 +2134,17 @@ int vfs_mknod(struct inode *dir, struct 
  	if (error)
  		return error;
  
@@ -5402,131 +5254,7 @@
  	if (!dir->i_op || !dir->i_op->mknod)
  		return -EPERM;
  
-@@ -1973,11 +2072,12 @@ asmlinkage long sys_mknodat(int dfd, con
- 			error = vfs_create(nd.path.dentry->d_inode,dentry,mode,&nd);
- 			break;
- 		case S_IFCHR: case S_IFBLK:
--			error = vfs_mknod(nd.path.dentry->d_inode,dentry,mode,
--					new_decode_dev(dev));
-+			error = vfs_mknod(nd.path.dentry->d_inode, dentry, mode,
-+					new_decode_dev(dev), &nd);
- 			break;
- 		case S_IFIFO: case S_IFSOCK:
--			error = vfs_mknod(nd.path.dentry->d_inode,dentry,mode,0);
-+			error = vfs_mknod(nd.path.dentry->d_inode, dentry, mode,
-+					0, &nd);
- 			break;
- 		case S_IFDIR:
- 			error = -EPERM;
-@@ -2000,9 +2100,10 @@ asmlinkage long sys_mknod(const char __u
- 	return sys_mknodat(AT_FDCWD, filename, mode, dev);
- }
- 
--int vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
-+int vfs_mkdir(struct inode *dir, struct dentry *dentry,
-+	int mode, struct nameidata *nd)
- {
--	int error = may_create(dir, dentry, NULL);
-+	int error = may_create(dir, dentry, nd);
- 
- 	if (error)
- 		return error;
-@@ -2044,7 +2145,7 @@ asmlinkage long sys_mkdirat(int dfd, con
- 
- 	if (!IS_POSIXACL(nd.path.dentry->d_inode))
- 		mode &= ~current->fs->umask;
--	error = vfs_mkdir(nd.path.dentry->d_inode, dentry, mode);
-+	error = vfs_mkdir(nd.path.dentry->d_inode, dentry, mode, &nd);
- 	dput(dentry);
- out_unlock:
- 	mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
-@@ -2087,9 +2188,10 @@ void dentry_unhash(struct dentry *dentry
- 	spin_unlock(&dcache_lock);
- }
- 
--int vfs_rmdir(struct inode *dir, struct dentry *dentry)
-+int vfs_rmdir(struct inode *dir, struct dentry *dentry,
-+	struct nameidata *nd)
- {
--	int error = may_delete(dir, dentry, 1);
-+	int error = may_delete(dir, dentry, 1, nd);
- 
- 	if (error)
- 		return error;
-@@ -2151,7 +2253,7 @@ static long do_rmdir(int dfd, const char
- 	error = PTR_ERR(dentry);
- 	if (IS_ERR(dentry))
- 		goto exit2;
--	error = vfs_rmdir(nd.path.dentry->d_inode, dentry);
-+	error = vfs_rmdir(nd.path.dentry->d_inode, dentry, &nd);
- 	dput(dentry);
- exit2:
- 	mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
-@@ -2167,9 +2269,10 @@ asmlinkage long sys_rmdir(const char __u
- 	return do_rmdir(AT_FDCWD, pathname);
- }
- 
--int vfs_unlink(struct inode *dir, struct dentry *dentry)
-+int vfs_unlink(struct inode *dir, struct dentry *dentry,
-+	struct nameidata *nd)
- {
--	int error = may_delete(dir, dentry, 0);
-+	int error = may_delete(dir, dentry, 0, nd);
- 
- 	if (error)
- 		return error;
-@@ -2232,7 +2335,7 @@ static long do_unlinkat(int dfd, const c
- 		inode = dentry->d_inode;
- 		if (inode)
- 			atomic_inc(&inode->i_count);
--		error = vfs_unlink(nd.path.dentry->d_inode, dentry);
-+		error = vfs_unlink(nd.path.dentry->d_inode, dentry, &nd);
- 	exit2:
- 		dput(dentry);
- 	}
-@@ -2267,9 +2370,10 @@ asmlinkage long sys_unlink(const char __
- 	return do_unlinkat(AT_FDCWD, pathname);
- }
- 
--int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname, int mode)
-+int vfs_symlink(struct inode *dir, struct dentry *dentry,
-+	const char *oldname, int mode, struct nameidata *nd)
- {
--	int error = may_create(dir, dentry, NULL);
-+	int error = may_create(dir, dentry, nd);
- 
- 	if (error)
- 		return error;
-@@ -2313,7 +2417,8 @@ asmlinkage long sys_symlinkat(const char
- 	if (IS_ERR(dentry))
- 		goto out_unlock;
- 
--	error = vfs_symlink(nd.path.dentry->d_inode, dentry, from, S_IALLUGO);
-+	error = vfs_symlink(nd.path.dentry->d_inode, dentry, from,
-+		S_IALLUGO, &nd);
- 	dput(dentry);
- out_unlock:
- 	mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
-@@ -2330,7 +2435,8 @@ asmlinkage long sys_symlink(const char _
- 	return sys_symlinkat(oldname, AT_FDCWD, newname);
- }
- 
--int vfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_dentry)
-+int vfs_link(struct dentry *old_dentry, struct inode *dir,
-+	struct dentry *new_dentry, struct nameidata *nd)
- {
- 	struct inode *inode = old_dentry->d_inode;
- 	int error;
-@@ -2338,7 +2444,7 @@ int vfs_link(struct dentry *old_dentry, 
- 	if (!inode)
- 		return -ENOENT;
- 
--	error = may_create(dir, new_dentry, NULL);
-+	error = may_create(dir, new_dentry, nd);
- 	if (error)
- 		return error;
- 
-@@ -2348,7 +2454,7 @@ int vfs_link(struct dentry *old_dentry, 
+@@ -2509,7 +2606,7 @@ int vfs_link(struct dentry *old_dentry, 
  	/*
  	 * A link to an append-only or immutable file cannot be created.
  	 */
@@ -5535,44 +5263,7 @@
  		return -EPERM;
  	if (!dir->i_op || !dir->i_op->link)
  		return -EPERM;
-@@ -2408,7 +2514,8 @@ asmlinkage long sys_linkat(int olddfd, c
- 	error = PTR_ERR(new_dentry);
- 	if (IS_ERR(new_dentry))
- 		goto out_unlock;
--	error = vfs_link(old_nd.path.dentry, nd.path.dentry->d_inode, new_dentry);
-+	error = vfs_link(old_nd.path.dentry, nd.path.dentry->d_inode,
-+		new_dentry, &nd);
- 	dput(new_dentry);
- out_unlock:
- 	mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
-@@ -2540,14 +2647,14 @@ int vfs_rename(struct inode *old_dir, st
- 	if (old_dentry->d_inode == new_dentry->d_inode)
-  		return 0;
-  
--	error = may_delete(old_dir, old_dentry, is_dir);
-+	error = may_delete(old_dir, old_dentry, is_dir, NULL);
- 	if (error)
- 		return error;
- 
- 	if (!new_dentry->d_inode)
- 		error = may_create(new_dir, new_dentry, NULL);
- 	else
--		error = may_delete(new_dir, new_dentry, is_dir);
-+		error = may_delete(new_dir, new_dentry, is_dir, NULL);
- 	if (error)
- 		return error;
- 
-@@ -2625,6 +2732,9 @@ static int do_rename(int olddfd, const c
- 	error = -EINVAL;
- 	if (old_dentry == trap)
- 		goto exit4;
-+	error = -EROFS;
-+	if (MNT_IS_RDONLY(newnd.path.mnt))
-+		goto exit4;
- 	new_dentry = lookup_hash(&newnd);
- 	error = PTR_ERR(new_dentry);
- 	if (IS_ERR(new_dentry))
-@@ -2718,6 +2828,214 @@ int vfs_follow_link(struct nameidata *nd
+@@ -2889,6 +2986,214 @@ int vfs_follow_link(struct nameidata *nd
  	return __vfs_follow_link(nd, link);
  }
  
@@ -5750,7 +5441,7 @@
 +		goto out_redo;
 +
 +	/* error path cleanup */
-+	vfs_unlink(dir->d_inode, new_path.dentry, &dir_nd);
++	vfs_unlink(dir->d_inode, new_path.dentry);
 +	dput(new_path.dentry);
 +
 +out_redo:
@@ -5787,12 +5478,12 @@
  /* get the link contents into pagecache */
  static char *page_getlink(struct dentry * dentry, struct page **ppage)
  {
---- a/fs/namespace.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/namespace.c	2008-04-21 17:20:53.000000000 -0400
-@@ -26,6 +26,11 @@
- #include <linux/mount.h>
+--- a/fs/namespace.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/namespace.c	2008-07-17 18:08:01.000000000 -0400
+@@ -27,6 +27,11 @@
  #include <linux/ramfs.h>
  #include <linux/log2.h>
+ #include <linux/idr.h>
 +#include <linux/vs_base.h>
 +#include <linux/vs_context.h>
 +#include <linux/vs_tag.h>
@@ -5801,7 +5492,7 @@
  #include <asm/uaccess.h>
  #include <asm/unistd.h>
  #include "pnode.h"
-@@ -244,6 +249,7 @@ static struct vfsmount *clone_mnt(struct
+@@ -572,6 +577,7 @@ static struct vfsmount *clone_mnt(struct
  		mnt->mnt_root = dget(root);
  		mnt->mnt_mountpoint = mnt->mnt_root;
  		mnt->mnt_parent = mnt;
@@ -5809,7 +5500,7 @@
  
  		if (flag & CL_SLAVE) {
  			list_add(&mnt->mnt_slave, &old->mnt_slave_list);
-@@ -323,6 +329,31 @@ static inline void mangle(struct seq_fil
+@@ -684,6 +690,31 @@ static inline void mangle(struct seq_fil
  	seq_escape(m, s, " \t\n\\");
  }
  
@@ -5841,102 +5532,15 @@
  /*
   * Simple .show_options callback for filesystems which don't want to
   * implement more complex mount option showing.
-@@ -388,44 +419,61 @@ static int show_vfsmnt(struct seq_file *
- 	struct vfsmount *mnt = list_entry(v, struct vfsmount, mnt_list);
- 	int err = 0;
- 	static struct proc_fs_info {
--		int flag;
--		char *str;
-+		int s_flag;
-+		int mnt_flag;
-+		char *set_str;
-+		char *unset_str;
- 	} fs_info[] = {
--		{ MS_SYNCHRONOUS, ",sync" },
--		{ MS_DIRSYNC, ",dirsync" },
--		{ MS_MANDLOCK, ",mand" },
--		{ 0, NULL }
--	};
--	static struct proc_fs_info mnt_info[] = {
--		{ MNT_NOSUID, ",nosuid" },
--		{ MNT_NODEV, ",nodev" },
--		{ MNT_NOEXEC, ",noexec" },
--		{ MNT_NOATIME, ",noatime" },
--		{ MNT_NODIRATIME, ",nodiratime" },
--		{ MNT_RELATIME, ",relatime" },
--		{ 0, NULL }
-+		{ MS_RDONLY, MNT_RDONLY, "ro", "rw" },
-+		{ MS_SYNCHRONOUS, 0, ",sync", NULL },
-+		{ MS_DIRSYNC, 0, ",dirsync", NULL },
-+		{ MS_MANDLOCK, 0, ",mand", NULL },
-+		{ MS_TAGGED, 0, ",tag", NULL },
-+		{ MS_NOATIME, MNT_NOATIME, ",noatime", NULL },
-+		{ MS_NODIRATIME, MNT_NODIRATIME, ",nodiratime", NULL },
-+		{ MS_RELATIME, MNT_RELATIME, ",relatime", NULL },
-+		{ 0, MNT_NOSUID, ",nosuid", NULL },
-+		{ 0, MNT_NODEV, ",nodev", NULL },
-+		{ 0, MNT_NOEXEC, ",noexec", NULL },
-+		{ 0, 0, NULL, NULL }
+@@ -756,6 +787,7 @@ static void show_sb_opts(struct seq_file
+ 		{ MS_SYNCHRONOUS, ",sync" },
+ 		{ MS_DIRSYNC, ",dirsync" },
+ 		{ MS_MANDLOCK, ",mand" },
++		{ MS_TAGGED, ",tag" },
+ 		{ 0, NULL }
  	};
--	struct proc_fs_info *fs_infop;
--	struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
-+	struct proc_fs_info *p;
-+	unsigned long s_flags = mnt->mnt_sb->s_flags;
-+	int mnt_flags = mnt->mnt_flags;
- 
--	mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none");
--	seq_putc(m, ' ');
--	seq_path(m, &mnt_path, " \t\n\\");
--	seq_putc(m, ' ');
--	mangle(m, mnt->mnt_sb->s_type->name);
--	if (mnt->mnt_sb->s_subtype && mnt->mnt_sb->s_subtype[0]) {
--		seq_putc(m, '.');
--		mangle(m, mnt->mnt_sb->s_subtype);
--	}
--	seq_puts(m, mnt->mnt_sb->s_flags & MS_RDONLY ? " ro" : " rw");
--	for (fs_infop = fs_info; fs_infop->flag; fs_infop++) {
--		if (mnt->mnt_sb->s_flags & fs_infop->flag)
--			seq_puts(m, fs_infop->str);
-+	if (vx_flags(VXF_HIDE_MOUNT, 0))
-+		return 0;
-+	if (!mnt_is_reachable(mnt) && !vx_check(0, VS_WATCH_P))
-+		return 0;
-+
-+	if (!vx_check(0, VS_ADMIN|VS_WATCH) &&
-+		mnt == current->fs->root.mnt) {
-+		seq_puts(m, "/dev/root / ");
-+	} else {
-+		struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
-+		mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none");
-+		seq_putc(m, ' ');
-+		seq_path(m, &mnt_path, " \t\n\\");
-+		seq_putc(m, ' ');
-+
-+		if (mnt->mnt_sb->s_subtype && mnt->mnt_sb->s_subtype[0]) {
-+			seq_putc(m, '.');
-+			mangle(m, mnt->mnt_sb->s_subtype);
-+		}
- 	}
--	for (fs_infop = mnt_info; fs_infop->flag; fs_infop++) {
--		if (mnt->mnt_flags & fs_infop->flag)
--			seq_puts(m, fs_infop->str);
-+	mangle(m, mnt->mnt_sb->s_type->name);
-+	seq_putc(m, ' ');
-+	for (p = fs_info; (p->s_flag | p->mnt_flag) ; p++) {
-+		if ((s_flags & p->s_flag) || (mnt_flags & p->mnt_flag)) {
-+			if (p->set_str)
-+				seq_puts(m, p->set_str);
-+		} else {
-+			if (p->unset_str)
-+				seq_puts(m, p->unset_str);
-+		}
- 	}
-+	if (mnt->mnt_flags & MNT_TAGID)
-+		seq_printf(m, ",tag=%d", mnt->mnt_tag);
- 	if (mnt->mnt_sb->s_op->show_options)
- 		err = mnt->mnt_sb->s_op->show_options(m, mnt);
- 	seq_puts(m, " 0 0\n");
-@@ -445,17 +493,27 @@ static int show_vfsstat(struct seq_file 
+ 	const struct proc_fs_info *fs_infop;
+@@ -885,17 +917,27 @@ static int show_vfsstat(struct seq_file 
  	struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
  	int err = 0;
  
@@ -5974,7 +5578,7 @@
  
  	/* file system type */
  	seq_puts(m, "with fstype ");
-@@ -693,7 +751,7 @@ asmlinkage long sys_umount(char __user *
+@@ -1134,7 +1176,7 @@ asmlinkage long sys_umount(char __user *
  		goto dput_and_out;
  
  	retval = -EPERM;
@@ -5983,7 +5587,7 @@
  		goto dput_and_out;
  
  	retval = do_umount(nd.path.mnt, flags);
-@@ -719,7 +777,7 @@ asmlinkage long sys_oldumount(char __use
+@@ -1160,7 +1202,7 @@ asmlinkage long sys_oldumount(char __use
  
  static int mount_is_safe(struct nameidata *nd)
  {
@@ -5992,7 +5596,7 @@
  		return 0;
  	return -EPERM;
  #ifdef notyet
-@@ -974,11 +1032,13 @@ static noinline int do_change_type(struc
+@@ -1453,11 +1495,13 @@ static noinline int do_change_type(struc
   * noinline this do_mount helper to save do_mount stack space.
   */
  static noinline int do_loopback(struct nameidata *nd, char *old_name,
@@ -6007,20 +5611,7 @@
  	if (err)
  		return err;
  	if (!old_name || !*old_name)
-@@ -1004,6 +1064,12 @@ static noinline int do_loopback(struct n
- 	if (!mnt)
- 		goto out;
- 
-+	mnt->mnt_flags = mnt_flags;
-+	if (flags & MS_TAGID) {
-+		mnt->mnt_tag = tag;
-+		mnt->mnt_flags |= MNT_TAGID;
-+	}
-+
- 	err = graft_tree(mnt, nd);
- 	if (err) {
- 		LIST_HEAD(umount_list);
-@@ -1012,6 +1078,7 @@ static noinline int do_loopback(struct n
+@@ -1491,6 +1535,7 @@ static noinline int do_loopback(struct n
  		spin_unlock(&vfsmount_lock);
  		release_mounts(&umount_list);
  	}
@@ -6028,7 +5619,7 @@
  
  out:
  	up_write(&namespace_sem);
-@@ -1026,12 +1093,12 @@ out:
+@@ -1522,12 +1567,12 @@ static int change_mount_flags(struct vfs
   * noinline this do_mount helper to save do_mount stack space.
   */
  static noinline int do_remount(struct nameidata *nd, int flags, int mnt_flags,
@@ -6043,7 +5634,7 @@
  		return -EPERM;
  
  	if (!check_mnt(nd->path.mnt))
-@@ -1069,7 +1136,7 @@ static noinline int do_move_mount(struct
+@@ -1568,7 +1613,7 @@ static noinline int do_move_mount(struct
  	struct path parent_path;
  	struct vfsmount *p;
  	int err = 0;
@@ -6052,7 +5643,7 @@
  		return -EPERM;
  	if (!old_name || !*old_name)
  		return -EINVAL;
-@@ -1152,7 +1219,7 @@ static noinline int do_new_mount(struct 
+@@ -1651,7 +1696,7 @@ static noinline int do_new_mount(struct 
  		return -EINVAL;
  
  	/* we need capabilities... */
@@ -6061,7 +5652,7 @@
  		return -EPERM;
  
  	mnt = do_kern_mount(type, flags, name, data);
-@@ -1397,6 +1464,7 @@ long do_mount(char *dev_name, char *dir_
+@@ -1896,6 +1941,7 @@ long do_mount(char *dev_name, char *dir_
  	struct nameidata nd;
  	int retval = 0;
  	int mnt_flags = 0;
@@ -6069,7 +5660,7 @@
  
  	/* Discard magic */
  	if ((flags & MS_MGC_MSK) == MS_MGC_VAL)
-@@ -1412,7 +1480,17 @@ long do_mount(char *dev_name, char *dir_
+@@ -1911,6 +1957,14 @@ long do_mount(char *dev_name, char *dir_
  	if (data_page)
  		((char *)data_page)[PAGE_SIZE - 1] = 0;
  
@@ -6082,21 +5673,18 @@
 +	}
 +
  	/* Separate the per-mountpoint flags */
-+	if (flags & MS_RDONLY)
-+		mnt_flags |= MNT_RDONLY;
  	if (flags & MS_NOSUID)
  		mnt_flags |= MNT_NOSUID;
- 	if (flags & MS_NODEV)
-@@ -1426,6 +1504,8 @@ long do_mount(char *dev_name, char *dir_
- 	if (flags & MS_RELATIME)
- 		mnt_flags |= MNT_RELATIME;
+@@ -1927,6 +1981,8 @@ long do_mount(char *dev_name, char *dir_
+ 	if (flags & MS_RDONLY)
+ 		mnt_flags |= MNT_READONLY;
  
 +	if (!capable(CAP_SYS_ADMIN))
 +		mnt_flags |= MNT_NODEV;
  	flags &= ~(MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_ACTIVE |
  		   MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT);
  
-@@ -1440,9 +1520,9 @@ long do_mount(char *dev_name, char *dir_
+@@ -1942,9 +1998,9 @@ long do_mount(char *dev_name, char *dir_
  
  	if (flags & MS_REMOUNT)
  		retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags,
@@ -6108,7 +5696,7 @@
  	else if (flags & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE))
  		retval = do_change_type(&nd, flags);
  	else if (flags & MS_MOVE)
-@@ -1515,6 +1595,7 @@ static struct mnt_namespace *dup_mnt_ns(
+@@ -2017,6 +2073,7 @@ static struct mnt_namespace *dup_mnt_ns(
  		q = next_mnt(q, new_ns->root);
  	}
  	up_write(&namespace_sem);
@@ -6116,16 +5704,16 @@
  
  	if (rootmnt)
  		mntput(rootmnt);
-@@ -1850,5 +1931,6 @@ void __put_mnt_ns(struct mnt_namespace *
+@@ -2349,5 +2406,6 @@ void __put_mnt_ns(struct mnt_namespace *
  	spin_unlock(&vfsmount_lock);
  	up_write(&namespace_sem);
  	release_mounts(&umount_list);
 +	atomic_dec(&vs_global_mnt_ns);
  	kfree(ns);
  }
---- a/fs/nfs/client.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/nfs/client.c	2008-04-19 15:14:52.000000000 -0400
-@@ -589,6 +589,9 @@ static int nfs_init_server_rpcclient(str
+--- a/fs/nfs/client.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/nfs/client.c	2008-07-16 22:41:36.000000000 -0400
+@@ -598,6 +598,9 @@ static int nfs_init_server_rpcclient(str
  	if (server->flags & NFS_MOUNT_SOFT)
  		server->client->cl_softrtry = 1;
  
@@ -6135,7 +5723,7 @@
  	return 0;
  }
  
-@@ -742,6 +745,10 @@ static void nfs_server_set_fsinfo(struct
+@@ -763,6 +766,10 @@ static void nfs_server_set_fsinfo(struct
  		server->acdirmin = server->acdirmax = 0;
  	}
  
@@ -6146,8 +5734,8 @@
  	server->maxfilesize = fsinfo->maxfilesize;
  
  	/* We're airborne Set socket buffersize */
---- a/fs/nfs/dir.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/nfs/dir.c	2008-04-21 16:52:03.000000000 -0400
+--- a/fs/nfs/dir.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/nfs/dir.c	2008-07-16 22:41:36.000000000 -0400
 @@ -34,6 +34,7 @@
  #include <linux/namei.h>
  #include <linux/mount.h>
@@ -6164,18 +5752,8 @@
  no_entry:
  	res = d_materialise_unique(dentry, inode);
  	if (res != NULL) {
-@@ -967,7 +969,8 @@ static int is_atomic_open(struct inode *
- 	if (nd->flags & LOOKUP_DIRECTORY)
- 		return 0;
- 	/* Are we trying to write to a read only partition? */
--	if (IS_RDONLY(dir) && (nd->intent.open.flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
-+	if ((IS_RDONLY(dir) || MNT_IS_RDONLY(nd->path.mnt)) &&
-+		(nd->intent.open.flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
- 		return 0;
- 	return 1;
- }
---- a/fs/nfs/inode.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/nfs/inode.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/nfs/inode.c	2008-08-12 01:41:51.000000000 -0400
++++ a/fs/nfs/inode.c	2008-08-12 01:42:21.000000000 -0400
 @@ -37,6 +37,7 @@
  #include <linux/vfs.h>
  #include <linux/inet.h>
@@ -6184,7 +5762,7 @@
  
  #include <asm/system.h>
  #include <asm/uaccess.h>
-@@ -316,8 +317,10 @@ nfs_fhget(struct super_block *sb, struct
+@@ -314,8 +315,10 @@ nfs_fhget(struct super_block *sb, struct
  			nfsi->change_attr = fattr->change_attr;
  		inode->i_size = nfs_size_to_loff_t(fattr->size);
  		inode->i_nlink = fattr->nlink;
@@ -6197,7 +5775,7 @@
  		if (fattr->valid & (NFS_ATTR_FATTR_V3 | NFS_ATTR_FATTR_V4)) {
  			/*
  			 * report the blocks in 512byte units
-@@ -410,6 +413,8 @@ void nfs_setattr_update_inode(struct ino
+@@ -408,6 +411,8 @@ void nfs_setattr_update_inode(struct ino
  			inode->i_uid = attr->ia_uid;
  		if ((attr->ia_valid & ATTR_GID) != 0)
  			inode->i_gid = attr->ia_gid;
@@ -6206,7 +5784,7 @@
  		spin_lock(&inode->i_lock);
  		NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL;
  		spin_unlock(&inode->i_lock);
-@@ -841,6 +846,9 @@ static int nfs_check_inode_attributes(st
+@@ -849,6 +854,9 @@ static int nfs_check_inode_attributes(st
  	struct nfs_inode *nfsi = NFS_I(inode);
  	loff_t cur_size, new_isize;
  	unsigned long invalid = 0;
@@ -6216,7 +5794,7 @@
  
  
  	/* Has the inode gone and changed behind our back? */
-@@ -865,10 +873,15 @@ static int nfs_check_inode_attributes(st
+@@ -873,10 +881,15 @@ static int nfs_check_inode_attributes(st
  	if (cur_size != new_isize && nfsi->npages == 0)
  		invalid |= NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE;
  
@@ -6234,7 +5812,7 @@
  		invalid |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS | NFS_INO_INVALID_ACL;
  
  	/* Has the link count changed? */
-@@ -989,6 +1002,9 @@ static int nfs_update_inode(struct inode
+@@ -997,6 +1010,9 @@ static int nfs_update_inode(struct inode
  	loff_t cur_isize, new_isize;
  	unsigned long invalid = 0;
  	unsigned long now = jiffies;
@@ -6243,8 +5821,8 @@
 +	tag_t tag;
  
  	dfprintk(VFS, "NFS: %s(%s/%ld ct=%d info=0x%x)\n",
- 			__FUNCTION__, inode->i_sb->s_id, inode->i_ino,
-@@ -1062,15 +1078,21 @@ static int nfs_update_inode(struct inode
+ 			__func__, inode->i_sb->s_id, inode->i_ino,
+@@ -1070,15 +1086,21 @@ static int nfs_update_inode(struct inode
  	memcpy(&inode->i_atime, &fattr->atime, sizeof(inode->i_atime));
  	nfsi->change_attr = fattr->change_attr;
  
@@ -6270,8 +5848,8 @@
  
  	if (fattr->valid & (NFS_ATTR_FATTR_V3 | NFS_ATTR_FATTR_V4)) {
  		/*
---- a/fs/nfs/nfs3xdr.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/nfs/nfs3xdr.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/nfs/nfs3xdr.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/nfs/nfs3xdr.c	2008-07-16 22:41:36.000000000 -0400
 @@ -22,6 +22,7 @@
  #include <linux/nfs3.h>
  #include <linux/nfs_fs.h>
@@ -6362,7 +5940,7 @@
  		*p++ = htonl(MAJOR(args->rdev));
  		*p++ = htonl(MINOR(args->rdev));
 --- a/fs/nfs/nfsroot.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/nfs/nfsroot.c	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/nfs/nfsroot.c	2008-07-16 22:41:36.000000000 -0400
 @@ -119,12 +119,12 @@ static int mount_port __initdata = 0;		/
  enum {
  	/* Options that take integer arguments */
@@ -6409,8 +5987,8 @@
  			default:
  				printk(KERN_WARNING "Root-NFS: unknown "
  					"option: %s\n", p);
---- a/fs/nfs/super.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/nfs/super.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/nfs/super.c	2008-07-14 17:22:49.000000000 -0400
++++ a/fs/nfs/super.c	2008-07-16 22:41:36.000000000 -0400
 @@ -50,6 +50,7 @@
  #include <linux/nfs_xdr.h>
  #include <linux/magic.h>
@@ -6419,7 +5997,7 @@
  
  #include <asm/system.h>
  #include <asm/uaccess.h>
-@@ -458,6 +459,7 @@ static void nfs_show_mount_options(struc
+@@ -502,6 +503,7 @@ static void nfs_show_mount_options(struc
  		{ NFS_MOUNT_NOACL, ",noacl", "" },
  		{ NFS_MOUNT_NORDIRPLUS, ",nordirplus", "" },
  		{ NFS_MOUNT_UNSHARED, ",nosharecache", ""},
@@ -6427,17 +6005,17 @@
  		{ 0, NULL, NULL }
  	};
  	const struct proc_nfs_info *nfs_infop;
---- a/fs/nfsd/auth.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/nfsd/auth.c	2008-04-19 17:07:41.000000000 -0400
+--- a/fs/nfsd/auth.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/nfsd/auth.c	2008-07-17 17:19:21.000000000 -0400
 @@ -10,6 +10,7 @@
  #include <linux/sunrpc/svcauth.h>
  #include <linux/nfsd/nfsd.h>
  #include <linux/nfsd/export.h>
 +#include <linux/vs_tag.h>
+ #include "auth.h"
  
  int nfsexp_flags(struct svc_rqst *rqstp, struct svc_export *exp)
- {
-@@ -54,19 +55,23 @@ int nfsd_setuser(struct svc_rqst *rqstp,
+@@ -55,19 +56,23 @@ int nfsd_setuser(struct svc_rqst *rqstp,
  		get_group_info(cred.cr_group_info);
  
  	if (cred.cr_uid != (uid_t) -1)
@@ -6465,7 +6043,7 @@
  			cap_drop_nfsd_set(current->cap_effective);
  	} else {
 --- a/fs/nfsd/nfs3xdr.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/nfsd/nfs3xdr.c	2008-04-19 17:08:09.000000000 -0400
++++ a/fs/nfsd/nfs3xdr.c	2008-07-16 22:41:36.000000000 -0400
 @@ -21,6 +21,7 @@
  #include <linux/sunrpc/svc.h>
  #include <linux/nfsd/nfsd.h>
@@ -6516,37 +6094,8 @@
  	if (S_ISLNK(stat->mode) && stat->size > NFS3_MAXPATHLEN) {
  		p = xdr_encode_hyper(p, (u64) NFS3_MAXPATHLEN);
  	} else {
---- a/fs/nfsd/nfs4recover.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/nfsd/nfs4recover.c	2008-04-20 13:24:11.000000000 -0400
-@@ -154,7 +154,7 @@ nfsd4_create_clid_dir(struct nfs4_client
- 		dprintk("NFSD: nfsd4_create_clid_dir: DIRECTORY EXISTS\n");
- 		goto out_put;
- 	}
--	status = vfs_mkdir(rec_dir.path.dentry->d_inode, dentry, S_IRWXU);
-+	status = vfs_mkdir(rec_dir.path.dentry->d_inode, dentry, S_IRWXU, NULL);
- out_put:
- 	dput(dentry);
- out_unlock:
-@@ -258,7 +258,7 @@ nfsd4_remove_clid_file(struct dentry *di
- 		return -EINVAL;
- 	}
- 	mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
--	status = vfs_unlink(dir->d_inode, dentry);
-+	status = vfs_unlink(dir->d_inode, dentry, NULL);
- 	mutex_unlock(&dir->d_inode->i_mutex);
- 	return status;
- }
-@@ -273,7 +273,7 @@ nfsd4_clear_clid_dir(struct dentry *dir,
- 	 * a kernel from the future.... */
- 	nfsd4_list_rec_dir(dentry, nfsd4_remove_clid_file);
- 	mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
--	status = vfs_rmdir(dir->d_inode, dentry);
-+	status = vfs_rmdir(dir->d_inode, dentry, NULL);
- 	mutex_unlock(&dir->d_inode->i_mutex);
- 	return status;
- }
---- a/fs/nfsd/nfs4xdr.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/nfsd/nfs4xdr.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/nfsd/nfs4xdr.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/nfsd/nfs4xdr.c	2008-07-16 22:41:36.000000000 -0400
 @@ -58,6 +58,7 @@
  #include <linux/nfs4_acl.h>
  #include <linux/sunrpc/gss_api.h>
@@ -6555,7 +6104,7 @@
  
  #define NFSDDBG_FACILITY		NFSDDBG_XDR
  
-@@ -1759,14 +1760,18 @@ out_acl:
+@@ -1745,14 +1746,18 @@ out_acl:
  		WRITE32(stat.nlink);
  	}
  	if (bmval1 & FATTR4_WORD1_OWNER) {
@@ -6577,7 +6126,7 @@
  			goto out_resource;
  		if (status)
 --- a/fs/nfsd/nfsxdr.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/nfsd/nfsxdr.c	2008-04-20 13:23:36.000000000 -0400
++++ a/fs/nfsd/nfsxdr.c	2008-07-16 22:41:36.000000000 -0400
 @@ -15,6 +15,7 @@
  #include <linux/nfsd/nfsd.h>
  #include <linux/nfsd/xdr.h>
@@ -6626,73 +6175,8 @@
  
  	if (S_ISLNK(type) && stat->size > NFS_MAXPATHLEN) {
  		*p++ = htonl(NFS_MAXPATHLEN);
---- a/fs/nfsd/vfs.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/nfsd/vfs.c	2008-04-21 17:24:34.000000000 -0400
-@@ -1258,13 +1258,13 @@ nfsd_create(struct svc_rqst *rqstp, stru
- 		host_err = vfs_create(dirp, dchild, iap->ia_mode, NULL);
- 		break;
- 	case S_IFDIR:
--		host_err = vfs_mkdir(dirp, dchild, iap->ia_mode);
-+		host_err = vfs_mkdir(dirp, dchild, iap->ia_mode, NULL);
- 		break;
- 	case S_IFCHR:
- 	case S_IFBLK:
- 	case S_IFIFO:
- 	case S_IFSOCK:
--		host_err = vfs_mknod(dirp, dchild, iap->ia_mode, rdev);
-+		host_err = vfs_mknod(dirp, dchild, iap->ia_mode, rdev, NULL);
- 		break;
- 	default:
- 	        printk("nfsd: bad file type %o in nfsd_create\n", type);
-@@ -1529,11 +1529,13 @@ nfsd_symlink(struct svc_rqst *rqstp, str
- 		else {
- 			strncpy(path_alloced, path, plen);
- 			path_alloced[plen] = 0;
--			host_err = vfs_symlink(dentry->d_inode, dnew, path_alloced, mode);
-+			host_err = vfs_symlink(dentry->d_inode, dnew,
-+				path_alloced, mode, NULL);
- 			kfree(path_alloced);
- 		}
- 	} else
--		host_err = vfs_symlink(dentry->d_inode, dnew, path, mode);
-+		host_err = vfs_symlink(dentry->d_inode, dnew,
-+			path, mode, NULL);
- 
- 	if (!host_err) {
- 		if (EX_ISSYNC(fhp->fh_export))
-@@ -1592,7 +1594,7 @@ nfsd_link(struct svc_rqst *rqstp, struct
- 	dold = tfhp->fh_dentry;
- 	dest = dold->d_inode;
- 
--	host_err = vfs_link(dold, dirp, dnew);
-+	host_err = vfs_link(dold, dirp, dnew, NULL);
- 	if (!host_err) {
- 		if (EX_ISSYNC(ffhp->fh_export)) {
- 			err = nfserrno(nfsd_sync_dir(ddir));
-@@ -1757,9 +1759,9 @@ nfsd_unlink(struct svc_rqst *rqstp, stru
- 			host_err = -EPERM;
- 		} else
- #endif
--		host_err = vfs_unlink(dirp, rdentry);
-+		host_err = vfs_unlink(dirp, rdentry, NULL);
- 	} else { /* It's RMDIR */
--		host_err = vfs_rmdir(dirp, rdentry);
-+		host_err = vfs_rmdir(dirp, rdentry, NULL);
- 	}
- 
- 	dput(rdentry);
-@@ -1876,7 +1878,8 @@ nfsd_permission(struct svc_rqst *rqstp, 
- 	 */
- 	if (!(acc & MAY_LOCAL_ACCESS))
- 		if (acc & (MAY_WRITE | MAY_SATTR | MAY_TRUNC)) {
--			if (exp_rdonly(rqstp, exp) || IS_RDONLY(inode))
-+			if (exp_rdonly(rqstp, exp) || IS_RDONLY(inode)
-+				|| MNT_IS_RDONLY(exp->ex_path.mnt))
- 				return nfserr_rofs;
- 			if (/* (acc & MAY_WRITE) && */ IS_IMMUTABLE(inode))
- 				return nfserr_perm;
---- a/fs/ocfs2/dlm/dlmfs.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ocfs2/dlm/dlmfs.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/ocfs2/dlm/dlmfs.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/ocfs2/dlm/dlmfs.c	2008-07-16 22:41:36.000000000 -0400
 @@ -43,6 +43,7 @@
  #include <linux/init.h>
  #include <linux/string.h>
@@ -6717,9 +6201,9 @@
  	inode->i_blocks = 0;
  	inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info;
  	inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
---- a/fs/ocfs2/dlmglue.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ocfs2/dlmglue.c	2008-04-19 15:14:52.000000000 -0400
-@@ -1665,6 +1665,7 @@ static void __ocfs2_stuff_meta_lvb(struc
+--- a/fs/ocfs2/dlmglue.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/ocfs2/dlmglue.c	2008-07-16 22:41:36.000000000 -0400
+@@ -1769,6 +1769,7 @@ static void __ocfs2_stuff_meta_lvb(struc
  	lvb->lvb_iclusters = cpu_to_be32(oi->ip_clusters);
  	lvb->lvb_iuid      = cpu_to_be32(inode->i_uid);
  	lvb->lvb_igid      = cpu_to_be32(inode->i_gid);
@@ -6727,7 +6211,7 @@
  	lvb->lvb_imode     = cpu_to_be16(inode->i_mode);
  	lvb->lvb_inlink    = cpu_to_be16(inode->i_nlink);
  	lvb->lvb_iatime_packed  =
-@@ -1719,6 +1720,7 @@ static void ocfs2_refresh_inode_from_lvb
+@@ -1823,6 +1824,7 @@ static void ocfs2_refresh_inode_from_lvb
  
  	inode->i_uid     = be32_to_cpu(lvb->lvb_iuid);
  	inode->i_gid     = be32_to_cpu(lvb->lvb_igid);
@@ -6735,8 +6219,8 @@
  	inode->i_mode    = be16_to_cpu(lvb->lvb_imode);
  	inode->i_nlink   = be16_to_cpu(lvb->lvb_inlink);
  	ocfs2_unpack_timespec(&inode->i_atime,
---- a/fs/ocfs2/dlmglue.h	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ocfs2/dlmglue.h	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/ocfs2/dlmglue.h	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/ocfs2/dlmglue.h	2008-07-16 22:41:36.000000000 -0400
 @@ -46,7 +46,8 @@ struct ocfs2_meta_lvb {
  	__be16       lvb_inlink;
  	__be32       lvb_iattr;
@@ -6747,9 +6231,9 @@
  };
  
  /* ocfs2_inode_lock_full() 'arg_flags' flags */
---- a/fs/ocfs2/file.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ocfs2/file.c	2008-04-19 15:14:52.000000000 -0400
-@@ -1054,13 +1054,15 @@ int ocfs2_setattr(struct dentry *dentry,
+--- a/fs/ocfs2/file.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/ocfs2/file.c	2008-07-16 22:41:36.000000000 -0400
+@@ -1058,13 +1058,15 @@ int ocfs2_setattr(struct dentry *dentry,
  		mlog(0, "uid change: %d\n", attr->ia_uid);
  	if (attr->ia_valid & ATTR_GID)
  		mlog(0, "gid change: %d\n", attr->ia_gid);
@@ -6766,7 +6250,7 @@
  	if (!(attr->ia_valid & OCFS2_VALID_ATTRS)) {
  		mlog(0, "can't handle attrs: 0x%x\n", attr->ia_valid);
  		return 0;
-@@ -2229,6 +2231,7 @@ const struct inode_operations ocfs2_file
+@@ -2233,6 +2235,7 @@ const struct inode_operations ocfs2_file
  const struct inode_operations ocfs2_special_file_iops = {
  	.setattr	= ocfs2_setattr,
  	.getattr	= ocfs2_getattr,
@@ -6775,7 +6259,7 @@
  };
  
 --- a/fs/ocfs2/inode.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ocfs2/inode.c	2008-04-21 10:16:08.000000000 -0400
++++ a/fs/ocfs2/inode.c	2008-07-16 22:41:36.000000000 -0400
 @@ -28,6 +28,7 @@
  #include <linux/slab.h>
  #include <linux/highmem.h>
@@ -6792,46 +6276,116 @@
  #include "journal.h"
  #include "namei.h"
  #include "suballoc.h"
-@@ -79,6 +81,10 @@ void ocfs2_set_inode_flags(struct inode 
+@@ -74,11 +76,13 @@ void ocfs2_set_inode_flags(struct inode 
+ {
+ 	unsigned int flags = OCFS2_I(inode)->ip_attr;
+ 
+-	inode->i_flags &= ~(S_IMMUTABLE |
++	inode->i_flags &= ~(S_IMMUTABLE | S_IXUNLINK |
+ 		S_SYNC | S_APPEND | S_NOATIME | S_DIRSYNC);
  
  	if (flags & OCFS2_IMMUTABLE_FL)
  		inode->i_flags |= S_IMMUTABLE;
-+	if (flags & OCFS2_IUNLINK_FL)
-+		inode->i_flags |= S_IUNLINK;
-+	if (flags & OCFS2_BARRIER_FL)
-+		inode->i_flags |= S_BARRIER;
++	if (flags & OCFS2_IXUNLINK_FL)
++		inode->i_flags |= S_IXUNLINK;
  
  	if (flags & OCFS2_SYNC_FL)
  		inode->i_flags |= S_SYNC;
-@@ -109,6 +115,27 @@ void ocfs2_get_inode_flags(struct ocfs2_
+@@ -88,25 +92,89 @@ void ocfs2_set_inode_flags(struct inode 
+ 		inode->i_flags |= S_NOATIME;
+ 	if (flags & OCFS2_DIRSYNC_FL)
+ 		inode->i_flags |= S_DIRSYNC;
++
++	inode->i_vflags &= ~(V_BARRIER | V_COW);
++
++	if (flags & OCFS2_BARRIER_FL)
++		inode->i_vflags |= V_BARRIER;
++	if (flags & OCFS2_COW_FL)
++		inode->i_vflags |= V_COW;
+ }
+ 
+ /* Propagate flags from i_flags to OCFS2_I(inode)->ip_attr */
+ void ocfs2_get_inode_flags(struct ocfs2_inode_info *oi)
+ {
+ 	unsigned int flags = oi->vfs_inode.i_flags;
++	unsigned int vflags = oi->vfs_inode.i_vflags;
++
++	oi->ip_attr &= ~(OCFS2_SYNC_FL | OCFS2_APPEND_FL |
++			OCFS2_IMMUTABLE_FL | OCFS2_IXUNLINK_FL |
++			OCFS2_NOATIME_FL | OCFS2_DIRSYNC_FL |
++			OCFS2_BARRIER_FL | OCFS2_COW_FL);
++
++	if (flags & S_IMMUTABLE)
++		oi->ip_attr |= OCFS2_IMMUTABLE_FL;
++	if (flags & S_IXUNLINK)
++		oi->ip_attr |= OCFS2_IXUNLINK_FL;
+ 
+-	oi->ip_attr &= ~(OCFS2_SYNC_FL|OCFS2_APPEND_FL|
+-			OCFS2_IMMUTABLE_FL|OCFS2_NOATIME_FL|OCFS2_DIRSYNC_FL);
+ 	if (flags & S_SYNC)
+ 		oi->ip_attr |= OCFS2_SYNC_FL;
+ 	if (flags & S_APPEND)
+ 		oi->ip_attr |= OCFS2_APPEND_FL;
+-	if (flags & S_IMMUTABLE)
+-		oi->ip_attr |= OCFS2_IMMUTABLE_FL;
+ 	if (flags & S_NOATIME)
+ 		oi->ip_attr |= OCFS2_NOATIME_FL;
+ 	if (flags & S_DIRSYNC)
  		oi->ip_attr |= OCFS2_DIRSYNC_FL;
- }
- 
++
++	if (vflags & V_BARRIER)
++		oi->ip_attr |= OCFS2_BARRIER_FL;
++	if (vflags & V_COW)
++		oi->ip_attr |= OCFS2_COW_FL;
++}
++
 +int ocfs2_sync_flags(struct inode *inode)
 +{
-+	unsigned int oldflags, newflags;
++	struct ocfs2_inode_info *ocfs2_inode = OCFS2_I(inode);
++	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
++	handle_t *handle = NULL;
++	struct buffer_head *bh = NULL;
++	int status;
++
++	mutex_lock(&inode->i_mutex);
++
++	status = ocfs2_inode_lock(inode, &bh, 1);
++	if (status < 0) {
++		mlog_errno(status);
++		goto bail;
++	}
++
++	status = -EROFS;
++	if (IS_RDONLY(inode))
++		goto bail_unlock;
++
++	handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
++	if (IS_ERR(handle)) {
++		status = PTR_ERR(handle);
++		mlog_errno(status);
++		goto bail_unlock;
++	}
++
++	ocfs2_set_inode_flags(inode);
++	status = ocfs2_mark_inode_dirty(handle, inode, bh);
++	if (status < 0)
++		mlog_errno(status);
++
++	ocfs2_commit_trans(osb, handle);
++bail_unlock:
++	ocfs2_inode_unlock(inode, 1);
++bail:
++	mutex_unlock(&inode->i_mutex);
 +
-+	oldflags = OCFS2_I(inode)->ip_flags;
-+	newflags = oldflags & ~(OCFS2_IMMUTABLE_FL |
-+		OCFS2_IUNLINK_FL | OCFS2_BARRIER_FL);
-+
-+	if (IS_IMMUTABLE(inode))
-+		newflags |= OCFS2_IMMUTABLE_FL;
-+	if (IS_IUNLINK(inode))
-+		newflags |= OCFS2_IUNLINK_FL;
-+	if (IS_BARRIER(inode))
-+		newflags |= OCFS2_BARRIER_FL;
-+
-+	if (oldflags ^ newflags)
-+		return ocfs2_set_inode_attr(inode,
-+			newflags, OCFS2_FL_MASK);
-+	return 0;
-+}
++	if (bh)
++		brelse(bh);
 +
++	mlog_exit(status);
++	return status;
+ }
+ 
  struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, unsigned flags,
- 			 int sysfile_type)
- {
-@@ -219,6 +246,8 @@ int ocfs2_populate_inode(struct inode *i
+@@ -219,6 +287,8 @@ int ocfs2_populate_inode(struct inode *i
  	struct super_block *sb;
  	struct ocfs2_super *osb;
  	int status = -EINVAL;
@@ -6840,7 +6394,7 @@
  
  	mlog_entry("(0x%p, size:%llu)\n", inode,
  		   (unsigned long long)le64_to_cpu(fe->i_size));
-@@ -254,8 +283,12 @@ int ocfs2_populate_inode(struct inode *i
+@@ -254,8 +324,12 @@ int ocfs2_populate_inode(struct inode *i
  	inode->i_generation = le32_to_cpu(fe->i_generation);
  	inode->i_rdev = huge_decode_dev(le64_to_cpu(fe->id1.dev1.i_rdev));
  	inode->i_mode = le16_to_cpu(fe->i_mode);
@@ -6855,7 +6409,7 @@
  
  	/* Fast symlinks will have i_size but no allocated clusters. */
  	if (S_ISLNK(inode->i_mode) && !fe->i_clusters)
-@@ -1230,8 +1263,11 @@ int ocfs2_mark_inode_dirty(handle_t *han
+@@ -1230,8 +1304,11 @@ int ocfs2_mark_inode_dirty(handle_t *han
  
  	fe->i_size = cpu_to_le64(i_size_read(inode));
  	fe->i_links_count = cpu_to_le16(inode->i_nlink);
@@ -6869,7 +6423,7 @@
  	fe->i_mode = cpu_to_le16(inode->i_mode);
  	fe->i_atime = cpu_to_le64(inode->i_atime.tv_sec);
  	fe->i_atime_nsec = cpu_to_le32(inode->i_atime.tv_nsec);
-@@ -1259,16 +1295,25 @@ leave:
+@@ -1259,16 +1336,25 @@ leave:
  void ocfs2_refresh_inode(struct inode *inode,
  			 struct ocfs2_dinode *fe)
  {
@@ -6898,7 +6452,7 @@
  	if (S_ISLNK(inode->i_mode) && le32_to_cpu(fe->i_clusters) == 0)
  		inode->i_blocks = 0;
 --- a/fs/ocfs2/inode.h	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ocfs2/inode.h	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/ocfs2/inode.h	2008-07-16 22:41:36.000000000 -0400
 @@ -143,6 +143,7 @@ int ocfs2_aio_write(struct file *file, s
  
  void ocfs2_set_inode_flags(struct inode *inode);
@@ -6907,9 +6461,9 @@
  
  static inline blkcnt_t ocfs2_inode_sector_count(struct inode *inode)
  {
---- a/fs/ocfs2/ioctl.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ocfs2/ioctl.c	2008-04-19 15:14:52.000000000 -0400
-@@ -41,7 +41,7 @@ static int ocfs2_get_inode_attr(struct i
+--- a/fs/ocfs2/ioctl.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/ocfs2/ioctl.c	2008-07-16 22:41:36.000000000 -0400
+@@ -42,7 +42,7 @@ static int ocfs2_get_inode_attr(struct i
  	return status;
  }
  
@@ -6918,8 +6472,20 @@
  				unsigned mask)
  {
  	struct ocfs2_inode_info *ocfs2_inode = OCFS2_I(inode);
---- a/fs/ocfs2/ioctl.h	2008-04-17 10:33:02.000000000 -0400
-+++ a/fs/ocfs2/ioctl.h	2008-04-19 15:14:52.000000000 -0400
+@@ -67,6 +67,11 @@ static int ocfs2_set_inode_attr(struct i
+ 	if (!S_ISDIR(inode->i_mode))
+ 		flags &= ~OCFS2_DIRSYNC_FL;
+ 
++	if (IS_BARRIER(inode)) {
++		vxwprintk_task(1, "messing with the barrier.");
++		goto bail_unlock;
++	}
++
+ 	handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
+ 	if (IS_ERR(handle)) {
+ 		status = PTR_ERR(handle);
+--- a/fs/ocfs2/ioctl.h	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/ocfs2/ioctl.h	2008-07-17 18:10:34.000000000 -0400
 @@ -10,6 +10,9 @@
  #ifndef OCFS2_IOCTL_H
  #define OCFS2_IOCTL_H
@@ -6927,11 +6493,11 @@
 +int ocfs2_set_inode_attr(struct inode *inode, unsigned flags,
 +				unsigned mask);
 +
- int ocfs2_ioctl(struct inode * inode, struct file * filp,
- 	unsigned int cmd, unsigned long arg);
+ long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
  long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg);
---- a/fs/ocfs2/namei.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ocfs2/namei.c	2008-04-19 15:14:52.000000000 -0400
+ 
+--- a/fs/ocfs2/namei.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/ocfs2/namei.c	2008-07-17 18:13:38.000000000 -0400
 @@ -40,6 +40,7 @@
  #include <linux/types.h>
  #include <linux/slab.h>
@@ -6953,7 +6519,7 @@
 @@ -425,13 +429,19 @@ static int ocfs2_mknod_locked(struct ocf
  	fe->i_blkno = cpu_to_le64(fe_blkno);
  	fe->i_suballoc_bit = cpu_to_le16(suballoc_bit);
- 	fe->i_suballoc_slot = cpu_to_le16(osb->slot_num);
+ 	fe->i_suballoc_slot = cpu_to_le16(inode_ac->ac_alloc_slot);
 -	fe->i_uid = cpu_to_le32(current->fsuid);
 +
 +	tag = dx_current_fstag(osb->sb);
@@ -6980,24 +6546,28 @@
 +	.sync_flags     = ocfs2_sync_flags,
  	.permission	= ocfs2_permission,
  };
---- a/fs/ocfs2/ocfs2_fs.h	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ocfs2/ocfs2_fs.h	2008-04-19 15:14:52.000000000 -0400
-@@ -188,8 +188,12 @@
+--- a/fs/ocfs2/ocfs2_fs.h	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/ocfs2/ocfs2_fs.h	2008-07-16 22:41:36.000000000 -0400
+@@ -204,9 +204,14 @@
+ #define OCFS2_NODUMP_FL		(0x00000040)	/* do not dump file */
  #define OCFS2_NOATIME_FL	(0x00000080)	/* do not update atime */
  #define OCFS2_DIRSYNC_FL	(0x00010000)	/* dirsync behaviour (directories only) */
++#define OCFS2_IXUNLINK_FL	(0x00020000)	/* Immutable invert on unlink */
  
-+#define OCFS2_BARRIER_FL	(0x04000000)	/* Barrier for chroot() */
-+#define OCFS2_IUNLINK_FL	(0x08000000)	/* Immutable unlink */
-+
- #define OCFS2_FL_VISIBLE	(0x000100FF)	/* User visible flags */
- #define OCFS2_FL_MODIFIABLE	(0x000100FF)	/* User modifiable flags */
-+#define OCFS2_FL_MASK		(0x0F0100FF)
+-#define OCFS2_FL_VISIBLE	(0x000100FF)	/* User visible flags */
+-#define OCFS2_FL_MODIFIABLE	(0x000100FF)	/* User modifiable flags */
++#define OCFS2_BARRIER_FL	(0x01000000)	/* Barrier for chroot() */
++#define OCFS2_COW_FL		(0x02000000)	/* Copy on Write marker */
++
++#define OCFS2_FL_VISIBLE	(0x000300FF)	/* User visible flags */
++#define OCFS2_FL_MODIFIABLE	(0x000300FF)	/* User modifiable flags */
++#define OCFS2_FL_MASK		(0x030300FF)
  
  /*
   * Extent record flags (e_node.leaf.flags)
---- a/fs/ocfs2/ocfs2.h	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ocfs2/ocfs2.h	2008-04-21 10:15:31.000000000 -0400
-@@ -171,6 +171,7 @@ enum ocfs2_mount_options
+--- a/fs/ocfs2/ocfs2.h	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/ocfs2/ocfs2.h	2008-07-16 22:41:36.000000000 -0400
+@@ -172,6 +172,7 @@ enum ocfs2_mount_options
  	OCFS2_MOUNT_ERRORS_PANIC = 1 << 3, /* Panic on errors */
  	OCFS2_MOUNT_DATA_WRITEBACK = 1 << 4, /* No data ordering */
  	OCFS2_MOUNT_LOCALFLOCKS = 1 << 5, /* No cluster aware user file locks */
@@ -7005,27 +6575,27 @@
  };
  
  #define OCFS2_OSB_SOFT_RO	0x0001
---- a/fs/ocfs2/super.c	2008-04-17 12:05:40.000000000 -0400
-+++ a/fs/ocfs2/super.c	2008-04-23 08:31:10.000000000 -0400
+--- a/fs/ocfs2/super.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/ocfs2/super.c	2008-07-17 20:23:09.000000000 -0400
 @@ -154,6 +154,7 @@ enum {
- 	Opt_commit,
  	Opt_localalloc,
  	Opt_localflocks,
+ 	Opt_stack,
 +	Opt_tag, Opt_notag, Opt_tagid,
  	Opt_err,
  };
  
-@@ -172,6 +173,9 @@ static match_table_t tokens = {
- 	{Opt_commit, "commit=%u"},
+@@ -173,6 +174,9 @@ static match_table_t tokens = {
  	{Opt_localalloc, "localalloc=%d"},
  	{Opt_localflocks, "localflocks"},
+ 	{Opt_stack, "cluster_stack=%s"},
 +	{Opt_tag, "tag"},
 +	{Opt_notag, "notag"},
 +	{Opt_tagid, "tagid=%u"},
  	{Opt_err, NULL}
  };
  
-@@ -391,6 +395,13 @@ static int ocfs2_remount(struct super_bl
+@@ -392,6 +396,13 @@ static int ocfs2_remount(struct super_bl
  		goto out;
  	}
  
@@ -7039,7 +6609,7 @@
  	if ((osb->s_mount_opt & OCFS2_MOUNT_HB_LOCAL) !=
  	    (parsed_options.mount_opt & OCFS2_MOUNT_HB_LOCAL)) {
  		ret = -EINVAL;
-@@ -691,6 +702,9 @@ static int ocfs2_fill_super(struct super
+@@ -725,6 +736,9 @@ static int ocfs2_fill_super(struct super
  
  	ocfs2_complete_mount_recovery(osb);
  
@@ -7049,9 +6619,9 @@
  	if (ocfs2_mount_local(osb))
  		snprintf(nodestr, sizeof(nodestr), "local");
  	else
-@@ -864,6 +878,20 @@ static int ocfs2_parse_options(struct su
- 			if (!is_remount)
- 				mopt->mount_opt |= OCFS2_MOUNT_LOCALFLOCKS;
+@@ -918,6 +932,20 @@ static int ocfs2_parse_options(struct su
+ 			       OCFS2_STACK_LABEL_LEN);
+ 			mopt->cluster_stack[OCFS2_STACK_LABEL_LEN] = '\0';
  			break;
 +#ifndef CONFIG_TAGGING_NONE
 +		case Opt_tag:
@@ -7070,9 +6640,9 @@
  		default:
  			mlog(ML_ERROR,
  			     "Unrecognized mount option \"%s\" "
---- a/fs/open.c	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/open.c	2008-04-21 13:51:52.000000000 -0400
-@@ -27,22 +27,31 @@
+--- a/fs/open.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/open.c	2008-07-17 18:02:08.000000000 -0400
+@@ -29,22 +29,31 @@
  #include <linux/rcupdate.h>
  #include <linux/audit.h>
  #include <linux/falloc.h>
@@ -7106,69 +6676,19 @@
  	}
  	return retval;
  }
-@@ -249,7 +258,7 @@ static long do_sys_truncate(const char _
- 		goto dput_and_out;
- 
- 	error = -EROFS;
--	if (IS_RDONLY(inode))
-+	if (IS_RDONLY(inode) || MNT_IS_RDONLY(nd.path.mnt))
- 		goto dput_and_out;
- 
- 	error = -EPERM;
-@@ -458,7 +467,7 @@ asmlinkage long sys_faccessat(int dfd, c
- 	   special_file(nd.path.dentry->d_inode->i_mode))
- 		goto out_path_release;
- 
--	if(IS_RDONLY(nd.path.dentry->d_inode))
-+	if(IS_RDONLY(nd.path.dentry->d_inode) || MNT_IS_RDONLY(nd.path.mnt))
- 		res = -EROFS;
- 
- out_path_release:
-@@ -568,7 +577,7 @@ asmlinkage long sys_fchmod(unsigned int 
- 	audit_inode(NULL, dentry);
- 
- 	err = -EROFS;
--	if (IS_RDONLY(inode))
-+	if (IS_RDONLY(inode) || MNT_IS_RDONLY(file->f_vfsmnt))
- 		goto out_putf;
- 	err = -EPERM;
- 	if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
-@@ -598,11 +607,11 @@ asmlinkage long sys_fchmodat(int dfd, co
+@@ -619,6 +628,11 @@ asmlinkage long sys_fchmodat(int dfd, co
  	error = __user_walk_fd(dfd, filename, LOOKUP_FOLLOW, &nd);
  	if (error)
  		goto out;
--	inode = nd.path.dentry->d_inode;
--
--	error = -EROFS;
--	if (IS_RDONLY(inode))
 +
 +	error = cow_check_and_break(&nd);
 +	if (error)
- 		goto dput_and_out;
-+	inode = nd.path.dentry->d_inode;
- 
- 	error = -EPERM;
- 	if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
-@@ -627,7 +636,8 @@ asmlinkage long sys_chmod(const char __u
- 	return sys_fchmodat(AT_FDCWD, filename, mode);
- }
++		goto dput_and_out;
++
+ 	inode = nd.path.dentry->d_inode;
  
--static int chown_common(struct dentry * dentry, uid_t user, gid_t group)
-+static int chown_common(struct dentry *dentry, struct vfsmount *mnt,
-+	uid_t user, gid_t group)
- {
- 	struct inode * inode;
- 	int error;
-@@ -639,7 +649,7 @@ static int chown_common(struct dentry * 
- 		goto out;
- 	}
- 	error = -EROFS;
--	if (IS_RDONLY(inode))
-+	if (IS_RDONLY(inode) || MNT_IS_RDONLY(mnt))
- 		goto out;
- 	error = -EPERM;
- 	if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
-@@ -647,11 +657,11 @@ static int chown_common(struct dentry * 
+ 	error = mnt_want_write(nd.path.mnt);
+@@ -667,11 +681,11 @@ static int chown_common(struct dentry * 
  	newattrs.ia_valid =  ATTR_CTIME;
  	if (user != (uid_t) -1) {
  		newattrs.ia_valid |= ATTR_UID;
@@ -7182,55 +6702,46 @@
  	}
  	if (!S_ISDIR(inode->i_mode))
  		newattrs.ia_valid |=
-@@ -671,7 +681,11 @@ asmlinkage long sys_chown(const char __u
- 	error = user_path_walk(filename, &nd);
+@@ -694,7 +708,11 @@ asmlinkage long sys_chown(const char __u
+ 	error = mnt_want_write(nd.path.mnt);
  	if (error)
- 		goto out;
+ 		goto out_release;
 -	error = chown_common(nd.path.dentry, user, group);
 +#ifdef CONFIG_VSERVER_COWBL
 +	error = cow_check_and_break(&nd);
 +	if (!error)
 +#endif
-+		error = chown_common(nd.path.dentry, nd.path.mnt, user, group);
++		error = chown_common(nd.path.dentry, user, group);
+ 	mnt_drop_write(nd.path.mnt);
+ out_release:
  	path_put(&nd.path);
- out:
- 	return error;
-@@ -691,7 +705,11 @@ asmlinkage long sys_fchownat(int dfd, co
- 	error = __user_walk_fd(dfd, filename, follow, &nd);
+@@ -719,7 +737,11 @@ asmlinkage long sys_fchownat(int dfd, co
+ 	error = mnt_want_write(nd.path.mnt);
  	if (error)
- 		goto out;
+ 		goto out_release;
 -	error = chown_common(nd.path.dentry, user, group);
 +#ifdef CONFIG_VSERVER_COWBL
 +	error = cow_check_and_break(&nd);
 +	if (!error)
 +#endif
-+		error = chown_common(nd.path.dentry, nd.path.mnt, user, group);
++		error = chown_common(nd.path.dentry, user, group);
+ 	mnt_drop_write(nd.path.mnt);
+ out_release:
  	path_put(&nd.path);
- out:
- 	return error;
-@@ -705,7 +723,11 @@ asmlinkage long sys_lchown(const char __
- 	error = user_path_walk_link(filename, &nd);
+@@ -738,7 +760,11 @@ asmlinkage long sys_lchown(const char __
+ 	error = mnt_want_write(nd.path.mnt);
  	if (error)
- 		goto out;
+ 		goto out_release;
 -	error = chown_common(nd.path.dentry, user, group);
 +#ifdef CONFIG_VSERVER_COWBL
 +	error = cow_check_and_break(&nd);
 +	if (!error)
 +#endif
-+		error = chown_common(nd.path.dentry, nd.path.mnt, user, group);
++		error = chown_common(nd.path.dentry, user, group);
+ 	mnt_drop_write(nd.path.mnt);
+ out_release:
  	path_put(&nd.path);
- out:
- 	return error;
-@@ -724,7 +746,7 @@ asmlinkage long sys_fchown(unsigned int 
- 
- 	dentry = file->f_path.dentry;
- 	audit_inode(NULL, dentry);
--	error = chown_common(dentry, user, group);
-+	error = chown_common(dentry, file->f_vfsmnt, user, group);
- 	fput(file);
- out:
- 	return error;
-@@ -971,6 +993,7 @@ repeat:
+@@ -1016,6 +1042,7 @@ repeat:
  	else
  		FD_CLR(fd, fdt->close_on_exec);
  	files->next_fd = fd + 1;
@@ -7238,7 +6749,7 @@
  #if 1
  	/* Sanity check */
  	if (fdt->fd[fd] != NULL) {
-@@ -998,6 +1021,7 @@ static void __put_unused_fd(struct files
+@@ -1043,6 +1070,7 @@ static void __put_unused_fd(struct files
  	__FD_CLR(fd, fdt->open_fds);
  	if (fd < files->next_fd)
  		files->next_fd = fd;
@@ -7246,9 +6757,9 @@
  }
  
  void put_unused_fd(unsigned int fd)
---- a/fs/proc/array.c	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/proc/array.c	2008-05-21 14:08:19.000000000 -0400
-@@ -79,6 +79,8 @@
+--- a/fs/proc/array.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/proc/array.c	2008-07-17 17:40:35.000000000 -0400
+@@ -80,6 +80,8 @@
  #include <linux/delayacct.h>
  #include <linux/seq_file.h>
  #include <linux/pid_namespace.h>
@@ -7257,7 +6768,7 @@
  
  #include <asm/pgtable.h>
  #include <asm/processor.h>
-@@ -140,8 +142,9 @@ static const char *task_state_array[] = 
+@@ -141,8 +143,9 @@ static const char *task_state_array[] = 
  	"D (disk sleep)",	/*  2 */
  	"T (stopped)",		/*  4 */
  	"T (tracing stop)",	/*  8 */
@@ -7269,7 +6780,7 @@
  };
  
  static inline const char *get_task_state(struct task_struct *tsk)
-@@ -162,6 +165,7 @@ static inline void task_state(struct seq
+@@ -163,6 +166,7 @@ static inline void task_state(struct seq
  	struct group_info *group_info;
  	int g;
  	struct fdtable *fdt = NULL;
@@ -7277,7 +6788,7 @@
  	pid_t ppid, tpid;
  
  	rcu_read_lock();
-@@ -169,6 +173,12 @@ static inline void task_state(struct seq
+@@ -170,6 +174,12 @@ static inline void task_state(struct seq
  		task_tgid_nr_ns(rcu_dereference(p->real_parent), ns) : 0;
  	tpid = pid_alive(p) && p->ptrace ?
  		task_pid_nr_ns(rcu_dereference(p->parent), ns) : 0;
@@ -7290,7 +6801,31 @@
  	seq_printf(m,
  		"State:\t%s\n"
  		"Tgid:\t%d\n"
-@@ -308,6 +318,45 @@ static inline void task_context_switch_c
+@@ -281,7 +291,7 @@ static inline void task_sig(struct seq_f
+ }
+ 
+ static void render_cap_t(struct seq_file *m, const char *header,
+-			kernel_cap_t *a)
++			struct vx_info *vxi, kernel_cap_t *a)
+ {
+ 	unsigned __capi;
+ 
+@@ -295,10 +305,10 @@ static void render_cap_t(struct seq_file
+ 
+ static inline void task_cap(struct seq_file *m, struct task_struct *p)
+ {
+-	render_cap_t(m, "CapInh:\t", &p->cap_inheritable);
+-	render_cap_t(m, "CapPrm:\t", &p->cap_permitted);
+-	render_cap_t(m, "CapEff:\t", &p->cap_effective);
+-	render_cap_t(m, "CapBnd:\t", &p->cap_bset);
++	render_cap_t(m, "CapInh:\t", p->vx_info, &p->cap_inheritable);
++	render_cap_t(m, "CapPrm:\t", p->vx_info, &p->cap_permitted);
++	render_cap_t(m, "CapEff:\t", p->vx_info, &p->cap_effective);
++	render_cap_t(m, "CapBnd:\t", p->vx_info, &p->cap_bset);
+ }
+ 
+ static inline void task_context_switch_counts(struct seq_file *m,
+@@ -310,6 +320,45 @@ static inline void task_context_switch_c
  			p->nivcsw);
  }
  
@@ -7336,7 +6871,7 @@
  int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
  			struct pid *pid, struct task_struct *task)
  {
-@@ -323,6 +372,7 @@ int proc_pid_status(struct seq_file *m, 
+@@ -325,6 +374,7 @@ int proc_pid_status(struct seq_file *m, 
  	task_sig(m, task);
  	task_cap(m, task);
  	cpuset_task_status_allowed(m, task);
@@ -7344,7 +6879,7 @@
  #if defined(CONFIG_S390)
  	task_show_regs(m, task);
  #endif
-@@ -494,6 +544,17 @@ static int do_task_stat(struct seq_file 
+@@ -496,6 +546,17 @@ static int do_task_stat(struct seq_file 
  	/* convert nsec -> ticks */
  	start_time = nsec_to_clock_t(start_time);
  
@@ -7362,9 +6897,9 @@
  	seq_printf(m, "%d (%s) %c %d %d %d %d %d %u %lu \
  %lu %lu %lu %lu %lu %ld %ld %ld %ld %d 0 %llu %lu %ld %lu %lu %lu %lu %lu \
  %lu %lu %lu %lu %lu %lu %lu %lu %d %d %u %u %llu %lu %ld\n",
---- a/fs/proc/base.c	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/proc/base.c	2008-05-21 14:08:19.000000000 -0400
-@@ -76,6 +76,8 @@
+--- a/fs/proc/base.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/proc/base.c	2008-07-16 22:41:36.000000000 -0400
+@@ -77,6 +77,8 @@
  #include <linux/oom.h>
  #include <linux/elf.h>
  #include <linux/pid_namespace.h>
@@ -7373,7 +6908,7 @@
  #include "internal.h"
  
  /* NOTE:
-@@ -1290,6 +1292,8 @@ static struct inode *proc_pid_make_inode
+@@ -1412,6 +1414,8 @@ static struct inode *proc_pid_make_inode
  		inode->i_uid = task->euid;
  		inode->i_gid = task->egid;
  	}
@@ -7382,7 +6917,7 @@
  	security_task_to_inode(task, inode);
  
  out:
-@@ -1833,6 +1837,13 @@ static struct dentry *proc_pident_lookup
+@@ -1953,6 +1957,13 @@ static struct dentry *proc_pident_lookup
  	if (!task)
  		goto out_no_task;
  
@@ -7396,7 +6931,7 @@
  	/*
  	 * Yes, it does not scale. And it should not. Don't add
  	 * new entries into /proc/<tgid>/ without very good reasons.
-@@ -2220,7 +2231,7 @@ out_iput:
+@@ -2340,7 +2351,7 @@ out_iput:
  static struct dentry *proc_base_lookup(struct inode *dir, struct dentry *dentry)
  {
  	struct dentry *error;
@@ -7405,7 +6940,7 @@
  	const struct pid_entry *p, *last;
  
  	error = ERR_PTR(-ENOENT);
-@@ -2285,6 +2296,9 @@ static int proc_pid_io_accounting(struct
+@@ -2405,6 +2416,9 @@ static int proc_pid_io_accounting(struct
  static const struct file_operations proc_task_operations;
  static const struct inode_operations proc_task_inode_operations;
  
@@ -7415,7 +6950,7 @@
  static const struct pid_entry tgid_base_stuff[] = {
  	DIR("task",       S_IRUGO|S_IXUGO, task),
  	DIR("fd",         S_IRUSR|S_IXUSR, fd),
-@@ -2335,6 +2349,8 @@ static const struct pid_entry tgid_base_
+@@ -2456,6 +2470,8 @@ static const struct pid_entry tgid_base_
  #ifdef CONFIG_CGROUPS
  	REG("cgroup",  S_IRUGO, cgroup),
  #endif
@@ -7424,7 +6959,7 @@
  	INF("oom_score",  S_IRUGO, oom_score),
  	REG("oom_adj",    S_IRUGO|S_IWUSR, oom_adjust),
  #ifdef CONFIG_AUDITSYSCALL
-@@ -2350,6 +2366,7 @@ static const struct pid_entry tgid_base_
+@@ -2471,6 +2487,7 @@ static const struct pid_entry tgid_base_
  #ifdef CONFIG_TASK_IO_ACCOUNTING
  	INF("io",	S_IRUGO, pid_io_accounting),
  #endif
@@ -7432,7 +6967,7 @@
  };
  
  static int proc_tgid_base_readdir(struct file * filp,
-@@ -2547,7 +2564,7 @@ retry:
+@@ -2667,7 +2684,7 @@ retry:
  	iter.task = NULL;
  	pid = find_ge_pid(iter.tgid, ns);
  	if (pid) {
@@ -7441,7 +6976,7 @@
  		iter.task = pid_task(pid, PIDTYPE_PID);
  		/* What we to know is if the pid we have find is the
  		 * pid of a thread_group_leader.  Testing for task
-@@ -2577,7 +2594,7 @@ static int proc_pid_fill_cache(struct fi
+@@ -2697,7 +2714,7 @@ static int proc_pid_fill_cache(struct fi
  	struct tgid_iter iter)
  {
  	char name[PROC_NUMBUF];
@@ -7450,7 +6985,7 @@
  	return proc_fill_cache(filp, dirent, filldir, name, len,
  				proc_pid_instantiate, iter.task, NULL);
  }
-@@ -2586,7 +2603,7 @@ static int proc_pid_fill_cache(struct fi
+@@ -2706,7 +2723,7 @@ static int proc_pid_fill_cache(struct fi
  int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
  {
  	unsigned int nr = filp->f_pos - FIRST_PROCESS_ENTRY;
@@ -7459,7 +6994,7 @@
  	struct tgid_iter iter;
  	struct pid_namespace *ns;
  
-@@ -2606,6 +2623,8 @@ int proc_pid_readdir(struct file * filp,
+@@ -2726,6 +2743,8 @@ int proc_pid_readdir(struct file * filp,
  	     iter.task;
  	     iter.tgid += 1, iter = next_tgid(ns, iter)) {
  		filp->f_pos = iter.tgid + TGID_OFFSET;
@@ -7468,7 +7003,7 @@
  		if (proc_pid_fill_cache(filp, dirent, filldir, iter) < 0) {
  			put_task_struct(iter.task);
  			goto out;
-@@ -2742,6 +2761,8 @@ static struct dentry *proc_task_lookup(s
+@@ -2862,6 +2881,8 @@ static struct dentry *proc_task_lookup(s
  	tid = name_to_int(dentry);
  	if (tid == ~0U)
  		goto out;
@@ -7477,8 +7012,8 @@
  
  	ns = dentry->d_sb->s_fs_info;
  	rcu_read_lock();
---- a/fs/proc/generic.c	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/proc/generic.c	2008-04-20 14:23:26.000000000 -0400
+--- a/fs/proc/generic.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/proc/generic.c	2008-07-16 22:41:36.000000000 -0400
 @@ -21,6 +21,7 @@
  #include <linux/bitops.h>
  #include <linux/spinlock.h>
@@ -7487,25 +7022,25 @@
  #include <asm/uaccess.h>
  
  #include "internal.h"
-@@ -389,6 +390,8 @@ struct dentry *proc_lookup_de(struct pro
- 		for (de = de->subdir; de ; de = de->next) {
- 			if (de->namelen != dentry->d_name.len)
- 				continue;
+@@ -386,6 +387,8 @@ struct dentry *proc_lookup_de(struct pro
+ 	for (de = de->subdir; de ; de = de->next) {
+ 		if (de->namelen != dentry->d_name.len)
+ 			continue;
 +			if (!vx_hide_check(0, de->vx_flags))
 +				continue;
- 			if (!memcmp(dentry->d_name.name, de->name, de->namelen)) {
- 				unsigned int ino;
+ 		if (!memcmp(dentry->d_name.name, de->name, de->namelen)) {
+ 			unsigned int ino;
  
-@@ -397,6 +400,8 @@ struct dentry *proc_lookup_de(struct pro
- 				spin_unlock(&proc_subdir_lock);
- 				error = -EINVAL;
- 				inode = proc_get_inode(dir->i_sb, ino, de);
+@@ -394,6 +397,8 @@ struct dentry *proc_lookup_de(struct pro
+ 			spin_unlock(&proc_subdir_lock);
+ 			error = -EINVAL;
+ 			inode = proc_get_inode(dir->i_sb, ino, de);
 +				/* generic proc entries belong to the host */
 +				inode->i_tag = 0;
- 				goto out_unlock;
- 			}
+ 			goto out_unlock;
  		}
-@@ -481,6 +486,8 @@ int proc_readdir_de(struct proc_dir_entr
+ 	}
+@@ -474,6 +479,8 @@ int proc_readdir_de(struct proc_dir_entr
  
  				/* filldir passes info to user space */
  				de_get(de);
@@ -7514,7 +7049,7 @@
  				spin_unlock(&proc_subdir_lock);
  				if (filldir(dirent, de->name, de->namelen, filp->f_pos,
  					    de->low_ino, de->mode >> 12) < 0) {
-@@ -488,6 +495,7 @@ int proc_readdir_de(struct proc_dir_entr
+@@ -481,6 +488,7 @@ int proc_readdir_de(struct proc_dir_entr
  					goto out;
  				}
  				spin_lock(&proc_subdir_lock);
@@ -7522,7 +7057,7 @@
  				filp->f_pos++;
  				next = de->next;
  				de_put(de);
-@@ -602,6 +610,7 @@ static struct proc_dir_entry *__proc_cre
+@@ -595,6 +603,7 @@ static struct proc_dir_entry *__proc_cre
  	ent->nlink = nlink;
  	atomic_set(&ent->count, 1);
  	ent->pde_users = 0;
@@ -7530,7 +7065,7 @@
  	spin_lock_init(&ent->pde_unload_lock);
  	ent->pde_unload_completion = NULL;
   out:
-@@ -624,7 +633,8 @@ struct proc_dir_entry *proc_symlink(cons
+@@ -617,7 +626,8 @@ struct proc_dir_entry *proc_symlink(cons
  				kfree(ent->data);
  				kfree(ent);
  				ent = NULL;
@@ -7540,28 +7075,28 @@
  		} else {
  			kfree(ent);
  			ent = NULL;
---- a/fs/proc/inode.c	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/proc/inode.c	2008-04-19 15:14:52.000000000 -0400
-@@ -408,6 +408,8 @@ struct inode *proc_get_inode(struct supe
- 				inode->i_uid = de->uid;
- 				inode->i_gid = de->gid;
- 			}
+--- a/fs/proc/inode.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/proc/inode.c	2008-07-16 22:41:36.000000000 -0400
+@@ -405,6 +405,8 @@ struct inode *proc_get_inode(struct supe
+ 			inode->i_uid = de->uid;
+ 			inode->i_gid = de->gid;
+ 		}
 +		if (de->vx_flags)
 +			PROC_I(inode)->vx_flags = de->vx_flags;
- 			if (de->size)
- 				inode->i_size = de->size;
- 			if (de->nlink)
---- a/fs/proc/internal.h	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/proc/internal.h	2008-05-21 14:08:19.000000000 -0400
+ 		if (de->size)
+ 			inode->i_size = de->size;
+ 		if (de->nlink)
+--- a/fs/proc/internal.h	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/proc/internal.h	2008-07-16 22:41:36.000000000 -0400
 @@ -10,6 +10,7 @@
   */
  
  #include <linux/proc_fs.h>
 +#include <linux/vs_pid.h>
  
+ extern struct proc_dir_entry proc_root;
  #ifdef CONFIG_PROC_SYSCTL
- extern int proc_sys_init(void);
-@@ -57,6 +58,9 @@ extern int proc_pid_status(struct seq_fi
+@@ -55,6 +56,9 @@ extern int proc_pid_status(struct seq_fi
  				struct pid *pid, struct task_struct *task);
  extern int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns,
  				struct pid *pid, struct task_struct *task);
@@ -7571,7 +7106,7 @@
  extern loff_t mem_lseek(struct file *file, loff_t offset, int orig);
  
  extern const struct file_operations proc_maps_operations;
-@@ -76,11 +80,16 @@ static inline struct pid *proc_pid(struc
+@@ -74,11 +78,16 @@ static inline struct pid *proc_pid(struc
  	return PROC_I(inode)->pid;
  }
  
@@ -7589,8 +7124,8 @@
  static inline int proc_fd(struct inode *inode)
  {
  	return PROC_I(inode)->fd;
---- a/fs/proc/proc_misc.c	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/proc/proc_misc.c	2008-04-23 11:56:24.000000000 -0400
+--- a/fs/proc/proc_misc.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/proc/proc_misc.c	2008-07-16 22:41:36.000000000 -0400
 @@ -56,6 +56,8 @@
  #include <asm/div64.h>
  #include "internal.h"
@@ -7662,28 +7197,29 @@
  		cached = 0;
  
  	get_vmalloc_info(&vmi);
---- a/fs/proc/root.c	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/proc/root.c	2008-04-19 15:14:52.000000000 -0400
-@@ -23,6 +23,9 @@
+--- a/fs/proc/root.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/proc/root.c	2008-07-17 17:31:52.000000000 -0400
+@@ -22,6 +22,10 @@
+ 
  #include "internal.h"
  
- struct proc_dir_entry *proc_bus, *proc_root_fs, *proc_root_driver;
 +struct proc_dir_entry *proc_virtual;
 +
 +extern void proc_vx_init(void);
- 
++
  static int proc_test_super(struct super_block *sb, void *data)
  {
-@@ -138,6 +141,7 @@ void __init proc_root_init(void)
- 	proc_device_tree_init();
+ 	return sb->s_fs_info == data;
+@@ -137,6 +141,7 @@ void __init proc_root_init(void)
  #endif
- 	proc_bus = proc_mkdir("bus", NULL);
-+	proc_vx_init();
+ 	proc_mkdir("bus", NULL);
  	proc_sys_init();
++	proc_vx_init();
  }
  
---- a/fs/quota.c	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/quota.c	2008-04-21 09:21:04.000000000 -0400
+ static int proc_root_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat
+--- a/fs/quota.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/quota.c	2008-07-16 22:41:36.000000000 -0400
 @@ -18,6 +18,7 @@
  #include <linux/capability.h>
  #include <linux/quotaops.h>
@@ -7692,7 +7228,7 @@
  
  /* Check validity of generic quotactl commands */
  static int generic_quotactl_valid(struct super_block *sb, int type, int cmd, qid_t id)
-@@ -82,11 +83,11 @@ static int generic_quotactl_valid(struct
+@@ -81,11 +82,11 @@ static int generic_quotactl_valid(struct
  	if (cmd == Q_GETQUOTA) {
  		if (((type == USRQUOTA && current->euid != id) ||
  		     (type == GRPQUOTA && !in_egroup_p(id))) &&
@@ -7706,7 +7242,7 @@
  			return -EPERM;
  
  	return 0;
-@@ -133,10 +134,10 @@ static int xqm_quotactl_valid(struct sup
+@@ -132,10 +133,10 @@ static int xqm_quotactl_valid(struct sup
  	if (cmd == Q_XGETQUOTA) {
  		if (((type == XQM_USRQUOTA && current->euid != id) ||
  		     (type == XQM_GRPQUOTA && !in_egroup_p(id))) &&
@@ -7719,7 +7255,7 @@
  			return -EPERM;
  	}
  
-@@ -329,6 +330,46 @@ static int do_quotactl(struct super_bloc
+@@ -328,6 +329,46 @@ static int do_quotactl(struct super_bloc
  	return 0;
  }
  
@@ -7766,7 +7302,7 @@
  /*
   * look up a superblock on which quota ops will be performed
   * - use the name of a block device to find the superblock thereon
-@@ -346,6 +387,22 @@ static inline struct super_block *quotac
+@@ -345,6 +386,22 @@ static inline struct super_block *quotac
  	putname(tmp);
  	if (IS_ERR(bdev))
  		return ERR_CAST(bdev);
@@ -7789,8 +7325,8 @@
  	sb = get_super(bdev);
  	bdput(bdev);
  	if (!sb)
---- a/fs/reiserfs/bitmap.c	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/reiserfs/bitmap.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/reiserfs/bitmap.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/reiserfs/bitmap.c	2008-07-16 22:41:36.000000000 -0400
 @@ -13,6 +13,7 @@
  #include <linux/reiserfs_fs_sb.h>
  #include <linux/reiserfs_fs_i.h>
@@ -7884,15 +7420,15 @@
  
  	return CARRY_ON;
 --- a/fs/reiserfs/file.c	2008-04-17 11:31:38.000000000 -0400
-+++ a/fs/reiserfs/file.c	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/reiserfs/file.c	2008-07-16 22:41:36.000000000 -0400
 @@ -306,4 +306,5 @@ const struct inode_operations reiserfs_f
  	.listxattr = reiserfs_listxattr,
  	.removexattr = reiserfs_removexattr,
  	.permission = reiserfs_permission,
 +	.sync_flags = reiserfs_sync_flags,
  };
---- a/fs/reiserfs/inode.c	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/reiserfs/inode.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/reiserfs/inode.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/reiserfs/inode.c	2008-07-16 22:41:36.000000000 -0400
 @@ -18,6 +18,8 @@
  #include <linux/writeback.h>
  #include <linux/quotaops.h>
@@ -7902,7 +7438,7 @@
  
  int reiserfs_commit_write(struct file *f, struct page *page,
  			  unsigned from, unsigned to);
-@@ -52,6 +54,7 @@ void reiserfs_delete_inode(struct inode 
+@@ -54,6 +56,7 @@ void reiserfs_delete_inode(struct inode 
  		 * stat data deletion */
  		if (!err) 
  			DQUOT_FREE_INODE(inode);
@@ -7910,7 +7446,7 @@
  
  		if (journal_end(&th, inode->i_sb, jbegin_count))
  			goto out;
-@@ -1114,6 +1117,8 @@ static void init_inode(struct inode *ino
+@@ -1116,6 +1119,8 @@ static void init_inode(struct inode *ino
  	struct buffer_head *bh;
  	struct item_head *ih;
  	__u32 rdev;
@@ -7919,7 +7455,7 @@
  	//int version = ITEM_VERSION_1;
  
  	bh = PATH_PLAST_BUFFER(path);
-@@ -1137,12 +1142,13 @@ static void init_inode(struct inode *ino
+@@ -1139,12 +1144,13 @@ static void init_inode(struct inode *ino
  		    (struct stat_data_v1 *)B_I_PITEM(bh, ih);
  		unsigned long blocks;
  
@@ -7935,7 +7471,7 @@
  		inode->i_size = sd_v1_size(sd);
  		inode->i_atime.tv_sec = sd_v1_atime(sd);
  		inode->i_mtime.tv_sec = sd_v1_mtime(sd);
-@@ -1184,11 +1190,12 @@ static void init_inode(struct inode *ino
+@@ -1186,11 +1192,12 @@ static void init_inode(struct inode *ino
  		// (directories and symlinks)
  		struct stat_data *sd = (struct stat_data *)B_I_PITEM(bh, ih);
  
@@ -7950,7 +7486,7 @@
  		inode->i_mtime.tv_sec = sd_v2_mtime(sd);
  		inode->i_atime.tv_sec = sd_v2_atime(sd);
  		inode->i_ctime.tv_sec = sd_v2_ctime(sd);
-@@ -1218,6 +1225,10 @@ static void init_inode(struct inode *ino
+@@ -1220,6 +1227,10 @@ static void init_inode(struct inode *ino
  		sd_attrs_to_i_attrs(sd_v2_attrs(sd), inode);
  	}
  
@@ -7961,7 +7497,7 @@
  	pathrelse(path);
  	if (S_ISREG(inode->i_mode)) {
  		inode->i_op = &reiserfs_file_inode_operations;
-@@ -1240,13 +1251,15 @@ static void init_inode(struct inode *ino
+@@ -1242,13 +1253,15 @@ static void init_inode(struct inode *ino
  static void inode2sd(void *sd, struct inode *inode, loff_t size)
  {
  	struct stat_data *sd_v2 = (struct stat_data *)sd;
@@ -7979,7 +7515,7 @@
  	set_sd_v2_mtime(sd_v2, inode->i_mtime.tv_sec);
  	set_sd_v2_atime(sd_v2, inode->i_atime.tv_sec);
  	set_sd_v2_ctime(sd_v2, inode->i_ctime.tv_sec);
-@@ -1769,6 +1782,10 @@ int reiserfs_new_inode(struct reiserfs_t
+@@ -1771,6 +1784,10 @@ int reiserfs_new_inode(struct reiserfs_t
  
  	BUG_ON(!th->t_trans_id);
  
@@ -7990,7 +7526,7 @@
  	if (DQUOT_ALLOC_INODE(inode)) {
  		err = -EDQUOT;
  		goto out_end_trans;
-@@ -1954,6 +1971,9 @@ int reiserfs_new_inode(struct reiserfs_t
+@@ -1956,6 +1973,9 @@ int reiserfs_new_inode(struct reiserfs_t
  	DQUOT_FREE_INODE(inode);
  
        out_end_trans:
@@ -8000,37 +7536,75 @@
  	journal_end(th, th->t_super, th->t_blocks_allocated);
  	/* Drop can be outside and it needs more credits so it's better to have it outside */
  	DQUOT_DROP(inode);
-@@ -2848,6 +2868,14 @@ void sd_attrs_to_i_attrs(__u16 sd_attrs,
+@@ -2842,14 +2862,19 @@ int reiserfs_commit_write(struct file *f
+ void sd_attrs_to_i_attrs(__u16 sd_attrs, struct inode *inode)
+ {
+ 	if (reiserfs_attrs(inode->i_sb)) {
+-		if (sd_attrs & REISERFS_SYNC_FL)
+-			inode->i_flags |= S_SYNC;
+-		else
+-			inode->i_flags &= ~S_SYNC;
+ 		if (sd_attrs & REISERFS_IMMUTABLE_FL)
  			inode->i_flags |= S_IMMUTABLE;
  		else
  			inode->i_flags &= ~S_IMMUTABLE;
-+		if (sd_attrs & REISERFS_IUNLINK_FL)
-+			inode->i_flags |= S_IUNLINK;
++		if (sd_attrs & REISERFS_IXUNLINK_FL)
++			inode->i_flags |= S_IXUNLINK;
 +		else
-+			inode->i_flags &= ~S_IUNLINK;
-+		if (sd_attrs & REISERFS_BARRIER_FL)
-+			inode->i_flags |= S_BARRIER;
++			inode->i_flags &= ~S_IXUNLINK;
++
++		if (sd_attrs & REISERFS_SYNC_FL)
++			inode->i_flags |= S_SYNC;
 +		else
-+			inode->i_flags &= ~S_BARRIER;
++			inode->i_flags &= ~S_SYNC;
  		if (sd_attrs & REISERFS_APPEND_FL)
  			inode->i_flags |= S_APPEND;
  		else
-@@ -2870,6 +2898,14 @@ void i_attrs_to_sd_attrs(struct inode *i
+@@ -2862,6 +2887,15 @@ void sd_attrs_to_i_attrs(__u16 sd_attrs,
+ 			REISERFS_I(inode)->i_flags |= i_nopack_mask;
+ 		else
+ 			REISERFS_I(inode)->i_flags &= ~i_nopack_mask;
++
++		if (sd_attrs & REISERFS_BARRIER_FL)
++			inode->i_vflags |= V_BARRIER;
++		else
++			inode->i_vflags &= ~V_BARRIER;
++		if (sd_attrs & REISERFS_COW_FL)
++			inode->i_vflags |= V_COW;
++		else
++			inode->i_vflags &= ~V_COW;
+ 	}
+ }
+ 
+@@ -2872,6 +2906,11 @@ void i_attrs_to_sd_attrs(struct inode *i
  			*sd_attrs |= REISERFS_IMMUTABLE_FL;
  		else
  			*sd_attrs &= ~REISERFS_IMMUTABLE_FL;
-+		if (inode->i_flags & S_IUNLINK)
-+			*sd_attrs |= REISERFS_IUNLINK_FL;
-+		else
-+			*sd_attrs &= ~REISERFS_IUNLINK_FL;
-+		if (inode->i_flags & S_BARRIER)
-+			*sd_attrs |= REISERFS_BARRIER_FL;
++		if (inode->i_flags & S_IXUNLINK)
++			*sd_attrs |= REISERFS_IXUNLINK_FL;
 +		else
-+			*sd_attrs &= ~REISERFS_BARRIER_FL;
++			*sd_attrs &= ~REISERFS_IXUNLINK_FL;
++
  		if (inode->i_flags & S_SYNC)
  			*sd_attrs |= REISERFS_SYNC_FL;
  		else
-@@ -3049,6 +3085,22 @@ static ssize_t reiserfs_direct_IO(int rw
+@@ -2884,6 +2923,15 @@ void i_attrs_to_sd_attrs(struct inode *i
+ 			*sd_attrs |= REISERFS_NOTAIL_FL;
+ 		else
+ 			*sd_attrs &= ~REISERFS_NOTAIL_FL;
++
++		if (inode->i_vflags & V_BARRIER)
++			*sd_attrs |= REISERFS_BARRIER_FL;
++		else
++			*sd_attrs &= ~REISERFS_BARRIER_FL;
++		if (inode->i_vflags & V_COW)
++			*sd_attrs |= REISERFS_COW_FL;
++		else
++			*sd_attrs &= ~REISERFS_COW_FL;
+ 	}
+ }
+ 
+@@ -3051,6 +3099,22 @@ static ssize_t reiserfs_direct_IO(int rw
  				  reiserfs_get_blocks_direct_io, NULL);
  }
  
@@ -8053,7 +7627,7 @@
  int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
  {
  	struct inode *inode = dentry->d_inode;
-@@ -3102,9 +3154,11 @@ int reiserfs_setattr(struct dentry *dent
+@@ -3104,9 +3168,11 @@ int reiserfs_setattr(struct dentry *dent
  	}
  
  	error = inode_change_ok(inode, attr);
@@ -8066,7 +7640,7 @@
  			error = reiserfs_chown_xattrs(inode, attr);
  
  			if (!error) {
-@@ -3134,6 +3188,9 @@ int reiserfs_setattr(struct dentry *dent
+@@ -3136,6 +3202,9 @@ int reiserfs_setattr(struct dentry *dent
  					inode->i_uid = attr->ia_uid;
  				if (attr->ia_valid & ATTR_GID)
  					inode->i_gid = attr->ia_gid;
@@ -8076,26 +7650,26 @@
  				mark_inode_dirty(inode);
  				error =
  				    journal_end(&th, inode->i_sb, jbegin_count);
---- a/fs/reiserfs/ioctl.c	2008-05-21 14:30:05.000000000 -0400
-+++ a/fs/reiserfs/ioctl.c	2008-05-21 14:30:41.000000000 -0400
-@@ -6,6 +6,7 @@
- #include <linux/fs.h>
+--- a/fs/reiserfs/ioctl.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/reiserfs/ioctl.c	2008-07-17 17:18:29.000000000 -0400
+@@ -7,6 +7,7 @@
+ #include <linux/mount.h>
  #include <linux/reiserfs_fs.h>
  #include <linux/time.h>
 +#include <linux/mount.h>
  #include <asm/uaccess.h>
  #include <linux/pagemap.h>
  #include <linux/smp_lock.h>
-@@ -22,7 +23,7 @@
+@@ -23,7 +24,7 @@
  int reiserfs_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
  		   unsigned long arg)
  {
 -	unsigned int flags;
 +	unsigned int flags, oldflags;
+ 	int err = 0;
  
  	switch (cmd) {
- 	case REISERFS_IOC_UNPACK:
-@@ -41,12 +42,14 @@ int reiserfs_ioctl(struct inode *inode, 
+@@ -43,6 +44,7 @@ int reiserfs_ioctl(struct inode *inode, 
  
  		flags = REISERFS_I(inode)->i_attrs;
  		i_attrs_to_sd_attrs(inode, (__u16 *) & flags);
@@ -8103,17 +7677,20 @@
  		return put_user(flags, (int __user *)arg);
  	case REISERFS_IOC_SETFLAGS:{
  			if (!reiserfs_attrs(inode->i_sb))
- 				return -ENOTTY;
- 
--			if (IS_RDONLY(inode))
-+			if (IS_RDONLY(inode) ||
-+				(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
- 				return -EROFS;
- 
- 			if (!is_owner_or_cap(inode))
-@@ -72,6 +75,10 @@ int reiserfs_ioctl(struct inode *inode, 
- 				if (result)
- 					return result;
+@@ -60,6 +62,10 @@ int reiserfs_ioctl(struct inode *inode, 
+ 				err = -EFAULT;
+ 				goto setflags_out;
+ 			}
++			if (IS_BARRIER(inode)) {
++				vxwprintk_task(1, "messing with the barrier.");
++				return -EACCES;
++			}
+ 			/*
+ 			 * Is it quota file? Do not allow user to mess with it
+ 			 */
+@@ -84,6 +90,10 @@ int reiserfs_ioctl(struct inode *inode, 
+ 					goto setflags_out;
+ 				}
  			}
 +
 +			oldflags = REISERFS_I(inode)->i_attrs;
@@ -8122,18 +7699,8 @@
  			sd_attrs_to_i_attrs(flags, inode);
  			REISERFS_I(inode)->i_attrs = flags;
  			inode->i_ctime = CURRENT_TIME_SEC;
-@@ -83,7 +90,8 @@ int reiserfs_ioctl(struct inode *inode, 
- 	case REISERFS_IOC_SETVERSION:
- 		if (!is_owner_or_cap(inode))
- 			return -EPERM;
--		if (IS_RDONLY(inode))
-+		if (IS_RDONLY(inode) ||
-+			(filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
- 			return -EROFS;
- 		if (get_user(inode->i_generation, (int __user *)arg))
- 			return -EFAULT;
---- a/fs/reiserfs/namei.c	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/reiserfs/namei.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/reiserfs/namei.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/reiserfs/namei.c	2008-07-16 22:41:36.000000000 -0400
 @@ -17,6 +17,7 @@
  #include <linux/reiserfs_acl.h>
  #include <linux/reiserfs_xattr.h>
@@ -8181,8 +7748,8 @@
 +	.sync_flags = reiserfs_sync_flags,
  
  };
---- a/fs/reiserfs/stree.c	2008-04-17 11:31:38.000000000 -0400
-+++ a/fs/reiserfs/stree.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/reiserfs/stree.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/reiserfs/stree.c	2008-07-16 22:41:36.000000000 -0400
 @@ -55,6 +55,7 @@
  #include <linux/reiserfs_fs.h>
  #include <linux/buffer_head.h>
@@ -8207,7 +7774,7 @@
  			}
  			break;
  		}
-@@ -1735,6 +1738,7 @@ int reiserfs_cut_from_item(struct reiser
+@@ -1734,6 +1737,7 @@ int reiserfs_cut_from_item(struct reiser
  		       "reiserquota cut_from_item(): freeing %u id=%u type=%c",
  		       quota_cut_bytes, p_s_inode->i_uid, '?');
  #endif
@@ -8215,7 +7782,7 @@
  	DQUOT_FREE_SPACE_NODIRTY(p_s_inode, quota_cut_bytes);
  	return n_ret_value;
  }
-@@ -1976,6 +1980,11 @@ int reiserfs_paste_into_item(struct reis
+@@ -1975,6 +1979,11 @@ int reiserfs_paste_into_item(struct reis
  		pathrelse(p_s_search_path);
  		return -EDQUOT;
  	}
@@ -8227,7 +7794,7 @@
  	init_tb_struct(th, &s_paste_balance, th->t_super, p_s_search_path,
  		       n_pasted_size);
  #ifdef DISPLACE_NEW_PACKING_LOCALITIES
-@@ -2028,6 +2037,7 @@ int reiserfs_paste_into_item(struct reis
+@@ -2027,6 +2036,7 @@ int reiserfs_paste_into_item(struct reis
  		       n_pasted_size, inode->i_uid,
  		       key2type(&(p_s_key->on_disk_key)));
  #endif
@@ -8235,7 +7802,7 @@
  	DQUOT_FREE_SPACE_NODIRTY(inode, n_pasted_size);
  	return retval;
  }
-@@ -2065,6 +2075,11 @@ int reiserfs_insert_item(struct reiserfs
+@@ -2064,6 +2074,11 @@ int reiserfs_insert_item(struct reiserfs
  			pathrelse(p_s_path);
  			return -EDQUOT;
  		}
@@ -8247,7 +7814,7 @@
  	}
  	init_tb_struct(th, &s_ins_balance, th->t_super, p_s_path,
  		       IH_SIZE + ih_item_len(p_s_ih));
-@@ -2112,7 +2127,9 @@ int reiserfs_insert_item(struct reiserfs
+@@ -2111,7 +2126,9 @@ int reiserfs_insert_item(struct reiserfs
  		       "reiserquota insert_item(): freeing %u id=%u type=%c",
  		       quota_bytes, inode->i_uid, head2type(p_s_ih));
  #endif
@@ -8258,8 +7825,8 @@
 +	}
  	return retval;
  }
---- a/fs/reiserfs/super.c	2008-05-21 14:30:05.000000000 -0400
-+++ a/fs/reiserfs/super.c	2008-05-21 14:30:41.000000000 -0400
+--- a/fs/reiserfs/super.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/reiserfs/super.c	2008-07-16 22:41:36.000000000 -0400
 @@ -896,6 +896,14 @@ static int reiserfs_parse_options(struct
  		{"user_xattr",.setmask = 1 << REISERFS_UNSUPPORTED_OPT},
  		{"nouser_xattr",.clrmask = 1 << REISERFS_UNSUPPORTED_OPT},
@@ -8299,8 +7866,8 @@
  	rs = SB_DISK_SUPER_BLOCK(s);
  	/* Let's do basic sanity check to verify that underlying device is not
  	   smaller than the filesystem. If the check fails then abort and scream,
---- a/fs/reiserfs/xattr.c	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/reiserfs/xattr.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/reiserfs/xattr.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/reiserfs/xattr.c	2008-07-16 22:41:36.000000000 -0400
 @@ -35,6 +35,7 @@
  #include <linux/namei.h>
  #include <linux/errno.h>
@@ -8309,17 +7876,8 @@
  #include <linux/file.h>
  #include <linux/pagemap.h>
  #include <linux/xattr.h>
-@@ -747,7 +748,7 @@ int reiserfs_delete_xattrs(struct inode 
- 	if (dir->d_inode->i_nlink <= 2) {
- 		root = get_xa_root(inode->i_sb, XATTR_REPLACE);
- 		reiserfs_write_lock_xattrs(inode->i_sb);
--		err = vfs_rmdir(root->d_inode, dir);
-+		err = vfs_rmdir(root->d_inode, dir, NULL);
- 		reiserfs_write_unlock_xattrs(inode->i_sb);
- 		dput(root);
- 	} else {
 --- a/fs/stat.c	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/stat.c	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/stat.c	2008-07-16 22:41:36.000000000 -0400
 @@ -26,6 +26,7 @@ void generic_fillattr(struct inode *inod
  	stat->nlink = inode->i_nlink;
  	stat->uid = inode->i_uid;
@@ -8328,19 +7886,19 @@
  	stat->rdev = inode->i_rdev;
  	stat->atime = inode->i_atime;
  	stat->mtime = inode->i_mtime;
---- a/fs/super.c	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/super.c	2008-04-19 15:14:52.000000000 -0400
-@@ -37,6 +37,9 @@
- #include <linux/idr.h>
+--- a/fs/super.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/super.c	2008-07-17 21:01:21.000000000 -0400
+@@ -38,6 +38,9 @@
  #include <linux/kobject.h>
  #include <linux/mutex.h>
+ #include <linux/file.h>
 +#include <linux/devpts_fs.h>
 +#include <linux/proc_fs.h>
 +#include <linux/vs_context.h>
  #include <asm/uaccess.h>
+ #include "internal.h"
  
- 
-@@ -859,12 +862,18 @@ struct vfsmount *
+@@ -886,12 +889,18 @@ struct vfsmount *
  vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void *data)
  {
  	struct vfsmount *mnt;
@@ -8359,7 +7917,7 @@
  	error = -ENOMEM;
  	mnt = alloc_vfsmnt(name);
  	if (!mnt)
-@@ -885,7 +894,14 @@ vfs_kern_mount(struct file_system_type *
+@@ -912,7 +921,14 @@ vfs_kern_mount(struct file_system_type *
  		goto out_free_secdata;
  	BUG_ON(!mnt->mnt_sb);
  
@@ -8375,8 +7933,8 @@
   	if (error)
   		goto out_sb;
  
---- a/fs/sysfs/mount.c	2008-04-17 11:31:38.000000000 -0400
-+++ a/fs/sysfs/mount.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/sysfs/mount.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/sysfs/mount.c	2008-07-16 22:41:36.000000000 -0400
 @@ -19,8 +19,6 @@
  
  #include "sysfs.h"
@@ -8395,9 +7953,9 @@
  	sb->s_op = &sysfs_ops;
  	sb->s_time_gran = 1;
  	sysfs_sb = sb;
---- a/fs/utimes.c	2008-05-21 14:30:05.000000000 -0400
-+++ a/fs/utimes.c	2008-05-21 14:30:41.000000000 -0400
-@@ -7,6 +7,8 @@
+--- a/fs/utimes.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/utimes.c	2008-07-16 22:41:36.000000000 -0400
+@@ -8,6 +8,8 @@
  #include <linux/stat.h>
  #include <linux/utime.h>
  #include <linux/syscalls.h>
@@ -8406,7 +7964,7 @@
  #include <asm/uaccess.h>
  #include <asm/unistd.h>
  
-@@ -89,6 +91,9 @@ long do_utimes(int dfd, char __user *fil
+@@ -87,6 +89,9 @@ long do_utimes(int dfd, char __user *fil
  		if (error)
  			goto out;
  
@@ -8414,11 +7972,11 @@
 +		if (error)
 +			goto dput_and_out;
  		dentry = nd.path.dentry;
+ 		mnt = nd.path.mnt;
  	}
- 
---- a/fs/xattr.c	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/xattr.c	2008-04-21 13:52:50.000000000 -0400
-@@ -17,6 +17,7 @@
+--- a/fs/xattr.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/xattr.c	2008-07-16 22:41:36.000000000 -0400
+@@ -18,6 +18,7 @@
  #include <linux/module.h>
  #include <linux/fsnotify.h>
  #include <linux/audit.h>
@@ -8426,101 +7984,20 @@
  #include <asm/uaccess.h>
  
  
-@@ -220,7 +221,7 @@ EXPORT_SYMBOL_GPL(vfs_removexattr);
-  */
- static long
- setxattr(struct dentry *d, char __user *name, void __user *value,
--	 size_t size, int flags)
-+	 size_t size, int flags, struct vfsmount *mnt)
- {
- 	int error;
- 	void *kvalue = NULL;
-@@ -247,6 +248,9 @@ setxattr(struct dentry *d, char __user *
- 		}
- 	}
- 
-+	if (MNT_IS_RDONLY(mnt))
-+		return -EROFS;
-+
- 	error = vfs_setxattr(d, kname, kvalue, size, flags);
- 	kfree(kvalue);
- 	return error;
-@@ -262,7 +266,7 @@ sys_setxattr(char __user *path, char __u
- 	error = user_path_walk(path, &nd);
- 	if (error)
- 		return error;
--	error = setxattr(nd.path.dentry, name, value, size, flags);
-+	error = setxattr(nd.path.dentry, name, value, size, flags, nd.path.mnt);
- 	path_put(&nd.path);
- 	return error;
- }
-@@ -277,7 +281,7 @@ sys_lsetxattr(char __user *path, char __
- 	error = user_path_walk_link(path, &nd);
- 	if (error)
- 		return error;
--	error = setxattr(nd.path.dentry, name, value, size, flags);
-+	error = setxattr(nd.path.dentry, name, value, size, flags, nd.path.mnt);
- 	path_put(&nd.path);
- 	return error;
- }
-@@ -295,7 +299,7 @@ sys_fsetxattr(int fd, char __user *name,
- 		return error;
- 	dentry = f->f_path.dentry;
- 	audit_inode(NULL, dentry);
--	error = setxattr(dentry, name, value, size, flags);
-+	error = setxattr(dentry, name, value, size, flags, f->f_vfsmnt);
- 	fput(f);
- 	return error;
- }
-@@ -459,7 +463,7 @@ sys_flistxattr(int fd, char __user *list
-  * Extended attribute REMOVE operations
-  */
- static long
--removexattr(struct dentry *d, char __user *name)
-+removexattr(struct dentry *d, char __user *name, struct vfsmount *mnt)
- {
- 	int error;
- 	char kname[XATTR_NAME_MAX + 1];
-@@ -470,6 +474,9 @@ removexattr(struct dentry *d, char __use
- 	if (error < 0)
- 		return error;
- 
-+	if (MNT_IS_RDONLY(mnt))
-+		return -EROFS;
-+
- 	return vfs_removexattr(d, kname);
- }
- 
-@@ -482,7 +489,7 @@ sys_removexattr(char __user *path, char 
- 	error = user_path_walk(path, &nd);
- 	if (error)
- 		return error;
--	error = removexattr(nd.path.dentry, name);
-+	error = removexattr(nd.path.dentry, name, nd.path.mnt);
- 	path_put(&nd.path);
- 	return error;
- }
-@@ -496,7 +503,7 @@ sys_lremovexattr(char __user *path, char
- 	error = user_path_walk_link(path, &nd);
- 	if (error)
- 		return error;
--	error = removexattr(nd.path.dentry, name);
-+	error = removexattr(nd.path.dentry, name, nd.path.mnt);
- 	path_put(&nd.path);
- 	return error;
- }
-@@ -513,7 +520,7 @@ sys_fremovexattr(int fd, char __user *na
- 		return error;
- 	dentry = f->f_path.dentry;
- 	audit_inode(NULL, dentry);
--	error = removexattr(dentry, name);
-+	error = removexattr(dentry, name, f->f_vfsmnt);
- 	fput(f);
- 	return error;
- }
---- a/fs/xfs/linux-2.6/xfs_ioctl.c	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/xfs/linux-2.6/xfs_ioctl.c	2008-04-19 15:14:52.000000000 -0400
-@@ -1125,7 +1125,8 @@ xfs_merge_ioc_xflags(
+--- a/fs/xfs/linux-2.6/xfs_ioctl.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/xfs/linux-2.6/xfs_ioctl.c	2008-08-11 23:04:52.000000000 -0400
+@@ -800,6 +800,10 @@ xfs_merge_ioc_xflags(
+ 		xflags |= XFS_XFLAG_IMMUTABLE;
+ 	else
+ 		xflags &= ~XFS_XFLAG_IMMUTABLE;
++	if (flags & FS_IXUNLINK_FL)
++		xflags |= XFS_XFLAG_IXUNLINK;
++	else
++		xflags &= ~XFS_XFLAG_IXUNLINK;
+ 	if (flags & FS_APPEND_FL)
+ 		xflags |= XFS_XFLAG_APPEND;
+ 	else
+@@ -822,12 +826,16 @@ xfs_merge_ioc_xflags(
  
  STATIC unsigned int
  xfs_di2lxflags(
@@ -8530,29 +8007,57 @@
  {
  	unsigned int	flags = 0;
  
-@@ -1139,6 +1140,11 @@ xfs_di2lxflags(
+ 	if (di_flags & XFS_DIFLAG_IMMUTABLE)
+ 		flags |= FS_IMMUTABLE_FL;
++	if (di_flags & XFS_DIFLAG_IXUNLINK)
++		flags |= FS_IXUNLINK_FL;
++
+ 	if (di_flags & XFS_DIFLAG_APPEND)
+ 		flags |= FS_APPEND_FL;
+ 	if (di_flags & XFS_DIFLAG_SYNC)
+@@ -836,6 +844,11 @@ xfs_di2lxflags(
  		flags |= FS_NOATIME_FL;
  	if (di_flags & XFS_DIFLAG_NODUMP)
  		flags |= FS_NODUMP_FL;
 +
-+	if (di_vflags & XFS_DIVFLAG_IUNLINK)
-+		flags |= FS_IUNLINK_FL;
 +	if (di_vflags & XFS_DIVFLAG_BARRIER)
 +		flags |= FS_BARRIER_FL;
++	if (di_vflags & XFS_DIVFLAG_COW)
++		flags |= FS_COW_FL;
  	return flags;
  }
  
-@@ -1219,7 +1225,7 @@ xfs_ioc_xattr(
- 	}
+@@ -916,7 +929,8 @@ xfs_ioc_getxflags(
+ {
+ 	unsigned int		flags;
  
- 	case XFS_IOC_GETXFLAGS: {
--		flags = xfs_di2lxflags(ip->i_d.di_flags);
-+		flags = xfs_di2lxflags(ip->i_d.di_flags, ip->i_d.di_vflags);
- 		if (copy_to_user(arg, &flags, sizeof(flags)))
- 			error = -EFAULT;
- 		break;
---- a/fs/xfs/linux-2.6/xfs_iops.c	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/xfs/linux-2.6/xfs_iops.c	2008-04-19 17:01:15.000000000 -0400
+-	flags = xfs_di2lxflags(ip->i_d.di_flags);
++	flags = xfs_di2lxflags(ip->i_d.di_flags, ip->i_d.di_vflags);
++	flags &= ~(XFS_XFLAG_BARRIER | XFS_XFLAG_COW);
+ 	if (copy_to_user(arg, &flags, sizeof(flags)))
+ 		return -EFAULT;
+ 	return 0;
+@@ -1096,10 +1110,18 @@ xfs_ioctl(
+ 	case XFS_IOC_FSGETXATTRA:
+ 		return xfs_ioc_fsgetxattr(ip, 1, arg);
+ 	case XFS_IOC_FSSETXATTR:
++		if (IS_BARRIER(inode)) {
++			vxwprintk_task(1, "messing with the barrier.");
++			return -XFS_ERROR(EACCES);
++		}
+ 		return xfs_ioc_fssetxattr(ip, filp, arg);
+ 	case XFS_IOC_GETXFLAGS:
+ 		return xfs_ioc_getxflags(ip, arg);
+ 	case XFS_IOC_SETXFLAGS:
++		if (IS_BARRIER(inode)) {
++			vxwprintk_task(1, "messing with the barrier.");
++			return -XFS_ERROR(EACCES);
++		}
+ 		return xfs_ioc_setxflags(ip, filp, arg);
+ 
+ 	case XFS_IOC_FSSETDM: {
+--- a/fs/xfs/linux-2.6/xfs_iops.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/xfs/linux-2.6/xfs_iops.c	2008-08-12 02:03:50.000000000 -0400
 @@ -53,6 +53,7 @@
  #include <linux/namei.h>
  #include <linux/security.h>
@@ -8561,15 +8066,23 @@
  
  /*
   * Bring the atime in the XFS inode uptodate.
-@@ -391,6 +392,7 @@ xfs_vn_lookup(
+@@ -389,6 +390,7 @@ xfs_vn_lookup(
  		d_add(dentry, NULL);
  		return NULL;
  	}
 +	dx_propagate_tag(nd, vn_to_inode(cvp));
  
- 	return d_splice_alias(vn_to_inode(cvp), dentry);
+ 	return d_splice_alias(cip->i_vnode, dentry);
  }
-@@ -655,6 +657,10 @@ xfs_vn_setattr(
+@@ -619,6 +621,7 @@ xfs_vn_getattr(
+ 	stat->nlink = ip->i_d.di_nlink;
+ 	stat->uid = ip->i_d.di_uid;
+ 	stat->gid = ip->i_d.di_gid;
++	stat->tag = ip->i_d.di_tag;
+ 	stat->ino = ip->i_ino;
+ #if XFS_BIG_INUMS
+ 	stat->ino += mp->m_inoadd;
+@@ -668,6 +671,10 @@ xfs_vn_setattr(
  	int		flags = 0;
  	int		error;
  
@@ -8580,7 +8093,7 @@
  	if (ia_valid & ATTR_UID) {
  		vattr.va_mask |= XFS_AT_UID;
  		vattr.va_uid = attr->ia_uid;
-@@ -663,6 +669,10 @@ xfs_vn_setattr(
+@@ -676,6 +683,10 @@ xfs_vn_setattr(
  		vattr.va_mask |= XFS_AT_GID;
  		vattr.va_gid = attr->ia_gid;
  	}
@@ -8591,67 +8104,89 @@
  	if (ia_valid & ATTR_SIZE) {
  		vattr.va_mask |= XFS_AT_SIZE;
  		vattr.va_size = attr->ia_size;
-@@ -708,6 +718,42 @@ xfs_vn_truncate(
+@@ -728,6 +739,57 @@ xfs_vn_truncate(
+ 	WARN_ON(error);
  }
  
- STATIC int
++/* Propagate flags from i_flags to XFS_I(inode)->di_flags */
++STATIC void
++xfs_get_inode_flags(struct inode *inode)
++{
++	xfs_inode_t *ip = XFS_I(inode);
++	unsigned int flags = inode->i_flags;
++	unsigned int vflags = inode->i_vflags;
++
++	if (flags & S_IMMUTABLE)
++		ip->i_d.di_flags |= XFS_DIFLAG_IMMUTABLE;
++	else
++		ip->i_d.di_flags &= ~XFS_DIFLAG_IMMUTABLE;
++	if (flags & S_IXUNLINK)
++		ip->i_d.di_flags |= XFS_DIFLAG_IXUNLINK;
++	else
++		ip->i_d.di_flags &= ~XFS_DIFLAG_IXUNLINK;
++
++	if (vflags & V_BARRIER)
++		ip->i_d.di_vflags |= XFS_DIVFLAG_BARRIER;
++	else
++		ip->i_d.di_vflags &= ~XFS_DIVFLAG_BARRIER;
++	if (vflags & V_COW)
++		ip->i_d.di_vflags |= XFS_DIVFLAG_COW;
++	else
++		ip->i_d.di_vflags &= ~XFS_DIVFLAG_COW;
++}
++
++STATIC int
 +xfs_vn_sync_flags(struct inode *inode)
 +{
-+	unsigned int oldflags, newflags;
-+	int		flags = 0;
-+	int		error;
-+	bhv_vattr_t	vattr;
-+	bhv_vnode_t	*vp = vn_from_inode(inode);
++	xfs_inode_t *ip = XFS_I(inode);
++	struct bhv_vattr *vattr;
++	int error;
++
++	vattr = kmalloc(sizeof(*vattr), GFP_KERNEL);
++	if (unlikely(!vattr))
++		return -ENOMEM;
 +
-+	memset(&vattr, 0, sizeof vattr);
++	xfs_get_inode_flags(inode);
 +
-+	vattr.va_mask = XFS_AT_XFLAGS;
-+	error = xfs_getattr(XFS_I(inode), &vattr, 0);
++	vattr->va_mask = XFS_AT_XFLAGS;
++	vattr->va_xflags = xfs_ip2xflags(ip);
 +
-+	if (error)
-+		return error;
-+	oldflags = vattr.va_xflags;
-+	newflags = oldflags & ~(XFS_XFLAG_IMMUTABLE |
-+		XFS_XFLAG_IUNLINK | XFS_XFLAG_BARRIER);
-+
-+	if (IS_IMMUTABLE(inode))
-+		newflags |= XFS_XFLAG_IMMUTABLE;
-+	if (IS_IUNLINK(inode))
-+		newflags |= XFS_XFLAG_IUNLINK;
-+	if (IS_BARRIER(inode))
-+		newflags |= XFS_XFLAG_BARRIER;
++	error = -xfs_setattr(ip, vattr, 0, NULL);
++	if (likely(!error))
++		vn_revalidate(XFS_ITOV(ip));	/* update flags */
 +
-+	if (oldflags ^ newflags) {
-+		vattr.va_xflags = newflags;
-+		vattr.va_mask |= XFS_AT_XFLAGS;
-+		error = xfs_setattr(XFS_I(inode), &vattr, flags, NULL);
-+	}
-+	vn_revalidate(vp);
++	kfree(vattr);
 +	return error;
 +}
 +
-+STATIC int
+ STATIC int
  xfs_vn_setxattr(
  	struct dentry	*dentry,
- 	const char	*name,
-@@ -881,6 +927,8 @@ const struct inode_operations xfs_dir_in
- 	.getxattr		= xfs_vn_getxattr,
+@@ -883,6 +945,7 @@ const struct inode_operations xfs_inode_
  	.listxattr		= xfs_vn_listxattr,
  	.removexattr		= xfs_vn_removexattr,
+ 	.fallocate		= xfs_vn_fallocate,
 +	.sync_flags		= xfs_vn_sync_flags,
+ };
+ 
+ const struct inode_operations xfs_dir_inode_operations = {
+@@ -902,6 +965,7 @@ const struct inode_operations xfs_dir_in
+ 	.getxattr		= xfs_vn_getxattr,
+ 	.listxattr		= xfs_vn_listxattr,
+ 	.removexattr		= xfs_vn_removexattr,
 +	.sync_flags		= xfs_vn_sync_flags,
  };
  
  const struct inode_operations xfs_symlink_inode_operations = {
-@@ -894,4 +942,5 @@ const struct inode_operations xfs_symlin
+@@ -915,4 +979,5 @@ const struct inode_operations xfs_symlin
  	.getxattr		= xfs_vn_getxattr,
  	.listxattr		= xfs_vn_listxattr,
  	.removexattr		= xfs_vn_removexattr,
 +	.sync_flags		= xfs_vn_sync_flags,
  };
---- a/fs/xfs/linux-2.6/xfs_linux.h	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/xfs/linux-2.6/xfs_linux.h	2008-04-19 15:14:52.000000000 -0400
-@@ -128,6 +128,7 @@
+--- a/fs/xfs/linux-2.6/xfs_linux.h	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/xfs/linux-2.6/xfs_linux.h	2008-07-16 22:41:36.000000000 -0400
+@@ -127,6 +127,7 @@
  #define current_pid()		(current->pid)
  #define current_fsuid(cred)	(current->fsuid)
  #define current_fsgid(cred)	(current->fsgid)
@@ -8659,8 +8194,8 @@
  #define current_test_flags(f)	(current->flags & (f))
  #define current_set_flags_nested(sp, f)		\
  		(*(sp) = current->flags, current->flags |= (f))
---- a/fs/xfs/linux-2.6/xfs_super.c	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/xfs/linux-2.6/xfs_super.c	2008-04-26 09:51:47.000000000 -0400
+--- a/fs/xfs/linux-2.6/xfs_super.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/xfs/linux-2.6/xfs_super.c	2008-07-16 22:41:36.000000000 -0400
 @@ -137,6 +137,9 @@ xfs_args_allocate(
  #define MNTOPT_DMAPI	"dmapi"		/* DMI enabled (DMAPI / XDSM) */
  #define MNTOPT_XDSM	"xdsm"		/* DMI enabled (DMAPI / XDSM) */
@@ -8699,7 +8234,7 @@
  
  	switch (inode->i_mode & S_IFMT) {
  	case S_IFBLK:
-@@ -612,6 +629,7 @@ xfs_revalidate_inode(
+@@ -612,10 +629,16 @@ xfs_revalidate_inode(
  	inode->i_mtime.tv_nsec	= ip->i_d.di_mtime.t_nsec;
  	inode->i_ctime.tv_sec	= ip->i_d.di_ctime.t_sec;
  	inode->i_ctime.tv_nsec	= ip->i_d.di_ctime.t_nsec;
@@ -8707,23 +8242,33 @@
  	if (ip->i_d.di_flags & XFS_DIFLAG_IMMUTABLE)
  		inode->i_flags |= S_IMMUTABLE;
  	else
-@@ -628,6 +646,15 @@ xfs_revalidate_inode(
+ 		inode->i_flags &= ~S_IMMUTABLE;
++	if (ip->i_d.di_flags & XFS_DIFLAG_IXUNLINK)
++		inode->i_flags |= S_IXUNLINK;
++	else
++		inode->i_flags &= ~S_IXUNLINK;
++
+ 	if (ip->i_d.di_flags & XFS_DIFLAG_APPEND)
+ 		inode->i_flags |= S_APPEND;
+ 	else
+@@ -628,6 +651,16 @@ xfs_revalidate_inode(
  		inode->i_flags |= S_NOATIME;
  	else
  		inode->i_flags &= ~S_NOATIME;
 +
-+	if (ip->i_d.di_vflags & XFS_DIVFLAG_IUNLINK)
-+		inode->i_flags |= S_IUNLINK;
-+	else
-+		inode->i_flags &= ~S_IUNLINK;
 +	if (ip->i_d.di_vflags & XFS_DIVFLAG_BARRIER)
-+		inode->i_flags |= S_BARRIER;
++		inode->i_vflags |= V_BARRIER;
++	else
++		inode->i_vflags &= ~V_BARRIER;
++	if (ip->i_d.di_vflags & XFS_DIVFLAG_COW)
++		inode->i_vflags |= V_COW;
 +	else
-+		inode->i_flags &= ~S_BARRIER;
++		inode->i_vflags &= ~V_COW;
++
  	xfs_iflags_clear(ip, XFS_IMODIFIED);
  }
  
-@@ -1220,6 +1247,12 @@ xfs_fs_remount(
+@@ -1220,6 +1253,12 @@ xfs_fs_remount(
  	int			error;
  
  	error = xfs_parseargs(mp, options, args, 1);
@@ -8736,7 +8281,7 @@
  	if (!error)
  		error = xfs_mntupdate(mp, flags, args);
  	kmem_free(args, sizeof(*args));
-@@ -1336,6 +1369,9 @@ xfs_fs_fill_super(
+@@ -1336,6 +1375,9 @@ xfs_fs_fill_super(
  	if (error)
  		goto fail_vfsop;
  
@@ -8747,7 +8292,7 @@
  	sb->s_magic = XFS_SB_MAGIC;
  	sb->s_blocksize = mp->m_sb.sb_blocksize;
 --- a/fs/xfs/linux-2.6/xfs_vnode.c	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/xfs/linux-2.6/xfs_vnode.c	2008-04-19 17:04:58.000000000 -0400
++++ a/fs/xfs/linux-2.6/xfs_vnode.c	2008-07-16 22:41:36.000000000 -0400
 @@ -105,6 +105,7 @@ vn_revalidate(
  	inode->i_mode	    = ip->i_d.di_mode;
  	inode->i_uid	    = ip->i_d.di_uid;
@@ -8756,24 +8301,36 @@
  	inode->i_mtime.tv_sec = ip->i_d.di_mtime.t_sec;
  	inode->i_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec;
  	inode->i_ctime.tv_sec = ip->i_d.di_ctime.t_sec;
-@@ -115,6 +116,14 @@ vn_revalidate(
+@@ -115,6 +116,10 @@ vn_revalidate(
  		inode->i_flags |= S_IMMUTABLE;
  	else
  		inode->i_flags &= ~S_IMMUTABLE;
-+	if (xflags & XFS_XFLAG_IUNLINK)
-+		inode->i_flags |= S_IUNLINK;
++	if (xflags & XFS_XFLAG_IXUNLINK)
++		inode->i_flags |= S_IXUNLINK;
 +	else
-+		inode->i_flags &= ~S_IUNLINK;
-+	if (xflags & XFS_XFLAG_BARRIER)
-+		inode->i_flags |= S_BARRIER;
-+	else
-+		inode->i_flags &= ~S_BARRIER;
++		inode->i_flags &= ~S_IXUNLINK;
  	if (xflags & XFS_XFLAG_APPEND)
  		inode->i_flags |= S_APPEND;
  	else
---- a/fs/xfs/linux-2.6/xfs_vnode.h	2008-04-17 12:05:41.000000000 -0400
-+++ a/fs/xfs/linux-2.6/xfs_vnode.h	2008-04-19 15:14:52.000000000 -0400
-@@ -99,6 +99,7 @@ typedef struct bhv_vattr {
+@@ -127,6 +132,15 @@ vn_revalidate(
+ 		inode->i_flags |= S_NOATIME;
+ 	else
+ 		inode->i_flags &= ~S_NOATIME;
++
++	if (xflags & XFS_XFLAG_BARRIER)
++		inode->i_vflags |= V_BARRIER;
++	else
++		inode->i_vflags &= ~V_BARRIER;
++	if (xflags & XFS_XFLAG_COW)
++		inode->i_vflags |= V_COW;
++	else
++		inode->i_vflags &= ~V_COW;
+ 	xfs_iunlock(ip, XFS_ILOCK_SHARED);
+ 
+ 	xfs_iflags_clear(ip, XFS_IMODIFIED);
+--- a/fs/xfs/linux-2.6/xfs_vnode.h	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/xfs/linux-2.6/xfs_vnode.h	2008-07-16 22:41:36.000000000 -0400
+@@ -76,6 +76,7 @@ typedef struct bhv_vattr {
  	xfs_nlink_t	va_nlink;	/* number of references to file */
  	uid_t		va_uid;		/* owner user id */
  	gid_t		va_gid;		/* owner group id */
@@ -8781,7 +8338,7 @@
  	xfs_ino_t	va_nodeid;	/* file id */
  	xfs_off_t	va_size;	/* file size in bytes */
  	u_long		va_blocksize;	/* blocksize preferred for i/o */
-@@ -147,13 +148,15 @@ typedef struct bhv_vattr {
+@@ -124,13 +125,15 @@ typedef struct bhv_vattr {
  #define XFS_AT_PROJID		0x04000000
  #define XFS_AT_SIZE_NOPERM	0x08000000
  #define XFS_AT_GENCOUNT		0x10000000
@@ -8798,8 +8355,8 @@
  
  #define XFS_AT_STAT	(XFS_AT_TYPE|XFS_AT_MODE|XFS_AT_UID|XFS_AT_GID|\
  		XFS_AT_FSID|XFS_AT_NODEID|XFS_AT_NLINK|XFS_AT_SIZE|\
---- a/fs/xfs/quota/xfs_qm_syscalls.c	2008-04-17 12:05:42.000000000 -0400
-+++ a/fs/xfs/quota/xfs_qm_syscalls.c	2008-04-19 15:14:52.000000000 -0400
+--- a/fs/xfs/quota/xfs_qm_syscalls.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/xfs/quota/xfs_qm_syscalls.c	2008-07-16 22:41:36.000000000 -0400
 @@ -17,6 +17,7 @@
   */
  
@@ -8817,16 +8374,16 @@
  		return XFS_ERROR(EPERM);
  	/*
  	 * No file system can have quotas enabled on disk but not in core.
-@@ -374,7 +375,7 @@ xfs_qm_scall_trunc_qfiles(
- 	int		error;
+@@ -383,7 +384,7 @@ xfs_qm_scall_trunc_qfiles(
+ 	int		error = 0, error2 = 0;
  	xfs_inode_t	*qip;
  
 -	if (!capable(CAP_SYS_ADMIN))
 +	if (!vx_capable(CAP_SYS_ADMIN, VXC_QUOTA_CTL))
  		return XFS_ERROR(EPERM);
- 	error = 0;
  	if (!xfs_sb_version_hasquota(&mp->m_sb) || flags == 0) {
-@@ -418,7 +419,7 @@ xfs_qm_scall_quotaon(
+ 		qdprintk("qtrunc flags=%x m_qflags=%x\n", flags, mp->m_qflags);
+@@ -426,7 +427,7 @@ xfs_qm_scall_quotaon(
  	uint		accflags;
  	__int64_t	sbflags;
  
@@ -8835,7 +8392,7 @@
  		return XFS_ERROR(EPERM);
  
  	flags &= (XFS_ALL_QUOTA_ACCT | XFS_ALL_QUOTA_ENFD);
-@@ -587,7 +588,7 @@ xfs_qm_scall_setqlim(
+@@ -595,7 +596,7 @@ xfs_qm_scall_setqlim(
  	int			error;
  	xfs_qcnt_t		hard, soft;
  
@@ -8845,16 +8402,16 @@
  
  	if ((newlim->d_fieldmask &
 --- a/fs/xfs/xfs_clnt.h	2008-04-17 12:05:42.000000000 -0400
-+++ a/fs/xfs/xfs_clnt.h	2008-04-19 15:14:52.000000000 -0400
++++ a/fs/xfs/xfs_clnt.h	2008-07-16 22:41:36.000000000 -0400
 @@ -100,5 +100,6 @@ struct xfs_mount_args {
  						 * I/O size in stat(2) */
  #define XFSMNT2_FILESTREAMS	0x00000002	/* enable the filestreams
  						 * allocator */
-+#define XFSMNT2_TAGGED		0x80000000	/* context tagging */
++#define XFSMNT2_TAGGED		0x10000000	/* context tagging */
  
  #endif	/* __XFS_CLNT_H__ */
 --- a/fs/xfs/xfs_dinode.h	2008-04-17 12:05:42.000000000 -0400
-+++ a/fs/xfs/xfs_dinode.h	2008-04-27 10:33:37.000000000 -0400
++++ a/fs/xfs/xfs_dinode.h	2008-07-16 22:41:36.000000000 -0400
 @@ -53,7 +53,9 @@ typedef struct xfs_dinode_core {
  	__be32		di_gid;		/* owner's group id */
  	__be32		di_nlink;	/* number of links to file */
@@ -8871,40 +8428,54 @@
  #define	XFS_DI_U		0x2000000
  #define	XFS_DI_A		0x4000000
 -#define	XFS_DI_NUM_BITS		27
-+#define	XFS_DI_VFLAGS		0x8000000
-+#define	XFS_DI_TAG		0x10000000
++#define	XFS_DI_TAG		0x8000000
++#define	XFS_DI_VFLAGS		0x10000000
 +#define	XFS_DI_NUM_BITS		29
  #define	XFS_DI_ALL_BITS		((1 << XFS_DI_NUM_BITS) - 1)
  #define	XFS_DI_CORE_BITS	(XFS_DI_ALL_BITS & ~(XFS_DI_U|XFS_DI_A))
  
-@@ -223,6 +227,7 @@ typedef enum xfs_dinode_fmt
+@@ -223,6 +227,8 @@ typedef enum xfs_dinode_fmt
  #define XFS_DIFLAG_EXTSZINHERIT_BIT 12	/* inherit inode extent size */
  #define XFS_DIFLAG_NODEFRAG_BIT     13	/* do not reorganize/defragment */
  #define XFS_DIFLAG_FILESTREAM_BIT   14  /* use filestream allocator */
++#define XFS_DIFLAG_IXUNLINK_BIT     15	/* Immutable inver on unlink */
 +
  #define XFS_DIFLAG_REALTIME      (1 << XFS_DIFLAG_REALTIME_BIT)
  #define XFS_DIFLAG_PREALLOC      (1 << XFS_DIFLAG_PREALLOC_BIT)
  #define XFS_DIFLAG_NEWRTBM       (1 << XFS_DIFLAG_NEWRTBM_BIT)
-@@ -252,4 +257,7 @@ typedef enum xfs_dinode_fmt
+@@ -238,6 +244,7 @@ typedef enum xfs_dinode_fmt
+ #define XFS_DIFLAG_EXTSZINHERIT  (1 << XFS_DIFLAG_EXTSZINHERIT_BIT)
+ #define XFS_DIFLAG_NODEFRAG      (1 << XFS_DIFLAG_NODEFRAG_BIT)
+ #define XFS_DIFLAG_FILESTREAM    (1 << XFS_DIFLAG_FILESTREAM_BIT)
++#define XFS_DIFLAG_IXUNLINK      (1 << XFS_DIFLAG_IXUNLINK_BIT)
+ 
+ #ifdef CONFIG_XFS_RT
+ #define XFS_IS_REALTIME_INODE(ip) ((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME)
+@@ -250,6 +257,10 @@ typedef enum xfs_dinode_fmt
+ 	 XFS_DIFLAG_IMMUTABLE | XFS_DIFLAG_APPEND | XFS_DIFLAG_SYNC | \
+ 	 XFS_DIFLAG_NOATIME | XFS_DIFLAG_NODUMP | XFS_DIFLAG_RTINHERIT | \
  	 XFS_DIFLAG_PROJINHERIT | XFS_DIFLAG_NOSYMLINKS | XFS_DIFLAG_EXTSIZE | \
- 	 XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG | XFS_DIFLAG_FILESTREAM)
- 
-+#define	XFS_DIVFLAG_BARRIER	0x01
-+#define	XFS_DIVFLAG_IUNLINK	0x02
+-	 XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG | XFS_DIFLAG_FILESTREAM)
++	 XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG | XFS_DIFLAG_FILESTREAM | \
++	 XFS_DIFLAG_IXUNLINK)
 +
++#define XFS_DIVFLAG_BARRIER	0x01
++#define XFS_DIVFLAG_COW		0x02
+ 
  #endif	/* __XFS_DINODE_H__ */
 --- a/fs/xfs/xfs_fs.h	2008-04-17 12:05:42.000000000 -0400
-+++ a/fs/xfs/xfs_fs.h	2008-04-19 15:14:52.000000000 -0400
-@@ -67,6 +67,8 @@ struct fsxattr {
++++ a/fs/xfs/xfs_fs.h	2008-07-16 22:41:36.000000000 -0400
+@@ -67,6 +67,9 @@ struct fsxattr {
  #define XFS_XFLAG_EXTSZINHERIT	0x00001000	/* inherit inode extent size */
  #define XFS_XFLAG_NODEFRAG	0x00002000  	/* do not defragment */
  #define XFS_XFLAG_FILESTREAM	0x00004000	/* use filestream allocator */
++#define XFS_XFLAG_IXUNLINK	0x00008000	/* immutable invert on unlink */
 +#define XFS_XFLAG_BARRIER	0x10000000	/* chroot() barrier */
-+#define XFS_XFLAG_IUNLINK	0x20000000	/* immutable unlink */
++#define XFS_XFLAG_COW		0x20000000	/* copy on write mark */
  #define XFS_XFLAG_HASATTR	0x80000000	/* no DIFLAG for this	*/
  
  /*
-@@ -296,7 +298,8 @@ typedef struct xfs_bstat {
+@@ -296,7 +299,8 @@ typedef struct xfs_bstat {
  	__s32		bs_extents;	/* number of extents		*/
  	__u32		bs_gen;		/* generation count		*/
  	__u16		bs_projid;	/* project id			*/
@@ -8914,20 +8485,20 @@
  	__u32		bs_dmevmask;	/* DMIG event mask		*/
  	__u16		bs_dmstate;	/* DMIG state info		*/
  	__u16		bs_aextents;	/* attribute number of extents	*/
---- a/fs/xfs/xfs_ialloc.c	2008-04-17 12:05:42.000000000 -0400
-+++ a/fs/xfs/xfs_ialloc.c	2008-04-27 10:30:39.000000000 -0400
-@@ -66,6 +66,8 @@ xfs_ialloc_log_di(
- 		offsetof(xfs_dinode_core_t, di_gid),
- 		offsetof(xfs_dinode_core_t, di_nlink),
- 		offsetof(xfs_dinode_core_t, di_projid),
+--- a/fs/xfs/xfs_ialloc.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/xfs/xfs_ialloc.c	2008-07-16 22:41:36.000000000 -0400
+@@ -84,6 +84,8 @@ xfs_ialloc_log_di(
+ 		offsetof(xfs_dinode_t, di_next_unlinked),
+ 		offsetof(xfs_dinode_t, di_u),
+ 		offsetof(xfs_dinode_t, di_a),
 +		offsetof(xfs_dinode_core_t, di_tag),
 +		offsetof(xfs_dinode_core_t, di_vflags),
- 		offsetof(xfs_dinode_core_t, di_pad),
- 		offsetof(xfs_dinode_core_t, di_atime),
- 		offsetof(xfs_dinode_core_t, di_mtime),
---- a/fs/xfs/xfs_inode.c	2008-04-17 12:05:42.000000000 -0400
-+++ a/fs/xfs/xfs_inode.c	2008-04-26 11:06:34.000000000 -0400
-@@ -219,6 +219,7 @@ xfs_inotobp(
+ 		sizeof(xfs_dinode_t)
+ 	};
+ 
+--- a/fs/xfs/xfs_inode.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/xfs/xfs_inode.c	2008-07-16 22:41:36.000000000 -0400
+@@ -249,6 +249,7 @@ xfs_inotobp(
  	return 0;
  }
  
@@ -8935,11 +8506,15 @@
  
  /*
   * This routine is called to map an inode to the buffer containing
-@@ -716,13 +717,21 @@ xfs_dinode_from_disk(
+@@ -660,15 +661,25 @@ xfs_iformat_btree(
+ void
+ xfs_dinode_from_disk(
  	xfs_icdinode_t		*to,
- 	xfs_dinode_core_t	*from)
+-	xfs_dinode_core_t	*from)
++	xfs_dinode_core_t	*from,
++	int tagged)
  {
-+	uint32_t uid, gid;
++	uint32_t uid, gid, tag;
 +
  	to->di_magic = be16_to_cpu(from->di_magic);
  	to->di_mode = be16_to_cpu(from->di_mode);
@@ -8951,28 +8526,52 @@
 +
 +	uid = be32_to_cpu(from->di_uid);
 +	gid = be32_to_cpu(from->di_gid);
++	tag = be16_to_cpu(from->di_tag);
 +
-+	to->di_uid = INOTAG_UID(1, uid, gid);
-+	to->di_gid = INOTAG_GID(1, uid, gid);
-+	to->di_tag = INOTAG_TAG(1, uid, gid, 0);
++	to->di_uid = INOTAG_UID(tagged, uid, gid);
++	to->di_gid = INOTAG_GID(tagged, uid, gid);
++	to->di_tag = INOTAG_TAG(tagged, uid, gid, tag);
 +
  	to->di_nlink = be32_to_cpu(from->di_nlink);
  	to->di_projid = be16_to_cpu(from->di_projid);
  	memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad));
-@@ -756,8 +765,10 @@ xfs_dinode_to_disk(
+@@ -689,21 +700,26 @@ xfs_dinode_from_disk(
+ 	to->di_dmevmask	= be32_to_cpu(from->di_dmevmask);
+ 	to->di_dmstate	= be16_to_cpu(from->di_dmstate);
+ 	to->di_flags	= be16_to_cpu(from->di_flags);
++	to->di_vflags	= be16_to_cpu(from->di_vflags);
+ 	to->di_gen	= be32_to_cpu(from->di_gen);
+ }
+ 
+ void
+ xfs_dinode_to_disk(
+ 	xfs_dinode_core_t	*to,
+-	xfs_icdinode_t		*from)
++	xfs_icdinode_t		*from,
++	int tagged)
+ {
+ 	to->di_magic = cpu_to_be16(from->di_magic);
+ 	to->di_mode = cpu_to_be16(from->di_mode);
  	to->di_version = from ->di_version;
  	to->di_format = from->di_format;
  	to->di_onlink = cpu_to_be16(from->di_onlink);
 -	to->di_uid = cpu_to_be32(from->di_uid);
 -	to->di_gid = cpu_to_be32(from->di_gid);
 +
-+	to->di_uid = cpu_to_be32(TAGINO_UID(1, from->di_uid, from->di_tag));
-+	to->di_gid = cpu_to_be32(TAGINO_GID(1, from->di_gid, from->di_tag));
++	to->di_uid = cpu_to_be32(TAGINO_UID(tagged, from->di_uid, from->di_tag));
++	to->di_gid = cpu_to_be32(TAGINO_GID(tagged, from->di_gid, from->di_tag));
++	to->di_tag = cpu_to_be16(TAGINO_TAG(tagged, from->di_tag));
 +
  	to->di_nlink = cpu_to_be32(from->di_nlink);
  	to->di_projid = cpu_to_be16(from->di_projid);
  	memcpy(to->di_pad, from->di_pad, sizeof(to->di_pad));
-@@ -783,7 +794,8 @@ xfs_dinode_to_disk(
+@@ -724,12 +740,14 @@ xfs_dinode_to_disk(
+ 	to->di_dmevmask = cpu_to_be32(from->di_dmevmask);
+ 	to->di_dmstate = cpu_to_be16(from->di_dmstate);
+ 	to->di_flags = cpu_to_be16(from->di_flags);
++	to->di_vflags = cpu_to_be16(from->di_vflags);
+ 	to->di_gen = cpu_to_be32(from->di_gen);
+ }
  
  STATIC uint
  _xfs_dic2xflags(
@@ -8982,19 +8581,28 @@
  {
  	uint			flags = 0;
  
-@@ -817,7 +829,10 @@ _xfs_dic2xflags(
+@@ -740,6 +758,8 @@ _xfs_dic2xflags(
+ 			flags |= XFS_XFLAG_PREALLOC;
+ 		if (di_flags & XFS_DIFLAG_IMMUTABLE)
+ 			flags |= XFS_XFLAG_IMMUTABLE;
++		if (di_flags & XFS_DIFLAG_IXUNLINK)
++			flags |= XFS_XFLAG_IXUNLINK;
+ 		if (di_flags & XFS_DIFLAG_APPEND)
+ 			flags |= XFS_XFLAG_APPEND;
+ 		if (di_flags & XFS_DIFLAG_SYNC)
+@@ -763,7 +783,10 @@ _xfs_dic2xflags(
  		if (di_flags & XFS_DIFLAG_FILESTREAM)
  			flags |= XFS_XFLAG_FILESTREAM;
  	}
 -
-+	if (di_vflags & XFS_DIVFLAG_IUNLINK)
-+		flags |= XFS_XFLAG_IUNLINK;
 +	if (di_vflags & XFS_DIVFLAG_BARRIER)
 +		flags |= XFS_XFLAG_BARRIER;
++	if (di_vflags & XFS_DIVFLAG_COW)
++		flags |= XFS_XFLAG_COW;
  	return flags;
  }
  
-@@ -827,7 +842,7 @@ xfs_ip2xflags(
+@@ -773,7 +796,7 @@ xfs_ip2xflags(
  {
  	xfs_icdinode_t		*dic = &ip->i_d;
  
@@ -9003,7 +8611,7 @@
  				(XFS_IFORK_Q(ip) ? XFS_XFLAG_HASATTR : 0);
  }
  
-@@ -837,7 +852,7 @@ xfs_dic2xflags(
+@@ -783,7 +806,7 @@ xfs_dic2xflags(
  {
  	xfs_dinode_core_t	*dic = &dip->di_core;
  
@@ -9012,7 +8620,17 @@
  				(XFS_DFORK_Q(dip) ? XFS_XFLAG_HASATTR : 0);
  }
  
-@@ -1138,6 +1153,7 @@ xfs_ialloc(
+@@ -878,7 +901,8 @@ xfs_iread(
+ 	 * Otherwise, just get the truly permanent information.
+ 	 */
+ 	if (dip->di_core.di_mode) {
+-		xfs_dinode_from_disk(&ip->i_d, &dip->di_core);
++		xfs_dinode_from_disk(&ip->i_d, &dip->di_core,
++			mp->m_flags & XFS_MOUNT_TAGGED);
+ 		error = xfs_iformat(ip, dip);
+ 		if (error)  {
+ 			kmem_zone_free(xfs_inode_zone, ip);
+@@ -1084,6 +1108,7 @@ xfs_ialloc(
  	ASSERT(ip->i_d.di_nlink == nlink);
  	ip->i_d.di_uid = current_fsuid(cr);
  	ip->i_d.di_gid = current_fsgid(cr);
@@ -9020,9 +8638,57 @@
  	ip->i_d.di_projid = prid;
  	memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad));
  
---- a/fs/xfs/xfs_inode.h	2008-04-17 12:05:42.000000000 -0400
-+++ a/fs/xfs/xfs_inode.h	2008-04-19 15:14:52.000000000 -0400
-@@ -187,7 +187,9 @@ typedef struct xfs_icdinode {
+@@ -1138,6 +1163,7 @@ xfs_ialloc(
+ 	ip->i_d.di_dmevmask = 0;
+ 	ip->i_d.di_dmstate = 0;
+ 	ip->i_d.di_flags = 0;
++	ip->i_d.di_vflags = 0;
+ 	flags = XFS_ILOG_CORE;
+ 	switch (mode & S_IFMT) {
+ 	case S_IFIFO:
+@@ -1872,8 +1898,8 @@ xfs_iunlink(
+ 	agi_ok =
+ 		be32_to_cpu(agi->agi_magicnum) == XFS_AGI_MAGIC &&
+ 		XFS_AGI_GOOD_VERSION(be32_to_cpu(agi->agi_versionnum));
+-	if (unlikely(XFS_TEST_ERROR(!agi_ok, mp, XFS_ERRTAG_IUNLINK,
+-			XFS_RANDOM_IUNLINK))) {
++	if (unlikely(XFS_TEST_ERROR(!agi_ok, mp, XFS_ERRTAG_IXUNLINK,
++			XFS_RANDOM_IXUNLINK))) {
+ 		XFS_CORRUPTION_ERROR("xfs_iunlink", XFS_ERRLEVEL_LOW, mp, agi);
+ 		xfs_trans_brelse(tp, agibp);
+ 		return XFS_ERROR(EFSCORRUPTED);
+@@ -1974,8 +2000,8 @@ xfs_iunlink_remove(
+ 	agi_ok =
+ 		be32_to_cpu(agi->agi_magicnum) == XFS_AGI_MAGIC &&
+ 		XFS_AGI_GOOD_VERSION(be32_to_cpu(agi->agi_versionnum));
+-	if (unlikely(XFS_TEST_ERROR(!agi_ok, mp, XFS_ERRTAG_IUNLINK_REMOVE,
+-			XFS_RANDOM_IUNLINK_REMOVE))) {
++	if (unlikely(XFS_TEST_ERROR(!agi_ok, mp, XFS_ERRTAG_IXUNLINK_REMOVE,
++			XFS_RANDOM_IXUNLINK_REMOVE))) {
+ 		XFS_CORRUPTION_ERROR("xfs_iunlink_remove", XFS_ERRLEVEL_LOW,
+ 				     mp, agi);
+ 		xfs_trans_brelse(tp, agibp);
+@@ -2307,6 +2333,7 @@ xfs_ifree(
+ 	}
+ 	ip->i_d.di_mode = 0;		/* mark incore inode as free */
+ 	ip->i_d.di_flags = 0;
++	ip->i_d.di_vflags = 0;
+ 	ip->i_d.di_dmevmask = 0;
+ 	ip->i_d.di_forkoff = 0;		/* mark the attr fork not in use */
+ 	ip->i_df.if_ext_max =
+@@ -3403,7 +3430,8 @@ xfs_iflush_int(
+ 	 * because if the inode is dirty at all the core must
+ 	 * be.
+ 	 */
+-	xfs_dinode_to_disk(&dip->di_core, &ip->i_d);
++	xfs_dinode_to_disk(&dip->di_core, &ip->i_d,
++		mp->m_flags & XFS_MOUNT_TAGGED);
+ 
+ 	/* Wrap, we never let the log put out DI_MAX_FLUSH */
+ 	if (ip->i_d.di_flushiter == DI_MAX_FLUSH)
+--- a/fs/xfs/xfs_inode.h	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/xfs/xfs_inode.h	2008-07-16 22:41:36.000000000 -0400
+@@ -174,7 +174,9 @@ typedef struct xfs_icdinode {
  	__uint32_t	di_gid;		/* owner's group id */
  	__uint32_t	di_nlink;	/* number of links to file */
  	__uint16_t	di_projid;	/* owner's project id */
@@ -9033,9 +8699,21 @@
  	__uint16_t	di_flushiter;	/* incremented on flush */
  	xfs_ictimestamp_t di_atime;	/* time last accessed */
  	xfs_ictimestamp_t di_mtime;	/* time last modified */
---- a/fs/xfs/xfs_itable.c	2008-04-17 12:05:42.000000000 -0400
-+++ a/fs/xfs/xfs_itable.c	2008-04-19 15:14:52.000000000 -0400
-@@ -89,6 +89,7 @@ xfs_bulkstat_one_iget(
+@@ -495,9 +497,9 @@ int		xfs_ialloc(struct xfs_trans *, xfs_
+ 			   xfs_nlink_t, xfs_dev_t, struct cred *, xfs_prid_t,
+ 			   int, struct xfs_buf **, boolean_t *, xfs_inode_t **);
+ void		xfs_dinode_from_disk(struct xfs_icdinode *,
+-				     struct xfs_dinode_core *);
++				     struct xfs_dinode_core *, int tagged);
+ void		xfs_dinode_to_disk(struct xfs_dinode_core *,
+-				   struct xfs_icdinode *);
++				   struct xfs_icdinode *, int tagged);
+ 
+ uint		xfs_ip2xflags(struct xfs_inode *);
+ uint		xfs_dic2xflags(struct xfs_dinode *);
+--- a/fs/xfs/xfs_itable.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/xfs/xfs_itable.c	2008-07-16 22:41:36.000000000 -0400
+@@ -84,6 +84,7 @@ xfs_bulkstat_one_iget(
  	buf->bs_mode = dic->di_mode;
  	buf->bs_uid = dic->di_uid;
  	buf->bs_gid = dic->di_gid;
@@ -9043,9 +8721,21 @@
  	buf->bs_size = dic->di_size;
  	vn_atime_to_bstime(vp, &buf->bs_atime);
  	buf->bs_mtime.tv_sec = dic->di_mtime.t_sec;
---- a/fs/xfs/xfs_mount.h	2008-04-17 12:05:43.000000000 -0400
-+++ a/fs/xfs/xfs_mount.h	2008-04-19 15:14:52.000000000 -0400
-@@ -378,6 +378,7 @@ typedef struct xfs_mount {
+--- a/fs/xfs/xfs_log_recover.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/xfs/xfs_log_recover.c	2008-07-16 22:41:36.000000000 -0400
+@@ -2418,7 +2418,8 @@ xlog_recover_do_inode_trans(
+ 
+ 	/* The core is in in-core format */
+ 	xfs_dinode_to_disk(&dip->di_core,
+-		(xfs_icdinode_t *)item->ri_buf[1].i_addr);
++		(xfs_icdinode_t *)item->ri_buf[1].i_addr,
++		mp->m_flags & XFS_MOUNT_TAGGED);
+ 
+ 	/* the rest is in on-disk format */
+ 	if (item->ri_buf[1].i_len > sizeof(xfs_dinode_core_t)) {
+--- a/fs/xfs/xfs_mount.h	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/xfs/xfs_mount.h	2008-07-16 22:41:36.000000000 -0400
+@@ -379,6 +379,7 @@ typedef struct xfs_mount {
  #define XFS_MOUNT_FILESTREAMS	(1ULL << 24)	/* enable the filestreams
  						   allocator */
  
@@ -9053,9 +8743,9 @@
  
  /*
   * Default minimum read and write sizes.
---- a/fs/xfs/xfs_vfsops.c	2008-04-17 12:05:43.000000000 -0400
-+++ a/fs/xfs/xfs_vfsops.c	2008-04-26 09:52:49.000000000 -0400
-@@ -290,6 +290,8 @@ xfs_start_flags(
+--- a/fs/xfs/xfs_vfsops.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/xfs/xfs_vfsops.c	2008-07-16 22:41:36.000000000 -0400
+@@ -287,6 +287,8 @@ xfs_start_flags(
  
  	if (ap->flags2 & XFSMNT2_COMPAT_IOSIZE)
  		mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE;
@@ -9064,7 +8754,7 @@
  
  	/*
  	 * no recovery flag requires a read-only mount
-@@ -402,7 +404,6 @@ xfs_finish_flags(
+@@ -399,7 +401,6 @@ xfs_finish_flags(
  		if (ap->flags & XFSMNT_PQUOTAENF)
  			mp->m_qflags |= XFS_OQUOTA_ENFD;
  	}
@@ -9072,25 +8762,17 @@
  	return 0;
  }
  
---- a/fs/xfs/xfs_vnodeops.c	2008-04-17 12:05:43.000000000 -0400
-+++ a/fs/xfs/xfs_vnodeops.c	2008-04-19 15:14:52.000000000 -0400
-@@ -122,6 +122,7 @@ xfs_getattr(
- 	vap->va_mode = ip->i_d.di_mode;
- 	vap->va_uid = ip->i_d.di_uid;
- 	vap->va_gid = ip->i_d.di_gid;
-+	vap->va_tag = ip->i_d.di_tag;
- 	vap->va_projid = ip->i_d.di_projid;
- 
- 	/*
-@@ -221,6 +222,7 @@ xfs_setattr(
+--- a/fs/xfs/xfs_vnodeops.c	2008-07-14 17:22:50.000000000 -0400
++++ a/fs/xfs/xfs_vnodeops.c	2008-07-16 22:41:36.000000000 -0400
+@@ -93,6 +93,7 @@ xfs_setattr(
  	uint			commit_flags=0;
  	uid_t			uid=0, iuid=0;
  	gid_t			gid=0, igid=0;
 +	tag_t			tag=0, itag=0;
  	int			timeflags = 0;
  	xfs_prid_t		projid=0, iprojid=0;
- 	int			mandlock_before, mandlock_after;
-@@ -272,6 +274,7 @@ xfs_setattr(
+ 	struct xfs_dquot	*udqp, *gdqp, *olddquot1, *olddquot2;
+@@ -143,6 +144,7 @@ xfs_setattr(
  	    (mask & (XFS_AT_UID|XFS_AT_GID|XFS_AT_PROJID))) {
  		uint	qflags = 0;
  
@@ -9098,7 +8780,7 @@
  		if ((mask & XFS_AT_UID) && XFS_IS_UQUOTA_ON(mp)) {
  			uid = vap->va_uid;
  			qflags |= XFS_QMOPT_UQUOTA;
-@@ -351,6 +354,8 @@ xfs_setattr(
+@@ -222,6 +224,8 @@ xfs_setattr(
  	if (mask &
  	    (XFS_AT_MODE|XFS_AT_XFLAGS|XFS_AT_EXTSIZE|XFS_AT_UID|
  	     XFS_AT_GID|XFS_AT_PROJID)) {
@@ -9107,7 +8789,7 @@
  		/*
  		 * CAP_FOWNER overrides the following restrictions:
  		 *
-@@ -399,7 +404,7 @@ xfs_setattr(
+@@ -270,7 +274,7 @@ xfs_setattr(
  	 * and can change the group id only to a group of which he
  	 * or she is a member.
  	 */
@@ -9116,7 +8798,7 @@
  		/*
  		 * These IDs could have changed since we last looked at them.
  		 * But, we're assured that if the ownership did change
-@@ -407,10 +412,12 @@ xfs_setattr(
+@@ -278,10 +282,12 @@ xfs_setattr(
  		 * would have changed also.
  		 */
  		iuid = ip->i_d.di_uid;
@@ -9131,7 +8813,7 @@
  		projid = (mask & XFS_AT_PROJID) ? (xfs_prid_t)vap->va_projid :
  			 iprojid;
  
-@@ -438,6 +445,7 @@ xfs_setattr(
+@@ -309,6 +315,7 @@ xfs_setattr(
  		if ((XFS_IS_UQUOTA_ON(mp) && iuid != uid) ||
  		    (XFS_IS_PQUOTA_ON(mp) && iprojid != projid) ||
  		    (XFS_IS_GQUOTA_ON(mp) && igid != gid)) {
@@ -9139,7 +8821,16 @@
  			ASSERT(tp);
  			code = XFS_QM_DQVOPCHOWNRESV(mp, tp, ip, udqp, gdqp,
  						capable(CAP_FOWNER) ?
-@@ -686,7 +694,7 @@ xfs_setattr(
+@@ -423,7 +430,7 @@ xfs_setattr(
+ 		 */
+ 		if ((mask & XFS_AT_XFLAGS) &&
+ 		    (ip->i_d.di_flags &
+-				(XFS_DIFLAG_IMMUTABLE|XFS_DIFLAG_APPEND) ||
++				(XFS_DIFLAG_IMMUTABLE | XFS_DIFLAG_APPEND) ||
+ 		     (vap->va_xflags &
+ 				(XFS_XFLAG_IMMUTABLE | XFS_XFLAG_APPEND))) &&
+ 		    !capable(CAP_LINUX_IMMUTABLE)) {
+@@ -559,7 +566,7 @@ xfs_setattr(
  	 * and can change the group id only to a group of which he
  	 * or she is a member.
  	 */
@@ -9148,7 +8839,7 @@
  		/*
  		 * CAP_FSETID overrides the following restrictions:
  		 *
-@@ -702,6 +710,9 @@ xfs_setattr(
+@@ -575,6 +582,9 @@ xfs_setattr(
  		 * Change the ownerships and register quota modifications
  		 * in the transaction.
  		 */
@@ -9158,7 +8849,7 @@
  		if (iuid != uid) {
  			if (XFS_IS_UQUOTA_ON(mp)) {
  				ASSERT(mask & XFS_AT_UID);
-@@ -777,6 +788,7 @@ xfs_setattr(
+@@ -650,11 +660,14 @@ xfs_setattr(
  		}
  		if (mask & XFS_AT_XFLAGS) {
  			uint	di_flags;
@@ -9166,20 +8857,27 @@
  
  			/* can't set PREALLOC this way, just preserve it */
  			di_flags = (ip->i_d.di_flags & XFS_DIFLAG_PREALLOC);
-@@ -810,6 +822,11 @@ xfs_setattr(
+ 			if (vap->va_xflags & XFS_XFLAG_IMMUTABLE)
+ 				di_flags |= XFS_DIFLAG_IMMUTABLE;
++			if (vap->va_xflags & XFS_XFLAG_IXUNLINK)
++				di_flags |= XFS_DIFLAG_IXUNLINK;
+ 			if (vap->va_xflags & XFS_XFLAG_APPEND)
+ 				di_flags |= XFS_DIFLAG_APPEND;
+ 			if (vap->va_xflags & XFS_XFLAG_SYNC)
+@@ -683,6 +696,11 @@ xfs_setattr(
  					di_flags |= XFS_DIFLAG_EXTSIZE;
  			}
  			ip->i_d.di_flags = di_flags;
-+			if (vap->va_xflags & XFS_XFLAG_IUNLINK)
-+				di_vflags |= XFS_DIVFLAG_IUNLINK;
 +			if (vap->va_xflags & XFS_XFLAG_BARRIER)
 +				di_vflags |= XFS_DIVFLAG_BARRIER;
++			if (vap->va_xflags & XFS_XFLAG_COW)
++				di_vflags |= XFS_DIVFLAG_COW;
 +			ip->i_d.di_vflags = di_vflags;
  		}
  		xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
  		timeflags |= XFS_ICHGTIME_CHG;
 --- a/include/asm-arm/tlb.h	2008-04-17 12:05:43.000000000 -0400
-+++ a/include/asm-arm/tlb.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/asm-arm/tlb.h	2008-07-16 22:41:36.000000000 -0400
 @@ -28,6 +28,7 @@
  #else /* !CONFIG_MMU */
  
@@ -9188,8 +8886,8 @@
  
  /*
   * TLB handling.  This allows us to remove pages from the page
---- a/include/asm-blackfin/unistd.h	2008-04-17 12:05:43.000000000 -0400
-+++ a/include/asm-blackfin/unistd.h	2008-04-19 15:14:52.000000000 -0400
+--- a/include/asm-blackfin/unistd.h	2008-07-14 17:22:52.000000000 -0400
++++ a/include/asm-blackfin/unistd.h	2008-07-16 22:41:36.000000000 -0400
 @@ -278,7 +278,7 @@
  #define __NR_tgkill		271
  #define __NR_utimes		272
@@ -9200,7 +8898,7 @@
  				/* 276 __NR_get_mempolicy */
  				/* 277 __NR_set_mempolicy */
 --- a/include/asm-generic/tlb.h	2008-04-17 12:05:43.000000000 -0400
-+++ a/include/asm-generic/tlb.h	2008-04-19 15:50:15.000000000 -0400
++++ a/include/asm-generic/tlb.h	2008-07-16 22:41:36.000000000 -0400
 @@ -14,6 +14,7 @@
  #define _ASM_GENERIC__TLB_H
  
@@ -9209,8 +8907,8 @@
  #include <asm/pgalloc.h>
  #include <asm/tlbflush.h>
  
---- a/include/asm-ia64/tlb.h	2007-02-04 13:44:54.000000000 -0500
-+++ a/include/asm-ia64/tlb.h	2008-04-19 15:14:52.000000000 -0400
+--- a/include/asm-ia64/tlb.h	2008-07-14 17:22:53.000000000 -0400
++++ a/include/asm-ia64/tlb.h	2008-07-16 22:41:36.000000000 -0400
 @@ -40,6 +40,7 @@
  #include <linux/mm.h>
  #include <linux/pagemap.h>
@@ -9220,7 +8918,7 @@
  #include <asm/pgalloc.h>
  #include <asm/processor.h>
 --- a/include/asm-powerpc/systbl.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/asm-powerpc/systbl.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/asm-powerpc/systbl.h	2008-07-16 22:41:36.000000000 -0400
 @@ -260,7 +260,7 @@ COMPAT_SYS_SPU(fstatfs64)
  SYSX(sys_ni_syscall, ppc_fadvise64_64, ppc_fadvise64_64)
  PPC_SYS_SPU(rtas)
@@ -9231,7 +8929,7 @@
  COMPAT_SYS(mbind)
  COMPAT_SYS(get_mempolicy)
 --- a/include/asm-powerpc/unistd.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/asm-powerpc/unistd.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/asm-powerpc/unistd.h	2008-07-16 22:41:36.000000000 -0400
 @@ -275,7 +275,7 @@
  #endif
  #define __NR_rtas		255
@@ -9242,7 +8940,7 @@
  #define __NR_mbind		259
  #define __NR_get_mempolicy	260
 --- a/include/asm-s390/unistd.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/asm-s390/unistd.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/asm-s390/unistd.h	2008-07-16 22:41:36.000000000 -0400
 @@ -202,7 +202,7 @@
  #define __NR_clock_gettime	(__NR_timer_create+6)
  #define __NR_clock_getres	(__NR_timer_create+7)
@@ -9253,7 +8951,7 @@
  #define __NR_fstatfs64		266
  #define __NR_remap_file_pages	267
 --- a/include/asm-sparc/unistd.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/asm-sparc/unistd.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/asm-sparc/unistd.h	2008-07-16 22:41:36.000000000 -0400
 @@ -282,7 +282,7 @@
  #define __NR_timer_getoverrun	264
  #define __NR_timer_delete	265
@@ -9264,7 +8962,7 @@
  #define __NR_io_destroy		269
  #define __NR_io_submit		270
 --- a/include/asm-sparc64/tlb.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/asm-sparc64/tlb.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/asm-sparc64/tlb.h	2008-07-16 22:41:36.000000000 -0400
 @@ -3,6 +3,7 @@
  
  #include <linux/swap.h>
@@ -9273,8 +8971,8 @@
  #include <asm/pgalloc.h>
  #include <asm/tlbflush.h>
  #include <asm/mmu_context.h>
---- a/include/asm-sparc64/unistd.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/asm-sparc64/unistd.h	2008-04-19 15:14:52.000000000 -0400
+--- a/include/asm-sparc64/unistd.h	2008-07-14 17:22:54.000000000 -0400
++++ a/include/asm-sparc64/unistd.h	2008-07-16 22:41:36.000000000 -0400
 @@ -284,7 +284,7 @@
  #define __NR_timer_getoverrun	264
  #define __NR_timer_delete	265
@@ -9284,8 +8982,8 @@
  #define __NR_io_setup		268
  #define __NR_io_destroy		269
  #define __NR_io_submit		270
---- a/include/asm-x86/unistd_64.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/asm-x86/unistd_64.h	2008-04-19 15:14:52.000000000 -0400
+--- a/include/asm-x86/unistd_64.h	2008-07-14 17:22:54.000000000 -0400
++++ a/include/asm-x86/unistd_64.h	2008-07-16 22:41:36.000000000 -0400
 @@ -535,7 +535,7 @@ __SYSCALL(__NR_tgkill, sys_tgkill)
  #define __NR_utimes				235
  __SYSCALL(__NR_utimes, sys_utimes)
@@ -9295,9 +8993,9 @@
  #define __NR_mbind				237
  __SYSCALL(__NR_mbind, sys_mbind)
  #define __NR_set_mempolicy			238
---- a/include/linux/capability.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/capability.h	2008-04-22 11:01:12.000000000 -0400
-@@ -260,6 +260,7 @@ typedef struct kernel_cap_struct {
+--- a/include/linux/capability.h	2008-07-14 17:22:54.000000000 -0400
++++ a/include/linux/capability.h	2008-07-16 22:41:36.000000000 -0400
+@@ -274,6 +274,7 @@ typedef struct kernel_cap_struct {
     arbitrary SCSI commands */
  /* Allow setting encryption key on loopback filesystem */
  /* Allow setting zone reclaim policy */
@@ -9305,7 +9003,7 @@
  
  #define CAP_SYS_ADMIN        21
  
-@@ -332,7 +333,13 @@ typedef struct kernel_cap_struct {
+@@ -346,7 +347,13 @@ typedef struct kernel_cap_struct {
  
  #define CAP_MAC_ADMIN        33
  
@@ -9320,26 +9018,30 @@
  
  #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
  
---- a/include/linux/devpts_fs.h	2007-02-04 13:44:54.000000000 -0500
-+++ a/include/linux/devpts_fs.h	2008-04-19 15:14:52.000000000 -0400
-@@ -30,5 +30,4 @@ static inline void devpts_pty_kill(int n
+--- a/include/linux/devpts_fs.h	2008-07-14 17:22:54.000000000 -0400
++++ a/include/linux/devpts_fs.h	2008-07-16 22:41:36.000000000 -0400
+@@ -34,5 +34,4 @@ static inline void devpts_pty_kill(int n
  
  #endif
  
 -
  #endif /* _LINUX_DEVPTS_FS_H */
 --- a/include/linux/ext2_fs.h	2008-04-17 11:31:39.000000000 -0400
-+++ a/include/linux/ext2_fs.h	2008-04-19 15:14:52.000000000 -0400
-@@ -189,6 +189,8 @@ struct ext2_group_desc
++++ a/include/linux/ext2_fs.h	2008-07-16 22:41:36.000000000 -0400
+@@ -189,8 +189,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*/
-+#define EXT2_BARRIER_FL			FS_BARRIER_FL	/* Barrier for chroot() */
-+#define EXT2_IUNLINK_FL			FS_IUNLINK_FL	/* Immutable unlink */
++#define EXT2_IXUNLINK_FL		FS_IXUNLINK_FL	/* Immutable invert on unlink */
  #define EXT2_RESERVED_FL		FS_RESERVED_FL	/* reserved for ext2 lib */
  
++#define EXT2_BARRIER_FL			FS_BARRIER_FL	/* Barrier for chroot() */
++#define EXT2_COW_FL			FS_COW_FL	/* Copy on Write marker */
++
  #define EXT2_FL_USER_VISIBLE		FS_FL_USER_VISIBLE	/* User visible flags */
-@@ -247,7 +249,7 @@ struct ext2_inode {
+ #define EXT2_FL_USER_MODIFIABLE		FS_FL_USER_MODIFIABLE	/* User modifiable flags */
+ 
+@@ -247,7 +251,7 @@ struct ext2_inode {
  		struct {
  			__u8	l_i_frag;	/* Fragment number */
  			__u8	l_i_fsize;	/* Fragment size */
@@ -9348,7 +9050,7 @@
  			__le16	l_i_uid_high;	/* these 2 fields    */
  			__le16	l_i_gid_high;	/* were reserved2[0] */
  			__u32	l_i_reserved2;
-@@ -279,6 +281,7 @@ struct ext2_inode {
+@@ -279,6 +283,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
@@ -9356,7 +9058,7 @@
  #define i_reserved2	osd2.linux2.l_i_reserved2
  #endif
  
-@@ -323,6 +326,7 @@ struct ext2_inode {
+@@ -323,6 +328,7 @@ struct ext2_inode {
  #define EXT2_MOUNT_USRQUOTA		0x020000  /* user quota */
  #define EXT2_MOUNT_GRPQUOTA		0x040000  /* group quota */
  #define EXT2_MOUNT_RESERVATION		0x080000  /* Preallocation */
@@ -9365,17 +9067,25 @@
  
  #define clear_opt(o, opt)		o &= ~EXT2_MOUNT_##opt
 --- a/include/linux/ext3_fs.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/ext3_fs.h	2008-04-19 15:14:52.000000000 -0400
-@@ -173,6 +173,8 @@ struct ext3_group_desc
++++ a/include/linux/ext3_fs.h	2008-07-16 22:41:36.000000000 -0400
+@@ -173,10 +173,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_BARRIER_FL			0x04000000 /* Barrier for chroot() */
-+#define EXT3_IUNLINK_FL			0x08000000 /* Immutable unlink */
++#define EXT3_IXUNLINK_FL		0x01000000 /* Immutable invert on unlink */
  #define EXT3_RESERVED_FL		0x80000000 /* reserved for ext3 lib */
  
- #define EXT3_FL_USER_VISIBLE		0x0003DFFF /* User visible flags */
-@@ -292,7 +294,7 @@ struct ext3_inode {
+-#define EXT3_FL_USER_VISIBLE		0x0003DFFF /* User visible flags */
+-#define EXT3_FL_USER_MODIFIABLE		0x000380FF /* User modifiable flags */
++#define EXT3_BARRIER_FL			0x10000000 /* 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 */
+ 
+ /*
+  * Inode dynamic state flags
+@@ -292,7 +296,7 @@ struct ext3_inode {
  		struct {
  			__u8	l_i_frag;	/* Fragment number */
  			__u8	l_i_fsize;	/* Fragment size */
@@ -9384,7 +9094,7 @@
  			__le16	l_i_uid_high;	/* these 2 fields    */
  			__le16	l_i_gid_high;	/* were reserved2[0] */
  			__u32	l_i_reserved2;
-@@ -326,6 +328,7 @@ struct ext3_inode {
+@@ -326,6 +330,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
@@ -9392,7 +9102,7 @@
  #define i_reserved2	osd2.linux2.l_i_reserved2
  
  #elif defined(__GNU__)
-@@ -380,6 +383,7 @@ struct ext3_inode {
+@@ -380,6 +385,7 @@ struct ext3_inode {
  #define EXT3_MOUNT_QUOTA		0x80000 /* Some quota option set */
  #define EXT3_MOUNT_USRQUOTA		0x100000 /* "old" user quota */
  #define EXT3_MOUNT_GRPQUOTA		0x200000 /* "old" group quota */
@@ -9400,7 +9110,7 @@
  
  /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
  #ifndef _LINUX_EXT2_FS_H
-@@ -822,6 +826,7 @@ struct buffer_head * ext3_bread (handle_
+@@ -822,6 +828,7 @@ struct buffer_head * ext3_bread (handle_
  int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
  	sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result,
  	int create, int extend_disksize);
@@ -9408,54 +9118,9 @@
  
  extern struct inode *ext3_iget(struct super_block *, unsigned long);
  extern int  ext3_write_inode (struct inode *, int);
---- a/include/linux/ext4_fs.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/ext4_fs.h	2008-04-19 15:43:04.000000000 -0400
-@@ -231,6 +231,8 @@ struct ext4_group_desc
- #define EXT4_TOPDIR_FL			0x00020000 /* Top of directory hierarchies*/
- #define EXT4_HUGE_FILE_FL               0x00040000 /* Set to each huge file */
- #define EXT4_EXTENTS_FL			0x00080000 /* Inode uses extents */
-+#define EXT4_BARRIER_FL			0x04000000 /* Barrier for chroot() */
-+#define EXT4_IUNLINK_FL			0x08000000 /* Immutable unlink */
- #define EXT4_RESERVED_FL		0x80000000 /* reserved for ext4 lib */
- 
- #define EXT4_FL_USER_VISIBLE		0x000BDFFF /* User visible flags */
-@@ -359,7 +361,8 @@ struct ext4_inode {
- 			__le16	l_i_file_acl_high;
- 			__le16	l_i_uid_high;	/* these 2 fields */
- 			__le16	l_i_gid_high;	/* were reserved2[0] */
--			__u32	l_i_reserved2;
-+			__u16	l_i_tag;	/* Context Tag */
-+			__u16	l_i_reserved2;
- 		} linux2;
- 		struct {
- 			__le16	h_i_reserved1;	/* Obsoleted fragment number/size which are removed in ext4 */
-@@ -465,6 +468,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
-+#define i_raw_tag	osd2.linux2.l_i_tag
- #define i_reserved2	osd2.linux2.l_i_reserved2
- 
- #elif defined(__GNU__)
-@@ -528,6 +532,7 @@ do {									       \
- #define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT	0x1000000 /* Journal Async Commit */
- #define EXT4_MOUNT_I_VERSION            0x2000000 /* i_version support */
- #define EXT4_MOUNT_MBALLOC		0x4000000 /* Buddy allocation support */
-+#define EXT4_MOUNT_TAGGED		0x8000000 /* Enable Context Tags */
- /* Compatibility, for having both ext2_fs.h and ext4_fs.h included at once */
- #ifndef _LINUX_EXT2_FS_H
- #define clear_opt(o, opt)		o &= ~EXT4_MOUNT_##opt
-@@ -1030,6 +1035,7 @@ int ext4_get_blocks_handle(handle_t *han
- 				ext4_lblk_t iblock, unsigned long maxblocks,
- 				struct buffer_head *bh_result,
- 				int create, int extend_disksize);
-+extern int ext4_sync_flags(struct inode *inode);
- 
- extern struct inode *ext4_iget(struct super_block *, unsigned long);
- extern int  ext4_write_inode (struct inode *, int);
---- a/include/linux/fs.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/fs.h	2008-04-19 15:37:28.000000000 -0400
-@@ -125,6 +125,8 @@ extern int dir_notify_enable;
+--- a/include/linux/fs.h	2008-07-14 17:22:54.000000000 -0400
++++ a/include/linux/fs.h	2008-07-16 22:41:36.000000000 -0400
+@@ -126,6 +126,8 @@ extern int dir_notify_enable;
  #define MS_RELATIME	(1<<21)	/* Update atime relative to mtime/ctime. */
  #define MS_KERNMOUNT	(1<<22) /* this is a kern_mount call */
  #define MS_I_VERSION	(1<<23) /* Update inode I_version field */
@@ -9464,23 +9129,22 @@
  #define MS_ACTIVE	(1<<30)
  #define MS_NOUSER	(1<<31)
  
-@@ -151,6 +153,8 @@ extern int dir_notify_enable;
+@@ -152,6 +154,14 @@ extern int dir_notify_enable;
  #define S_NOCMTIME	128	/* Do not update file c/mtime */
  #define S_SWAPFILE	256	/* Do not truncate: swapon got its bmaps */
  #define S_PRIVATE	512	/* Inode is fs-internal */
-+#define S_BARRIER	1024	/* Barrier for chroot() */
-+#define S_IUNLINK	2048	/* Immutable unlink */
++#define S_IXUNLINK	1024	/* Immutable Invert on unlink */
++
++/* Linux-VServer related Inode flags */
++
++#define V_VALID		1
++#define V_XATTR		2
++#define V_BARRIER	4	/* Barrier for chroot() */
++#define V_COW		8	/* Copy on Write */
  
  /*
   * Note that nosuid etc flags are inode-specific: setting some file-system
-@@ -167,25 +171,37 @@ extern int dir_notify_enable;
-  */
- #define __IS_FLG(inode,flg) ((inode)->i_sb->s_flags & (flg))
- 
--#define IS_RDONLY(inode) ((inode)->i_sb->s_flags & MS_RDONLY)
-+#define IS_RDONLY(inode)	__IS_FLG(inode, MS_RDONLY)
- #define IS_SYNC(inode)		(__IS_FLG(inode, MS_SYNCHRONOUS) || \
- 					((inode)->i_flags & S_SYNC))
+@@ -174,12 +184,15 @@ extern int dir_notify_enable;
  #define IS_DIRSYNC(inode)	(__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \
  					((inode)->i_flags & (S_SYNC|S_DIRSYNC)))
  #define IS_MANDLOCK(inode)	__IS_FLG(inode, MS_MANDLOCK)
@@ -9493,18 +9157,19 @@
  #define IS_NOQUOTA(inode)	((inode)->i_flags & S_NOQUOTA)
  #define IS_APPEND(inode)	((inode)->i_flags & S_APPEND)
  #define IS_IMMUTABLE(inode)	((inode)->i_flags & S_IMMUTABLE)
-+#define IS_IUNLINK(inode)	((inode)->i_flags & S_IUNLINK)
-+#define IS_IXORUNLINK(inode)	((IS_IUNLINK(inode) ? S_IMMUTABLE : 0) ^ IS_IMMUTABLE(inode))
++#define IS_IXUNLINK(inode)	((inode)->i_flags & S_IXUNLINK)
++#define IS_IXORUNLINK(inode)	((IS_IXUNLINK(inode) ? S_IMMUTABLE : 0) ^ IS_IMMUTABLE(inode))
  #define IS_POSIXACL(inode)	__IS_FLG(inode, MS_POSIXACL)
  
-+#define IS_BARRIER(inode)	(S_ISDIR((inode)->i_mode) && ((inode)->i_flags & S_BARRIER))
  #define IS_DEADDIR(inode)	((inode)->i_flags & S_DEAD)
- #define IS_NOCMTIME(inode)	((inode)->i_flags & S_NOCMTIME)
+@@ -187,6 +200,16 @@ extern int dir_notify_enable;
  #define IS_SWAPFILE(inode)	((inode)->i_flags & S_SWAPFILE)
  #define IS_PRIVATE(inode)	((inode)->i_flags & S_PRIVATE)
  
++#define IS_BARRIER(inode)	(S_ISDIR((inode)->i_mode) && ((inode)->i_vflags & V_BARRIER))
++
 +#ifdef CONFIG_VSERVER_COWBL
-+#  define IS_COW(inode)		(IS_IUNLINK(inode) && IS_IMMUTABLE(inode))
++#  define IS_COW(inode)		(IS_IXUNLINK(inode) && IS_IMMUTABLE(inode))
 +#  define IS_COW_LINK(inode)	(S_ISREG((inode)->i_mode) && ((inode)->i_nlink > 1))
 +#else
 +#  define IS_COW(inode)		(0)
@@ -9514,22 +9179,24 @@
  /* the read-only stuff doesn't really belong here, but any other place is
     probably as bad and I don't want to create yet another include file. */
  
-@@ -259,12 +275,13 @@ extern int dir_notify_enable;
+@@ -260,11 +283,14 @@ extern int dir_notify_enable;
  #define FS_TOPDIR_FL			0x00020000 /* Top of directory hierarchies*/
  #define FS_EXTENT_FL			0x00080000 /* Extents */
  #define FS_DIRECTIO_FL			0x00100000 /* Use direct i/o */
-+#define FS_BARRIER_FL			0x04000000 /* Barrier for chroot() */
-+#define FS_IUNLINK_FL			0x08000000 /* Immutable unlink */
++#define FS_IXUNLINK_FL			0x01000000 /* Immutable invert on unlink */
  #define FS_RESERVED_FL			0x80000000 /* reserved for ext2 lib */
  
- #define FS_FL_USER_VISIBLE		0x0003DFFF /* User visible flags */
- #define FS_FL_USER_MODIFIABLE		0x000380FF /* User modifiable flags */
+-#define FS_FL_USER_VISIBLE		0x0003DFFF /* User visible flags */
+-#define FS_FL_USER_MODIFIABLE		0x000380FF /* User modifiable flags */
++#define FS_BARRIER_FL			0x10000000 /* Barrier for chroot() */
++#define FS_COW_FL			0x20000000 /* Copy on Write marker */
+ 
++#define FS_FL_USER_VISIBLE		0x0103DFFF /* User visible flags */
++#define FS_FL_USER_MODIFIABLE		0x010380FF /* User modifiable flags */
  
--
  #define SYNC_FILE_RANGE_WAIT_BEFORE	1
  #define SYNC_FILE_RANGE_WRITE		2
- #define SYNC_FILE_RANGE_WAIT_AFTER	4
-@@ -334,6 +351,7 @@ typedef void (dio_iodone_t)(struct kiocb
+@@ -334,6 +360,7 @@ typedef void (dio_iodone_t)(struct kiocb
  #define ATTR_FILE	8192
  #define ATTR_KILL_PRIV	16384
  #define ATTR_OPEN	32768	/* Truncating from open(O_TRUNC) */
@@ -9537,7 +9204,7 @@
  
  /*
   * This is the Inode Attributes structure, used for notify_change().  It
-@@ -349,6 +367,7 @@ struct iattr {
+@@ -349,6 +376,7 @@ struct iattr {
  	umode_t		ia_mode;
  	uid_t		ia_uid;
  	gid_t		ia_gid;
@@ -9545,17 +9212,17 @@
  	loff_t		ia_size;
  	struct timespec	ia_atime;
  	struct timespec	ia_mtime;
-@@ -362,6 +381,9 @@ struct iattr {
+@@ -362,6 +390,9 @@ struct iattr {
  	struct file	*ia_file;
  };
  
 +#define ATTR_FLAG_BARRIER	512	/* Barrier for chroot() */
-+#define ATTR_FLAG_IUNLINK	1024	/* Immutable unlink */
++#define ATTR_FLAG_IXUNLINK	1024	/* Immutable invert on unlink */
 +
  /*
   * Includes for diskquotas.
   */
-@@ -600,7 +622,9 @@ struct inode {
+@@ -600,7 +631,9 @@ struct inode {
  	unsigned int		i_nlink;
  	uid_t			i_uid;
  	gid_t			i_gid;
@@ -9565,7 +9232,17 @@
  	u64			i_version;
  	loff_t			i_size;
  #ifdef __NEED_I_SIZE_ORDERED
-@@ -735,12 +759,12 @@ static inline void i_size_write(struct i
+@@ -648,7 +681,8 @@ struct inode {
+ 	unsigned long		i_state;
+ 	unsigned long		dirtied_when;	/* jiffies of first dirtying */
+ 
+-	unsigned int		i_flags;
++	unsigned short		i_flags;
++	unsigned short		i_vflags;
+ 
+ 	atomic_t		i_writecount;
+ #ifdef CONFIG_SECURITY
+@@ -735,12 +769,12 @@ static inline void i_size_write(struct i
  
  static inline unsigned iminor(const struct inode *inode)
  {
@@ -9580,7 +9257,7 @@
  }
  
  extern struct block_device *I_BDEV(struct inode *inode);
-@@ -795,6 +819,7 @@ struct file {
+@@ -798,6 +832,7 @@ struct file {
  	loff_t			f_pos;
  	struct fown_struct	f_owner;
  	unsigned int		f_uid, f_gid;
@@ -9588,7 +9265,7 @@
  	struct file_ra_state	f_ra;
  
  	u64			f_version;
-@@ -879,6 +904,7 @@ struct file_lock {
+@@ -926,6 +961,7 @@ struct file_lock {
  	unsigned char fl_type;
  	loff_t fl_start;
  	loff_t fl_end;
@@ -9596,26 +9273,7 @@
  
  	struct fasync_struct *	fl_fasync; /* for lease break notifications */
  	unsigned long fl_break_time;	/* for nonblocking lease breaks */
-@@ -1076,12 +1102,12 @@ extern void unlock_super(struct super_bl
-  */
- extern int vfs_permission(struct nameidata *, int);
- extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);
--extern int vfs_mkdir(struct inode *, struct dentry *, int);
--extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t);
--extern int vfs_symlink(struct inode *, struct dentry *, const char *, int);
--extern int vfs_link(struct dentry *, struct inode *, struct dentry *);
--extern int vfs_rmdir(struct inode *, struct dentry *);
--extern int vfs_unlink(struct inode *, struct dentry *);
-+extern int vfs_mkdir(struct inode *, struct dentry *, int, struct nameidata *);
-+extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t, struct nameidata *);
-+extern int vfs_symlink(struct inode *, struct dentry *, const char *, int, struct nameidata *);
-+extern int vfs_link(struct dentry *, struct inode *, struct dentry *, struct nameidata *);
-+extern int vfs_rmdir(struct inode *, struct dentry *, struct nameidata *);
-+extern int vfs_unlink(struct inode *, struct dentry *, struct nameidata *);
- extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
- 
- /*
-@@ -1223,6 +1249,7 @@ struct inode_operations {
+@@ -1272,6 +1308,7 @@ struct inode_operations {
  	void (*truncate_range)(struct inode *, loff_t, loff_t);
  	long (*fallocate)(struct inode *inode, int mode, loff_t offset,
  			  loff_t len);
@@ -9623,15 +9281,15 @@
  };
  
  struct seq_file;
-@@ -1238,6 +1265,7 @@ extern ssize_t vfs_readv(struct file *, 
+@@ -1287,6 +1324,7 @@ extern ssize_t vfs_readv(struct file *, 
  		unsigned long, loff_t *);
  extern ssize_t vfs_writev(struct file *, const struct iovec __user *,
  		unsigned long, loff_t *);
 +ssize_t vfs_sendfile(struct file *, struct file *, loff_t *, size_t, loff_t);
  
- /*
-  * NOTE: write_inode, delete_inode, clear_inode, put_inode can be called
-@@ -1934,6 +1962,7 @@ extern int dcache_dir_open(struct inode 
+ struct super_operations {
+    	struct inode *(*alloc_inode)(struct super_block *sb);
+@@ -1971,6 +2009,7 @@ extern int dcache_dir_open(struct inode 
  extern int dcache_dir_close(struct inode *, struct file *);
  extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
  extern int dcache_readdir(struct file *, void *, filldir_t);
@@ -9640,7 +9298,7 @@
  extern int simple_statfs(struct dentry *, struct kstatfs *);
  extern int simple_link(struct dentry *, struct inode *, struct dentry *);
 --- a/include/linux/if_tun.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/if_tun.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/if_tun.h	2008-07-16 22:41:36.000000000 -0400
 @@ -42,6 +42,7 @@
  #define TUNSETOWNER   _IOW('T', 204, int)
  #define TUNSETLINK    _IOW('T', 205, int)
@@ -9649,9 +9307,9 @@
  
  /* TUNSETIFF ifr flags */
  #define IFF_TUN		0x0001
---- a/include/linux/init_task.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/init_task.h	2008-04-19 15:14:52.000000000 -0400
-@@ -196,6 +196,10 @@ extern struct group_info init_groups;
+--- a/include/linux/init_task.h	2008-07-14 17:22:54.000000000 -0400
++++ a/include/linux/init_task.h	2008-07-16 22:41:36.000000000 -0400
+@@ -179,6 +179,10 @@ extern struct group_info init_groups;
  	INIT_IDS							\
  	INIT_TRACE_IRQFLAGS						\
  	INIT_LOCKDEP							\
@@ -9662,8 +9320,8 @@
  }
  
  
---- a/include/linux/interrupt.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/interrupt.h	2008-04-19 15:14:52.000000000 -0400
+--- a/include/linux/interrupt.h	2008-07-14 17:22:54.000000000 -0400
++++ a/include/linux/interrupt.h	2008-07-16 22:41:36.000000000 -0400
 @@ -8,8 +8,8 @@
  #include <linux/preempt.h>
  #include <linux/cpumask.h>
@@ -9675,7 +9333,7 @@
  #include <asm/atomic.h>
  #include <asm/ptrace.h>
 --- a/include/linux/ipc.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/ipc.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/ipc.h	2008-07-16 22:41:36.000000000 -0400
 @@ -93,6 +93,7 @@ struct kern_ipc_perm
  	key_t		key;
  	uid_t		uid;
@@ -9684,17 +9342,8 @@
  	uid_t		cuid;
  	gid_t		cgid;
  	mode_t		mode; 
---- a/include/linux/Kbuild	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/Kbuild	2008-04-19 15:14:52.000000000 -0400
-@@ -354,3 +354,6 @@ unifdef-y += xattr.h
- unifdef-y += xfrm.h
- 
- objhdr-y += version.h
-+
-+header-y += vserver/
-+
 --- a/include/linux/loop.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/loop.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/loop.h	2008-07-16 22:41:36.000000000 -0400
 @@ -45,6 +45,7 @@ struct loop_device {
  	struct loop_func_table *lo_encryption;
  	__u32           lo_init[2];
@@ -9704,7 +9353,7 @@
  				 unsigned long arg); 
  
 --- a/include/linux/magic.h	2008-04-17 11:31:39.000000000 -0400
-+++ a/include/linux/magic.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/magic.h	2008-07-16 22:41:36.000000000 -0400
 @@ -3,7 +3,7 @@
  
  #define ADFS_SUPER_MAGIC	0xadf5
@@ -9723,7 +9372,7 @@
  
  #define REISERFS_SUPER_MAGIC	0x52654973	/* used by gcc */
 --- a/include/linux/major.h	2008-04-17 10:37:24.000000000 -0400
-+++ a/include/linux/major.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/major.h	2008-07-16 22:41:36.000000000 -0400
 @@ -15,6 +15,7 @@
  #define HD_MAJOR		IDE0_MAJOR
  #define PTY_SLAVE_MAJOR		3
@@ -9732,9 +9381,9 @@
  #define TTYAUX_MAJOR		5
  #define LP_MAJOR		6
  #define VCS_MAJOR		7
---- a/include/linux/mm_types.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/mm_types.h	2008-04-19 15:14:52.000000000 -0400
-@@ -201,6 +201,7 @@ struct mm_struct {
+--- a/include/linux/mm_types.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/linux/mm_types.h	2008-07-16 22:41:36.000000000 -0400
+@@ -205,6 +205,7 @@ struct mm_struct {
  
  	/* Architecture-specific MM context */
  	mm_context_t context;
@@ -9742,19 +9391,9 @@
  
  	/* Swap token stuff */
  	/*
---- a/include/linux/mount.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/mount.h	2008-04-19 15:45:19.000000000 -0400
-@@ -28,6 +28,9 @@ struct mnt_namespace;
- #define MNT_NOATIME	0x08
- #define MNT_NODIRATIME	0x10
- #define MNT_RELATIME	0x20
-+#define MNT_RDONLY	0x40
-+
-+#define MNT_IS_RDONLY(m)	((m) && ((m)->mnt_flags & MNT_RDONLY))
- 
- #define MNT_SHRINKABLE	0x100
- 
-@@ -35,6 +38,10 @@ struct mnt_namespace;
+--- a/include/linux/mount.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/linux/mount.h	2008-07-16 22:47:42.000000000 -0400
+@@ -37,6 +37,10 @@ struct mnt_namespace;
  #define MNT_UNBINDABLE	0x2000	/* if the vfsmount is a unbindable mount */
  #define MNT_PNODE_MASK	0x3000	/* propagation flag mask */
  
@@ -9765,17 +9404,17 @@
  struct vfsmount {
  	struct list_head mnt_hash;
  	struct vfsmount *mnt_parent;	/* fs we are mounted on */
-@@ -62,6 +69,7 @@ struct vfsmount {
- 	int mnt_expiry_mark;		/* true if marked for expiry */
- 	int mnt_pinned;
- 	int mnt_ghosts;
+@@ -71,6 +75,7 @@ struct vfsmount {
+ 	 * are held, and all mnt_writer[]s on this mount have 0 as their ->count
+ 	 */
+ 	atomic_t __mnt_writers;
 +	tag_t mnt_tag;			/* tagging used for vfsmount */
  };
  
  static inline struct vfsmount *mntget(struct vfsmount *mnt)
---- a/include/linux/net.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/net.h	2008-04-19 15:14:52.000000000 -0400
-@@ -65,6 +65,7 @@ typedef enum {
+--- a/include/linux/net.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/linux/net.h	2008-07-16 22:41:36.000000000 -0400
+@@ -66,6 +66,7 @@ typedef enum {
  #define SOCK_NOSPACE		2
  #define SOCK_PASSCRED		3
  #define SOCK_PASSSEC		4
@@ -9784,7 +9423,7 @@
  #ifndef ARCH_HAS_SOCKET_TYPES
  /**
 --- a/include/linux/nfs_mount.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/nfs_mount.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/nfs_mount.h	2008-07-16 22:41:36.000000000 -0400
 @@ -63,6 +63,7 @@ struct nfs_mount_data {
  #define NFS_MOUNT_SECFLAVOUR	0x2000	/* 5 */
  #define NFS_MOUNT_NORDIRPLUS	0x4000	/* 5 */
@@ -9795,7 +9434,7 @@
  
  #endif
 --- a/include/linux/nsproxy.h	2008-04-17 11:31:39.000000000 -0400
-+++ a/include/linux/nsproxy.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/nsproxy.h	2008-07-16 22:41:36.000000000 -0400
 @@ -3,6 +3,7 @@
  
  #include <linux/spinlock.h>
@@ -9844,8 +9483,8 @@
  }
  
  #ifdef CONFIG_CGROUP_NS
---- a/include/linux/pid.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/pid.h	2008-04-29 17:56:00.000000000 -0400
+--- a/include/linux/pid.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/linux/pid.h	2008-07-16 22:41:36.000000000 -0400
 @@ -8,7 +8,8 @@ enum pid_type
  	PIDTYPE_PID,
  	PIDTYPE_PGID,
@@ -9856,7 +9495,7 @@
  };
  
  /*
-@@ -142,6 +143,7 @@ static inline pid_t pid_nr(struct pid *p
+@@ -144,6 +145,7 @@ static inline pid_t pid_nr(struct pid *p
  }
  
  pid_t pid_nr_ns(struct pid *pid, struct pid_namespace *ns);
@@ -9864,8 +9503,8 @@
  pid_t pid_vnr(struct pid *pid);
  
  #define do_each_pid_task(pid, type, task)				\
---- a/include/linux/proc_fs.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/proc_fs.h	2008-04-19 15:44:54.000000000 -0400
+--- a/include/linux/proc_fs.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/linux/proc_fs.h	2008-07-16 22:41:36.000000000 -0400
 @@ -59,6 +59,7 @@ struct proc_dir_entry {
  	nlink_t nlink;
  	uid_t uid;
@@ -9874,7 +9513,7 @@
  	loff_t size;
  	const struct inode_operations *proc_iops;
  	/*
-@@ -265,16 +266,23 @@ static inline void kclist_add(struct kco
+@@ -274,16 +275,23 @@ static inline void kclist_add(struct kco
  extern void kclist_add(struct kcore_list *, void *, size_t);
  #endif
  
@@ -9898,20 +9537,21 @@
  	int fd;
  	union proc_op op;
  	struct proc_dir_entry *pde;
---- a/include/linux/reiserfs_fs.h	2008-05-21 14:30:05.000000000 -0400
-+++ a/include/linux/reiserfs_fs.h	2008-05-21 14:30:41.000000000 -0400
-@@ -837,6 +837,10 @@ struct stat_data_v1 {
+--- a/include/linux/reiserfs_fs.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/linux/reiserfs_fs.h	2008-07-16 22:41:36.000000000 -0400
+@@ -837,6 +837,11 @@ struct stat_data_v1 {
  #define REISERFS_COMPR_FL     FS_COMPR_FL
  #define REISERFS_NOTAIL_FL    FS_NOTAIL_FL
  
 +/* unfortunately reiserfs sdattr is only 16 bit */
++#define REISERFS_IXUNLINK_FL  (FS_IXUNLINK_FL >> 16)
 +#define REISERFS_BARRIER_FL   (FS_BARRIER_FL >> 16)
-+#define REISERFS_IUNLINK_FL   (FS_IUNLINK_FL >> 16)
++#define REISERFS_COW_FL       (FS_COW_FL >> 16)
 +
  /* persistent flags that file inherits from the parent directory */
  #define REISERFS_INHERIT_MASK ( REISERFS_IMMUTABLE_FL |	\
  				REISERFS_SYNC_FL |	\
-@@ -846,6 +850,9 @@ struct stat_data_v1 {
+@@ -846,6 +851,9 @@ struct stat_data_v1 {
  				REISERFS_COMPR_FL |	\
  				REISERFS_NOTAIL_FL )
  
@@ -9921,7 +9561,7 @@
  /* Stat Data on disk (reiserfs version of UFS disk inode minus the
     address blocks) */
  struct stat_data {
-@@ -1911,6 +1918,7 @@ static inline void reiserfs_update_sd(st
+@@ -1911,6 +1919,7 @@ static inline void reiserfs_update_sd(st
  void sd_attrs_to_i_attrs(__u16 sd_attrs, struct inode *inode);
  void i_attrs_to_sd_attrs(struct inode *inode, __u16 * sd_attrs);
  int reiserfs_setattr(struct dentry *dentry, struct iattr *attr);
@@ -9929,9 +9569,9 @@
  
  /* namei.c */
  void set_de_name_and_namelen(struct reiserfs_dir_entry *de);
---- a/include/linux/reiserfs_fs_sb.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/reiserfs_fs_sb.h	2008-04-19 15:14:52.000000000 -0400
-@@ -456,6 +456,7 @@ enum reiserfs_mount_options {
+--- a/include/linux/reiserfs_fs_sb.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/linux/reiserfs_fs_sb.h	2008-07-16 22:41:36.000000000 -0400
+@@ -455,6 +455,7 @@ enum reiserfs_mount_options {
  	REISERFS_POSIXACL,
  	REISERFS_BARRIER_NONE,
  	REISERFS_BARRIER_FLUSH,
@@ -9939,9 +9579,9 @@
  
  	/* Actions on error */
  	REISERFS_ERROR_PANIC,
---- a/include/linux/sched.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/sched.h	2008-04-21 11:09:01.000000000 -0400
-@@ -73,7 +73,6 @@ struct sched_param {
+--- a/include/linux/sched.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/linux/sched.h	2008-07-27 14:07:42.000000000 -0400
+@@ -71,7 +71,6 @@ struct sched_param {
  #include <linux/fs_struct.h>
  #include <linux/compiler.h>
  #include <linux/completion.h>
@@ -9949,7 +9589,7 @@
  #include <linux/percpu.h>
  #include <linux/topology.h>
  #include <linux/proportions.h>
-@@ -89,6 +88,7 @@ struct sched_param {
+@@ -87,6 +86,7 @@ struct sched_param {
  #include <linux/task_io_accounting.h>
  #include <linux/kobject.h>
  #include <linux/latencytop.h>
@@ -9995,7 +9635,7 @@
  #define get_mm_rss(mm)					\
  	(get_mm_counter(mm, file_rss) + get_mm_counter(mm, anon_rss))
  #define update_hiwater_rss(mm)	do {			\
-@@ -1162,6 +1164,14 @@ struct task_struct {
+@@ -1194,6 +1196,14 @@ struct task_struct {
  #endif
  	seccomp_t seccomp;
  
@@ -10010,7 +9650,7 @@
  /* Thread group tracking */
     	u32 parent_exec_id;
     	u32 self_exec_id;
-@@ -1350,6 +1360,11 @@ struct pid_namespace;
+@@ -1382,6 +1392,11 @@ struct pid_namespace;
   * see also pid_nr() etc in include/linux/pid.h
   */
  
@@ -10022,7 +9662,7 @@
  static inline pid_t task_pid_nr(struct task_struct *tsk)
  {
  	return tsk->pid;
-@@ -1359,7 +1374,7 @@ pid_t task_pid_nr_ns(struct task_struct 
+@@ -1391,7 +1406,7 @@ pid_t task_pid_nr_ns(struct task_struct 
  
  static inline pid_t task_pid_vnr(struct task_struct *tsk)
  {
@@ -10031,7 +9671,7 @@
  }
  
  
-@@ -1372,7 +1387,7 @@ pid_t task_tgid_nr_ns(struct task_struct
+@@ -1404,7 +1419,7 @@ pid_t task_tgid_nr_ns(struct task_struct
  
  static inline pid_t task_tgid_vnr(struct task_struct *tsk)
  {
@@ -10040,8 +9680,20 @@
  }
  
  
---- a/include/linux/shmem_fs.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/shmem_fs.h	2008-04-19 15:14:52.000000000 -0400
+@@ -1707,9 +1722,9 @@ extern struct pid_namespace init_pid_ns;
+ extern struct task_struct *find_task_by_pid_type_ns(int type, int pid,
+ 		struct pid_namespace *ns);
+ 
+-static inline struct task_struct *__deprecated find_task_by_pid(pid_t nr)
++static inline struct task_struct *__deprecated find_task_by_pid(pid_t nr, struct pid_namespace *ns)
+ {
+-	return find_task_by_pid_type_ns(PIDTYPE_PID, nr, &init_pid_ns);
++	return find_task_by_pid_type_ns(PIDTYPE_PID, nr, ns);
+ }
+ extern struct task_struct *find_task_by_vpid(pid_t nr);
+ extern struct task_struct *find_task_by_pid_ns(pid_t nr,
+--- a/include/linux/shmem_fs.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/linux/shmem_fs.h	2008-07-16 22:41:36.000000000 -0400
 @@ -8,6 +8,9 @@
  
  #define SHMEM_NR_DIRECT 16
@@ -10053,7 +9705,7 @@
  	spinlock_t		lock;
  	unsigned long		flags;
 --- a/include/linux/stat.h	2008-04-17 10:33:07.000000000 -0400
-+++ a/include/linux/stat.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/stat.h	2008-07-16 22:41:36.000000000 -0400
 @@ -66,6 +66,7 @@ struct kstat {
  	unsigned int	nlink;
  	uid_t		uid;
@@ -10062,18 +9714,18 @@
  	dev_t		rdev;
  	loff_t		size;
  	struct timespec  atime;
---- a/include/linux/sunrpc/auth.h	2008-04-17 10:37:24.000000000 -0400
-+++ a/include/linux/sunrpc/auth.h	2008-04-19 15:14:52.000000000 -0400
+--- a/include/linux/sunrpc/auth.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/linux/sunrpc/auth.h	2008-07-16 22:41:36.000000000 -0400
 @@ -25,6 +25,7 @@
  struct auth_cred {
  	uid_t	uid;
  	gid_t	gid;
 +	tag_t	tag;
  	struct group_info *group_info;
+ 	unsigned char machine_cred : 1;
  };
- 
---- a/include/linux/sunrpc/clnt.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/sunrpc/clnt.h	2008-04-19 15:14:52.000000000 -0400
+--- a/include/linux/sunrpc/clnt.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/linux/sunrpc/clnt.h	2008-07-16 22:41:36.000000000 -0400
 @@ -42,7 +42,8 @@ struct rpc_clnt {
  
  	unsigned int		cl_softrtry : 1,/* soft timeouts */
@@ -10084,9 +9736,9 @@
  
  	struct rpc_rtt *	cl_rtt;		/* RTO estimator data */
  	const struct rpc_timeout *cl_timeout;	/* Timeout strategy */
---- a/include/linux/syscalls.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/syscalls.h	2008-04-19 15:14:52.000000000 -0400
-@@ -294,6 +294,8 @@ asmlinkage long sys_symlink(const char _
+--- a/include/linux/syscalls.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/linux/syscalls.h	2008-07-16 22:41:36.000000000 -0400
+@@ -295,6 +295,8 @@ asmlinkage long sys_symlink(const char _
  asmlinkage long sys_unlink(const char __user *pathname);
  asmlinkage long sys_rename(const char __user *oldname,
  				const char __user *newname);
@@ -10095,8 +9747,8 @@
  asmlinkage long sys_chmod(const char __user *filename, mode_t mode);
  asmlinkage long sys_fchmod(unsigned int fd, mode_t mode);
  
---- a/include/linux/sysctl.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/sysctl.h	2008-04-19 15:14:52.000000000 -0400
+--- a/include/linux/sysctl.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/linux/sysctl.h	2008-07-16 22:41:36.000000000 -0400
 @@ -70,6 +70,7 @@ enum
  	CTL_ABI=9,		/* Binary emulation */
  	CTL_CPU=10,		/* CPU stuff (speed scaling, etc) */
@@ -10113,8 +9765,8 @@
  
  	KERN_SPARC_REBOOT=21,	/* reboot command on Sparc */
  	KERN_CTLALTDEL=22,	/* int: allow ctl-alt-del to reboot */
---- a/include/linux/sysfs.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/sysfs.h	2008-04-19 15:14:52.000000000 -0400
+--- a/include/linux/sysfs.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/linux/sysfs.h	2008-07-16 22:41:36.000000000 -0400
 @@ -17,6 +17,8 @@
  #include <linux/list.h>
  #include <asm/atomic.h>
@@ -10124,10 +9776,10 @@
  struct kobject;
  struct module;
  
---- a/include/linux/time.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/time.h	2008-04-19 15:14:52.000000000 -0400
-@@ -183,6 +183,9 @@ static inline void timespec_add_ns(struc
- 	}
+--- a/include/linux/time.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/linux/time.h	2008-07-16 22:41:36.000000000 -0400
+@@ -179,6 +179,9 @@ static __always_inline void timespec_add
+ 	a->tv_sec += __iter_div_u64_rem(a->tv_nsec + ns, NSEC_PER_SEC, &ns);
  	a->tv_nsec = ns;
  }
 +
@@ -10136,8 +9788,8 @@
  #endif /* __KERNEL__ */
  
  #define NFDBITS			__NFDBITS
---- a/include/linux/types.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/linux/types.h	2008-04-19 15:14:52.000000000 -0400
+--- a/include/linux/types.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/linux/types.h	2008-07-16 22:41:36.000000000 -0400
 @@ -36,6 +36,9 @@ typedef __kernel_uid32_t	uid_t;
  typedef __kernel_gid32_t	gid_t;
  typedef __kernel_uid16_t        uid16_t;
@@ -10149,7 +9801,7 @@
  typedef unsigned long		uintptr_t;
  
 --- a/include/linux/vroot.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vroot.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vroot.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,51 @@
 +
 +/*
@@ -10203,7 +9855,7 @@
 +
 +#endif /* _LINUX_VROOT_H */
 --- a/include/linux/vs_base.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vs_base.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vs_base.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,10 @@
 +#ifndef _VS_BASE_H
 +#define _VS_BASE_H
@@ -10216,7 +9868,7 @@
 +#warning duplicate inclusion
 +#endif
 --- a/include/linux/vs_context.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vs_context.h	2008-04-29 18:42:09.000000000 -0400
++++ a/include/linux/vs_context.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,227 @@
 +#ifndef _VS_CONTEXT_H
 +#define _VS_CONTEXT_H
@@ -10446,8 +10098,8 @@
 +#warning duplicate inclusion
 +#endif
 --- a/include/linux/vs_cowbl.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vs_cowbl.h	2008-04-21 13:49:51.000000000 -0400
-@@ -0,0 +1,44 @@
++++ a/include/linux/vs_cowbl.h	2008-07-16 22:41:36.000000000 -0400
+@@ -0,0 +1,47 @@
 +#ifndef _VS_COWBL_H
 +#define _VS_COWBL_H
 +
@@ -10461,8 +10113,11 @@
 +{
 +	struct inode *inode = nd->path.dentry->d_inode;
 +	int error = 0;
-+	if (IS_RDONLY(inode) || MNT_IS_RDONLY(nd->path.mnt))
++
++	/* do we need this check? */
++	if (IS_RDONLY(inode))
 +		return -EROFS;
++
 +	if (IS_COW(inode)) {
 +		if (IS_COW_LINK(inode)) {
 +			struct dentry *new_dentry, *old_dentry = nd->path.dentry;
@@ -10481,7 +10136,7 @@
 +			} else
 +				error = PTR_ERR(new_dentry);
 +		} else {
-+			inode->i_flags &= ~(S_IUNLINK | S_IMMUTABLE);
++			inode->i_flags &= ~(S_IXUNLINK | S_IMMUTABLE);
 +			inode->i_ctime = CURRENT_TIME;
 +			mark_inode_dirty(inode);
 +		}
@@ -10493,7 +10148,7 @@
 +#warning duplicate inclusion
 +#endif
 --- a/include/linux/vs_cvirt.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vs_cvirt.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vs_cvirt.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,50 @@
 +#ifndef _VS_CVIRT_H
 +#define _VS_CVIRT_H
@@ -10546,7 +10201,7 @@
 +#warning duplicate inclusion
 +#endif
 --- a/include/linux/vs_device.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vs_device.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vs_device.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,45 @@
 +#ifndef _VS_DEVICE_H
 +#define _VS_DEVICE_H
@@ -10594,7 +10249,7 @@
 +#warning duplicate inclusion
 +#endif
 --- a/include/linux/vs_dlimit.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vs_dlimit.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vs_dlimit.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,211 @@
 +#ifndef _VS_DLIMIT_H
 +#define _VS_DLIMIT_H
@@ -10808,7 +10463,7 @@
 +#warning duplicate inclusion
 +#endif
 --- a/include/linux/vserver/base.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/base.h	2008-04-23 20:52:31.000000000 -0400
++++ a/include/linux/vserver/base.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,157 @@
 +#ifndef _VX_BASE_H
 +#define _VX_BASE_H
@@ -10968,7 +10623,7 @@
 +
 +#endif
 --- a/include/linux/vserver/cacct_cmd.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/cacct_cmd.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/cacct_cmd.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,23 @@
 +#ifndef _VX_CACCT_CMD_H
 +#define _VX_CACCT_CMD_H
@@ -10994,7 +10649,7 @@
 +#endif	/* __KERNEL__ */
 +#endif	/* _VX_CACCT_CMD_H */
 --- a/include/linux/vserver/cacct_def.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/cacct_def.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/cacct_def.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,43 @@
 +#ifndef _VX_CACCT_DEF_H
 +#define _VX_CACCT_DEF_H
@@ -11040,7 +10695,7 @@
 +
 +#endif	/* _VX_CACCT_DEF_H */
 --- a/include/linux/vserver/cacct.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/cacct.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/cacct.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,15 @@
 +#ifndef _VX_CACCT_H
 +#define _VX_CACCT_H
@@ -11058,7 +10713,7 @@
 +
 +#endif	/* _VX_CACCT_H */
 --- a/include/linux/vserver/cacct_int.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/cacct_int.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/cacct_int.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,21 @@
 +#ifndef _VX_CACCT_INT_H
 +#define _VX_CACCT_INT_H
@@ -11082,7 +10737,7 @@
 +#endif	/* __KERNEL__ */
 +#endif	/* _VX_CACCT_INT_H */
 --- a/include/linux/vserver/check.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/check.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/check.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,89 @@
 +#ifndef _VS_CHECK_H
 +#define _VS_CHECK_H
@@ -11174,7 +10829,7 @@
 +
 +#endif
 --- a/include/linux/vserver/context_cmd.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/context_cmd.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/context_cmd.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,128 @@
 +#ifndef _VX_CONTEXT_CMD_H
 +#define _VX_CONTEXT_CMD_H
@@ -11305,7 +10960,7 @@
 +#endif	/* __KERNEL__ */
 +#endif	/* _VX_CONTEXT_CMD_H */
 --- a/include/linux/vserver/context.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/context.h	2008-04-22 15:14:28.000000000 -0400
++++ a/include/linux/vserver/context.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,176 @@
 +#ifndef _VX_CONTEXT_H
 +#define _VX_CONTEXT_H
@@ -11484,7 +11139,7 @@
 +#endif	/* __KERNEL__ */
 +#endif	/* _VX_CONTEXT_H */
 --- a/include/linux/vserver/cvirt_cmd.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/cvirt_cmd.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/cvirt_cmd.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,53 @@
 +#ifndef _VX_CVIRT_CMD_H
 +#define _VX_CVIRT_CMD_H
@@ -11540,7 +11195,7 @@
 +#endif	/* __KERNEL__ */
 +#endif	/* _VX_CVIRT_CMD_H */
 --- a/include/linux/vserver/cvirt_def.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/cvirt_def.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/cvirt_def.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,80 @@
 +#ifndef _VX_CVIRT_DEF_H
 +#define _VX_CVIRT_DEF_H
@@ -11623,7 +11278,7 @@
 +
 +#endif	/* _VX_CVIRT_DEF_H */
 --- a/include/linux/vserver/cvirt.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/cvirt.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/cvirt.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,20 @@
 +#ifndef _VX_CVIRT_H
 +#define _VX_CVIRT_H
@@ -11646,7 +11301,7 @@
 +#endif	/* __KERNEL__ */
 +#endif	/* _VX_CVIRT_H */
 --- a/include/linux/vserver/debug_cmd.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/debug_cmd.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/debug_cmd.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,58 @@
 +#ifndef _VX_DEBUG_CMD_H
 +#define _VX_DEBUG_CMD_H
@@ -11707,7 +11362,7 @@
 +#endif	/* __KERNEL__ */
 +#endif	/* _VX_DEBUG_CMD_H */
 --- a/include/linux/vserver/debug.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/debug.h	2008-04-21 13:55:14.000000000 -0400
++++ a/include/linux/vserver/debug.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,130 @@
 +#ifndef _VX_DEBUG_H
 +#define _VX_DEBUG_H
@@ -11840,7 +11495,7 @@
 +
 +#endif /* _VX_DEBUG_H */
 --- a/include/linux/vserver/device_cmd.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/device_cmd.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/device_cmd.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,44 @@
 +#ifndef _VX_DEVICE_CMD_H
 +#define _VX_DEVICE_CMD_H
@@ -11887,7 +11542,7 @@
 +#endif	/* __KERNEL__ */
 +#endif	/* _VX_DEVICE_CMD_H */
 --- a/include/linux/vserver/device_def.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/device_def.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/device_def.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,17 @@
 +#ifndef _VX_DEVICE_DEF_H
 +#define _VX_DEVICE_DEF_H
@@ -11907,7 +11562,7 @@
 +
 +#endif	/* _VX_DEVICE_DEF_H */
 --- a/include/linux/vserver/device.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/device.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/device.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,15 @@
 +#ifndef _VX_DEVICE_H
 +#define _VX_DEVICE_H
@@ -11925,7 +11580,7 @@
 +#warning duplicate inclusion
 +#endif	/* _VX_DEVICE_H */
 --- a/include/linux/vserver/dlimit_cmd.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/dlimit_cmd.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/dlimit_cmd.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,74 @@
 +#ifndef _VX_DLIMIT_CMD_H
 +#define _VX_DLIMIT_CMD_H
@@ -12002,7 +11657,7 @@
 +#endif	/* __KERNEL__ */
 +#endif	/* _VX_DLIMIT_CMD_H */
 --- a/include/linux/vserver/dlimit.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/dlimit.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/dlimit.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,54 @@
 +#ifndef _VX_DLIMIT_H
 +#define _VX_DLIMIT_H
@@ -12059,7 +11714,7 @@
 +#warning duplicate inclusion
 +#endif	/* _VX_DLIMIT_H */
 --- a/include/linux/vserver/global.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/global.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/global.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,20 @@
 +#ifndef _VX_GLOBAL_H
 +#define _VX_GLOBAL_H
@@ -12082,7 +11737,7 @@
 +
 +#endif /* _VX_GLOBAL_H */
 --- a/include/linux/vserver/history.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/history.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/history.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,197 @@
 +#ifndef _VX_HISTORY_H
 +#define _VX_HISTORY_H
@@ -12282,7 +11937,7 @@
 +
 +#endif /* _VX_HISTORY_H */
 --- a/include/linux/vserver/inode_cmd.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/inode_cmd.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/inode_cmd.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,59 @@
 +#ifndef _VX_INODE_CMD_H
 +#define _VX_INODE_CMD_H
@@ -12344,7 +11999,7 @@
 +#endif	/* __KERNEL__ */
 +#endif	/* _VX_INODE_CMD_H */
 --- a/include/linux/vserver/inode.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/inode.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/inode.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,38 @@
 +#ifndef _VX_INODE_H
 +#define _VX_INODE_H
@@ -12358,7 +12013,7 @@
 +#define IATTR_FLAGS	0x00000007
 +
 +#define IATTR_BARRIER	0x00010000
-+#define IATTR_IUNLINK	0x00020000
++#define IATTR_IXUNLINK	0x00020000
 +#define IATTR_IMMUTABLE 0x00040000
 +
 +#ifdef	__KERNEL__
@@ -12384,19 +12039,8 @@
 +#else	/* _VX_INODE_H */
 +#warning duplicate inclusion
 +#endif	/* _VX_INODE_H */
---- a/include/linux/vserver/Kbuild	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/Kbuild	2008-04-19 15:14:52.000000000 -0400
-@@ -0,0 +1,8 @@
-+
-+unifdef-y += context_cmd.h network_cmd.h space_cmd.h \
-+	cacct_cmd.h cvirt_cmd.h limit_cmd.h dlimit_cmd.h \
-+	inode_cmd.h tag_cmd.h sched_cmd.h signal_cmd.h \
-+	debug_cmd.h device_cmd.h
-+
-+unifdef-y += switch.h network.h monitor.h inode.h device.h
-+
 --- a/include/linux/vserver/limit_cmd.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/limit_cmd.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/limit_cmd.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,69 @@
 +#ifndef _VX_LIMIT_CMD_H
 +#define _VX_LIMIT_CMD_H
@@ -12468,7 +12112,7 @@
 +#endif	/* __KERNEL__ */
 +#endif	/* _VX_LIMIT_CMD_H */
 --- a/include/linux/vserver/limit_def.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/limit_def.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/limit_def.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,47 @@
 +#ifndef _VX_LIMIT_DEF_H
 +#define _VX_LIMIT_DEF_H
@@ -12518,7 +12162,7 @@
 +
 +#endif	/* _VX_LIMIT_DEF_H */
 --- a/include/linux/vserver/limit.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/limit.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/limit.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,70 @@
 +#ifndef _VX_LIMIT_H
 +#define _VX_LIMIT_H
@@ -12591,7 +12235,7 @@
 +#endif	/* __KERNEL__ */
 +#endif	/* _VX_LIMIT_H */
 --- a/include/linux/vserver/limit_int.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/limit_int.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/limit_int.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,198 @@
 +#ifndef _VX_LIMIT_INT_H
 +#define _VX_LIMIT_INT_H
@@ -12792,7 +12436,7 @@
 +#endif	/* __KERNEL__ */
 +#endif	/* _VX_LIMIT_INT_H */
 --- a/include/linux/vserver/monitor.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/monitor.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/monitor.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,96 @@
 +#ifndef _VX_MONITOR_H
 +#define _VX_MONITOR_H
@@ -12891,7 +12535,7 @@
 +
 +#endif /* _VX_MONITOR_H */
 --- a/include/linux/vserver/network_cmd.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/network_cmd.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/network_cmd.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,150 @@
 +#ifndef _VX_NETWORK_CMD_H
 +#define _VX_NETWORK_CMD_H
@@ -13044,7 +12688,7 @@
 +#endif	/* __KERNEL__ */
 +#endif	/* _VX_CONTEXT_CMD_H */
 --- a/include/linux/vserver/network.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/network.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/network.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,146 @@
 +#ifndef _VX_NETWORK_H
 +#define _VX_NETWORK_H
@@ -13193,7 +12837,7 @@
 +#endif	/* __KERNEL__ */
 +#endif	/* _VX_NETWORK_H */
 --- a/include/linux/vserver/percpu.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/percpu.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/percpu.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,14 @@
 +#ifndef _VX_PERCPU_H
 +#define _VX_PERCPU_H
@@ -13210,7 +12854,7 @@
 +
 +#endif	/* _VX_PERCPU_H */
 --- a/include/linux/vserver/pid.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/pid.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/pid.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,51 @@
 +#ifndef _VSERVER_PID_H
 +#define _VSERVER_PID_H
@@ -13264,7 +12908,7 @@
 +
 +#endif
 --- a/include/linux/vserver/sched_cmd.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/sched_cmd.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/sched_cmd.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,108 @@
 +#ifndef _VX_SCHED_CMD_H
 +#define _VX_SCHED_CMD_H
@@ -13375,7 +13019,7 @@
 +#endif	/* __KERNEL__ */
 +#endif	/* _VX_SCHED_CMD_H */
 --- a/include/linux/vserver/sched_def.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/sched_def.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/sched_def.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,68 @@
 +#ifndef _VX_SCHED_DEF_H
 +#define _VX_SCHED_DEF_H
@@ -13446,7 +13090,7 @@
 +
 +#endif	/* _VX_SCHED_DEF_H */
 --- a/include/linux/vserver/sched.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/sched.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/sched.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,26 @@
 +#ifndef _VX_SCHED_H
 +#define _VX_SCHED_H
@@ -13475,7 +13119,7 @@
 +#warning duplicate inclusion
 +#endif	/* _VX_SCHED_H */
 --- a/include/linux/vserver/signal_cmd.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/signal_cmd.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/signal_cmd.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,43 @@
 +#ifndef _VX_SIGNAL_CMD_H
 +#define _VX_SIGNAL_CMD_H
@@ -13521,7 +13165,7 @@
 +#endif	/* __KERNEL__ */
 +#endif	/* _VX_SIGNAL_CMD_H */
 --- a/include/linux/vserver/signal.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/signal.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/signal.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,14 @@
 +#ifndef _VX_SIGNAL_H
 +#define _VX_SIGNAL_H
@@ -13538,8 +13182,8 @@
 +#warning duplicate inclusion
 +#endif	/* _VX_SIGNAL_H */
 --- a/include/linux/vserver/space_cmd.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/space_cmd.h	2008-04-19 15:14:52.000000000 -0400
-@@ -0,0 +1,26 @@
++++ a/include/linux/vserver/space_cmd.h	2008-07-16 22:41:36.000000000 -0400
+@@ -0,0 +1,29 @@
 +#ifndef _VX_SPACE_CMD_H
 +#define _VX_SPACE_CMD_H
 +
@@ -13550,7 +13194,10 @@
 +#define VCMD_set_space_v0	VC_CMD(PROCALT, 3, 0)
 +#define VCMD_set_space		VC_CMD(PROCALT, 3, 1)
 +
-+#define VCMD_get_space_mask	VC_CMD(PROCALT, 4, 0)
++#define VCMD_get_space_mask_v0	VC_CMD(PROCALT, 4, 0)
++
++#define VCMD_get_space_mask	VC_CMD(VSPACE, 0, 1)
++#define VCMD_get_space_default	VC_CMD(VSPACE, 1, 0)
 +
 +
 +struct	vcmd_space_mask {
@@ -13562,12 +13209,12 @@
 +
 +extern int vc_enter_space(struct vx_info *, void __user *);
 +extern int vc_set_space(struct vx_info *, void __user *);
-+extern int vc_get_space_mask(struct vx_info *, void __user *);
++extern int vc_get_space_mask(void __user *, int);
 +
 +#endif	/* __KERNEL__ */
 +#endif	/* _VX_SPACE_CMD_H */
 --- a/include/linux/vserver/space.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/space.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/space.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,13 @@
 +#ifndef _VX_SPACE_H
 +#define _VX_SPACE_H
@@ -13583,8 +13230,8 @@
 +#warning duplicate inclusion
 +#endif	/* _VX_SPACE_H */
 --- a/include/linux/vserver/switch.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/switch.h	2008-04-19 15:14:52.000000000 -0400
-@@ -0,0 +1,99 @@
++++ a/include/linux/vserver/switch.h	2008-07-16 22:41:36.000000000 -0400
+@@ -0,0 +1,100 @@
 +#ifndef _VX_SWITCH_H
 +#define _VX_SWITCH_H
 +
@@ -13624,7 +13271,7 @@
 +  OTHER  |VSTAT  |       |       |       |       |       | |VINFO  |       |
 +	 |     40|     41|     42|     43|     44|     45| |     46|     47|
 +  =======+=======+=======+=======+=======+=======+=======+ +=======+=======+
-+  SPECIAL|EVENT  |       |       |       |FLAGS  |       | |       |       |
++  SPECIAL|EVENT  |       |       |       |FLAGS  |       | |VSPACE |       |
 +	 |     48|     49|     50|     51|     52|     53| |     54|     55|
 +  -------+-------+-------+-------+-------+-------+-------+ +-------+-------+
 +  SPECIAL|DEBUG  |       |       |       |RLIMIT |SYSCALL| |       |COMPAT |
@@ -13662,6 +13309,7 @@
 +#define VC_CAT_EVENT		48
 +
 +#define VC_CAT_FLAGS		52
++#define VC_CAT_VSPACE		54
 +#define VC_CAT_DEBUG		56
 +#define VC_CAT_RLIMIT		60
 +
@@ -13685,7 +13333,7 @@
 +
 +#endif	/* _VX_SWITCH_H */
 --- a/include/linux/vserver/tag_cmd.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/tag_cmd.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vserver/tag_cmd.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,22 @@
 +#ifndef _VX_TAG_CMD_H
 +#define _VX_TAG_CMD_H
@@ -13710,7 +13358,7 @@
 +#endif	/* __KERNEL__ */
 +#endif	/* _VX_TAG_CMD_H */
 --- a/include/linux/vserver/tag.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vserver/tag.h	2008-04-21 13:53:47.000000000 -0400
++++ a/include/linux/vserver/tag.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,143 @@
 +#ifndef _DX_TAG_H
 +#define _DX_TAG_H
@@ -13856,7 +13504,7 @@
 +
 +#endif /* _DX_TAG_H */
 --- a/include/linux/vs_inet6.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vs_inet6.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vs_inet6.h	2008-07-29 18:12:38.000000000 -0400
 @@ -0,0 +1,229 @@
 +#ifndef _VS_INET6_H
 +#define _VS_INET6_H
@@ -14088,7 +13736,7 @@
 +#warning duplicate inclusion
 +#endif
 --- a/include/linux/vs_inet.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vs_inet.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vs_inet.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,342 @@
 +#ifndef _VS_INET_H
 +#define _VS_INET_H
@@ -14433,7 +14081,7 @@
 +// #warning duplicate inclusion
 +#endif
 --- a/include/linux/vs_limit.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vs_limit.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vs_limit.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,140 @@
 +#ifndef _VS_LIMIT_H
 +#define _VS_LIMIT_H
@@ -14576,7 +14224,7 @@
 +#warning duplicate inclusion
 +#endif
 --- a/include/linux/vs_memory.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vs_memory.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vs_memory.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,159 @@
 +#ifndef _VS_MEMORY_H
 +#define _VS_MEMORY_H
@@ -14738,7 +14386,7 @@
 +#warning duplicate inclusion
 +#endif
 --- a/include/linux/vs_network.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vs_network.h	2008-04-29 18:42:49.000000000 -0400
++++ a/include/linux/vs_network.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,169 @@
 +#ifndef _NX_VS_NETWORK_H
 +#define _NX_VS_NETWORK_H
@@ -14910,7 +14558,7 @@
 +#warning duplicate inclusion
 +#endif
 --- a/include/linux/vs_pid.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vs_pid.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vs_pid.h	2008-07-27 14:11:13.000000000 -0400
 @@ -0,0 +1,95 @@
 +#ifndef _VS_PID_H
 +#define _VS_PID_H
@@ -14939,7 +14587,7 @@
 +	return 1;
 +}
 +
-+#define find_task_by_real_pid find_task_by_pid
++#define find_task_by_real_pid(pid) find_task_by_pid(pid, &init_pid_ns)
 +
 +#if 0
 +
@@ -15008,7 +14656,7 @@
 +#warning duplicate inclusion
 +#endif
 --- a/include/linux/vs_sched.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vs_sched.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vs_sched.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,110 @@
 +#ifndef _VS_SCHED_H
 +#define _VS_SCHED_H
@@ -15121,7 +14769,7 @@
 +#warning duplicate inclusion
 +#endif
 --- a/include/linux/vs_socket.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vs_socket.h	2008-04-23 14:32:00.000000000 -0400
++++ a/include/linux/vs_socket.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,67 @@
 +#ifndef _VS_SOCKET_H
 +#define _VS_SOCKET_H
@@ -15191,7 +14839,7 @@
 +#warning duplicate inclusion
 +#endif
 --- a/include/linux/vs_tag.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vs_tag.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vs_tag.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,43 @@
 +#ifndef _VS_TAG_H
 +#define _VS_TAG_H
@@ -15237,7 +14885,7 @@
 +#warning duplicate inclusion
 +#endif
 --- a/include/linux/vs_time.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/include/linux/vs_time.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/linux/vs_time.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,19 @@
 +#ifndef _VS_TIME_H
 +#define _VS_TIME_H
@@ -15258,17 +14906,12 @@
 +#else
 +#warning duplicate inclusion
 +#endif
---- a/include/net/addrconf.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/net/addrconf.h	2008-04-19 15:14:52.000000000 -0400
-@@ -75,10 +75,12 @@ extern struct inet6_ifaddr      *ipv6_ge
- 
- extern int			ipv6_get_saddr(struct dst_entry *dst, 
- 					       struct in6_addr *daddr,
--					       struct in6_addr *saddr);
-+					       struct in6_addr *saddr,
-+					       struct nx_info *nxi);
+--- a/include/net/addrconf.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/net/addrconf.h	2008-07-29 18:14:29.000000000 -0400
+@@ -83,7 +83,8 @@ extern struct inet6_ifaddr      *ipv6_ge
  extern int			ipv6_dev_get_saddr(struct net_device *dev, 
- 					       struct in6_addr *daddr,
+ 					       const struct in6_addr *daddr,
+ 					       unsigned int srcprefs,
 -					       struct in6_addr *saddr);
 +					       struct in6_addr *saddr,
 +					       struct nx_info *nxi);
@@ -15276,7 +14919,7 @@
  						struct in6_addr *addr,
  						unsigned char banned_flags);
 --- a/include/net/af_unix.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/net/af_unix.h	2008-04-19 15:14:52.000000000 -0400
++++ a/include/net/af_unix.h	2008-07-16 22:41:36.000000000 -0400
 @@ -4,6 +4,7 @@
  #include <linux/socket.h>
  #include <linux/un.h>
@@ -15285,8 +14928,8 @@
  #include <net/sock.h>
  
  extern void unix_inflight(struct file *fp);
---- a/include/net/inet_sock.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/net/inet_sock.h	2008-04-19 15:14:52.000000000 -0400
+--- a/include/net/inet_sock.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/net/inet_sock.h	2008-07-16 22:46:02.000000000 -0400
 @@ -24,7 +24,7 @@
  #include <net/flow.h>
  #include <net/sock.h>
@@ -15296,18 +14939,20 @@
  
  /** struct ip_options - IP Options
   *
-@@ -193,9 +193,4 @@ static inline int inet_sk_ehashfn(const 
+@@ -192,11 +192,6 @@ static inline int inet_sk_ehashfn(const 
  }
  
  
 -static inline int inet_iif(const struct sk_buff *skb)
 -{
--	return ((struct rtable *)skb->dst)->rt_iif;
+-	return skb->rtable->rt_iif;
 -}
 -
- #endif	/* _INET_SOCK_H */
---- a/include/net/inet_timewait_sock.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/net/inet_timewait_sock.h	2008-04-19 15:25:34.000000000 -0400
+ static inline struct request_sock *inet_reqsk_alloc(struct request_sock_ops *ops)
+ {
+ 	struct request_sock *req = reqsk_alloc(ops);
+--- a/include/net/inet_timewait_sock.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/net/inet_timewait_sock.h	2008-07-16 22:41:36.000000000 -0400
 @@ -15,15 +15,14 @@
  #ifndef _INET_TIMEWAIT_SOCK_
  #define _INET_TIMEWAIT_SOCK_
@@ -15337,30 +14982,29 @@
  	int			tw_timeout;
  	volatile unsigned char	tw_substate;
  	/* 3 bits hole, try to pack */
---- a/include/net/route.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/net/route.h	2008-04-21 12:39:35.000000000 -0400
-@@ -34,7 +34,7 @@
- #include <linux/ip.h>
- #include <linux/cache.h>
- #include <linux/security.h>
--#include <net/sock.h>
-+#include <linux/in.h>
- 
- #ifndef __KERNEL__
- #warning This file is not supposed to be used outside of kernel.
-@@ -86,6 +86,11 @@ struct ip_rt_acct
+--- a/include/net/route.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/net/route.h	2008-07-16 22:46:26.000000000 -0400
+@@ -28,6 +28,7 @@
+ #include <net/inetpeer.h>
+ #include <net/flow.h>
+ #include <net/sock.h>
++// #include <linux/in.h>
+ #include <linux/in_route.h>
+ #include <linux/rtnetlink.h>
+ #include <linux/route.h>
+@@ -85,6 +86,11 @@ struct ip_rt_acct
  	__u32 	i_packets;
  };
  
 +static inline int inet_iif(const struct sk_buff *skb)
 +{
-+	return ((struct rtable *)skb->dst)->rt_iif;
++	return skb->rtable->rt_iif;
 +}
 +
  struct rt_cache_stat 
  {
          unsigned int in_hit;
-@@ -136,6 +141,9 @@ static inline void ip_rt_put(struct rtab
+@@ -135,6 +141,9 @@ static inline void ip_rt_put(struct rtab
  		dst_release(&rt->u.dst);
  }
  
@@ -15370,7 +15014,7 @@
  #define IPTOS_RT_MASK	(IPTOS_TOS_MASK & ~3)
  
  extern const __u8 ip_tos2prio[16];
-@@ -145,6 +153,9 @@ static inline char rt_tos2priority(u8 to
+@@ -144,6 +153,9 @@ static inline char rt_tos2priority(u8 to
  	return ip_tos2prio[IPTOS_TOS(tos)>>1];
  }
  
@@ -15380,10 +15024,10 @@
  static inline int ip_route_connect(struct rtable **rp, __be32 dst,
  				   __be32 src, u32 tos, int oif, u8 protocol,
  				   __be16 sport, __be16 dport, struct sock *sk,
-@@ -162,7 +173,21 @@ static inline int ip_route_connect(struc
+@@ -161,7 +173,21 @@ static inline int ip_route_connect(struc
  
  	int err;
- 	struct net *net = sk->sk_net;
+ 	struct net *net = sock_net(sk);
 -	if (!dst || !src) {
 +	struct nx_info *nx_info = current->nx_info;
 +
@@ -15403,12 +15047,12 @@
  		err = __ip_route_output_key(net, rp, &fl);
  		if (err)
  			return err;
---- a/include/net/sock.h	2008-04-17 12:05:44.000000000 -0400
-+++ a/include/net/sock.h	2008-04-19 15:14:52.000000000 -0400
-@@ -123,6 +123,10 @@ struct sock_common {
- 	unsigned int		skc_hash;
- 	struct proto		*skc_prot;
+--- a/include/net/sock.h	2008-07-14 17:22:55.000000000 -0400
++++ a/include/net/sock.h	2008-07-16 22:47:02.000000000 -0400
+@@ -128,6 +128,10 @@ struct sock_common {
+ #ifdef CONFIG_NET_NS
  	struct net	 	*skc_net;
+ #endif
 +	xid_t			skc_xid;
 +	struct vx_info		*skc_vx_info;
 +	nid_t			skc_nid;
@@ -15416,7 +15060,7 @@
  };
  
  /**
-@@ -205,6 +209,10 @@ struct sock {
+@@ -211,6 +215,10 @@ struct sock {
  #define sk_hash			__sk_common.skc_hash
  #define sk_prot			__sk_common.skc_prot
  #define sk_net			__sk_common.skc_net
@@ -15427,17 +15071,17 @@
  	unsigned char		sk_shutdown : 2,
  				sk_no_check : 2,
  				sk_userlocks : 4;
---- a/init/main.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/init/main.c	2008-04-21 10:46:10.000000000 -0400
-@@ -58,6 +58,7 @@
- #include <linux/kthread.h>
+--- a/init/main.c	2008-07-14 17:22:55.000000000 -0400
++++ a/init/main.c	2008-07-17 21:10:23.000000000 -0400
+@@ -60,6 +60,7 @@
  #include <linux/sched.h>
  #include <linux/signal.h>
+ #include <linux/idr.h>
 +#include <linux/vserver/percpu.h>
  
  #include <asm/io.h>
  #include <asm/bugs.h>
-@@ -370,12 +371,14 @@ EXPORT_SYMBOL(__per_cpu_offset);
+@@ -393,12 +394,14 @@ EXPORT_SYMBOL(__per_cpu_offset);
  
  static void __init setup_per_cpu_areas(void)
  {
@@ -15454,8 +15098,8 @@
  	ptr = alloc_bootmem_pages(size * nr_possible_cpus);
  
  	for_each_possible_cpu(i) {
---- a/ipc/mqueue.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/ipc/mqueue.c	2008-04-19 15:14:52.000000000 -0400
+--- a/ipc/mqueue.c	2008-07-14 17:22:55.000000000 -0400
++++ a/ipc/mqueue.c	2008-07-16 22:41:36.000000000 -0400
 @@ -31,6 +31,8 @@
  #include <linux/mutex.h>
  #include <linux/nsproxy.h>
@@ -15532,18 +15176,9 @@
  		free_uid(user);
  	}
  }
-@@ -743,7 +756,7 @@ asmlinkage long sys_mq_unlink(const char
- 	if (inode)
- 		atomic_inc(&inode->i_count);
- 
--	err = vfs_unlink(dentry->d_parent->d_inode, dentry);
-+	err = vfs_unlink(dentry->d_parent->d_inode, dentry, NULL);
- out_err:
- 	dput(dentry);
- 
---- a/ipc/msg.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/ipc/msg.c	2008-04-21 10:41:47.000000000 -0400
-@@ -37,6 +37,7 @@
+--- a/ipc/msg.c	2008-07-14 17:22:55.000000000 -0400
++++ a/ipc/msg.c	2008-07-16 22:41:36.000000000 -0400
+@@ -38,6 +38,7 @@
  #include <linux/rwsem.h>
  #include <linux/nsproxy.h>
  #include <linux/ipc_namespace.h>
@@ -15551,7 +15186,7 @@
  
  #include <asm/current.h>
  #include <asm/uaccess.h>
-@@ -168,6 +169,7 @@ static int newque(struct ipc_namespace *
+@@ -190,6 +191,7 @@ static int newque(struct ipc_namespace *
  
  	msq->q_perm.mode = msgflg & S_IRWXUGO;
  	msq->q_perm.key = key;
@@ -15559,8 +15194,8 @@
  
  	msq->q_perm.security = NULL;
  	retval = security_msg_queue_alloc(msq);
---- a/ipc/namespace.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/ipc/namespace.c	2008-04-21 10:44:58.000000000 -0400
+--- a/ipc/namespace.c	2008-07-14 17:22:55.000000000 -0400
++++ a/ipc/namespace.c	2008-07-16 22:41:36.000000000 -0400
 @@ -9,6 +9,8 @@
  #include <linux/rcupdate.h>
  #include <linux/nsproxy.h>
@@ -15570,23 +15205,24 @@
  
  #include "util.h"
  
-@@ -25,6 +27,7 @@ static struct ipc_namespace *clone_ipc_n
- 	shm_init_ns(ns);
+@@ -35,6 +37,7 @@ static struct ipc_namespace *clone_ipc_n
+ 	register_ipcns_notifier(ns);
  
  	kref_init(&ns->kref);
 +	atomic_inc(&vs_global_ipc_ns);
  	return ns;
  }
  
-@@ -82,5 +85,6 @@ void free_ipc_ns(struct kref *kref)
+@@ -101,6 +104,7 @@ void free_ipc_ns(struct kref *kref)
  	sem_exit_ns(ns);
  	msg_exit_ns(ns);
  	shm_exit_ns(ns);
 +	atomic_dec(&vs_global_ipc_ns);
  	kfree(ns);
- }
---- a/ipc/sem.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/ipc/sem.c	2008-04-21 10:45:22.000000000 -0400
+ 	atomic_dec(&nr_ipc_ns);
+ 
+--- a/ipc/sem.c	2008-07-14 17:22:55.000000000 -0400
++++ a/ipc/sem.c	2008-07-16 22:41:36.000000000 -0400
 @@ -83,6 +83,8 @@
  #include <linux/rwsem.h>
  #include <linux/nsproxy.h>
@@ -15596,7 +15232,7 @@
  
  #include <asm/uaccess.h>
  #include "util.h"
-@@ -252,6 +254,7 @@ static int newary(struct ipc_namespace *
+@@ -255,6 +257,7 @@ static int newary(struct ipc_namespace *
  
  	sma->sem_perm.mode = (semflg & S_IRWXUGO);
  	sma->sem_perm.key = key;
@@ -15604,7 +15240,7 @@
  
  	sma->sem_perm.security = NULL;
  	retval = security_sem_alloc(sma);
-@@ -267,6 +270,9 @@ static int newary(struct ipc_namespace *
+@@ -270,6 +273,9 @@ static int newary(struct ipc_namespace *
  		return id;
  	}
  	ns->used_sems += nsems;
@@ -15612,10 +15248,10 @@
 +	vx_semary_inc(sma);
 +	vx_nsems_add(sma, nsems);
  
- 	sma->sem_perm.id = sem_buildid(id, sma->sem_perm.seq);
  	sma->sem_base = (struct sem *) &sma[1];
---- a/ipc/shm.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/ipc/shm.c	2008-04-21 10:45:38.000000000 -0400
+ 	/* sma->sem_pending = NULL; */
+--- a/ipc/shm.c	2008-07-14 17:22:55.000000000 -0400
++++ a/ipc/shm.c	2008-07-16 22:41:36.000000000 -0400
 @@ -39,6 +39,8 @@
  #include <linux/nsproxy.h>
  #include <linux/mount.h>
@@ -15625,7 +15261,7 @@
  
  #include <asm/uaccess.h>
  
-@@ -202,7 +204,12 @@ static void shm_open(struct vm_area_stru
+@@ -183,7 +185,12 @@ static void shm_open(struct vm_area_stru
   */
  static void shm_destroy(struct ipc_namespace *ns, struct shmid_kernel *shp)
  {
@@ -15639,7 +15275,7 @@
  	shm_rmid(ns, shp);
  	shm_unlock(shp);
  	if (!is_file_hugepages(shp->shm_file))
-@@ -212,6 +219,7 @@ static void shm_destroy(struct ipc_names
+@@ -193,6 +200,7 @@ static void shm_destroy(struct ipc_names
  						shp->mlock_user);
  	fput (shp->shm_file);
  	security_shm_free(shp);
@@ -15647,7 +15283,7 @@
  	ipc_rcu_putref(shp);
  }
  
-@@ -383,11 +391,15 @@ static int newseg(struct ipc_namespace *
+@@ -362,11 +370,15 @@ static int newseg(struct ipc_namespace *
  	if (ns->shm_tot + numpages > ns->shm_ctlall)
  		return -ENOSPC;
  
@@ -15663,7 +15299,7 @@
  	shp->shm_perm.mode = (shmflg & S_IRWXUGO);
  	shp->mlock_user = NULL;
  
-@@ -441,6 +453,7 @@ static int newseg(struct ipc_namespace *
+@@ -419,6 +431,7 @@ static int newseg(struct ipc_namespace *
  	ns->shm_tot += numpages;
  	error = shp->shm_perm.id;
  	shm_unlock(shp);
@@ -15671,8 +15307,8 @@
  	return error;
  
  no_id:
---- a/kernel/capability.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/capability.c	2008-04-19 15:14:52.000000000 -0400
+--- a/kernel/capability.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/capability.c	2008-07-16 22:41:36.000000000 -0400
 @@ -13,6 +13,7 @@
  #include <linux/security.h>
  #include <linux/syscalls.h>
@@ -15681,7 +15317,7 @@
  #include <asm/uaccess.h>
  
  /*
-@@ -171,6 +172,8 @@ static inline int cap_set_pg(int pgrp_nr
+@@ -241,6 +242,8 @@ static inline int cap_set_pg(int pgrp_nr
  
  	pgrp = find_vpid(pgrp_nr);
  	do_each_pid_task(pgrp, PIDTYPE_PGID, g) {
@@ -15690,7 +15326,7 @@
  		target = g;
  		while_each_thread(g, target) {
  			if (!security_capset_check(target, effective,
-@@ -335,8 +338,12 @@ int __capable(struct task_struct *t, int
+@@ -391,8 +394,12 @@ int __capable(struct task_struct *t, int
  	return 0;
  }
  
@@ -15703,20 +15339,9 @@
  	return __capable(current, cap);
  }
  EXPORT_SYMBOL(capable);
---- a/kernel/cgroup.c	2008-05-21 14:30:05.000000000 -0400
-+++ a/kernel/cgroup.c	2008-05-21 14:30:41.000000000 -0400
-@@ -2833,7 +2833,7 @@ int cgroup_clone(struct task_struct *tsk
- 	}
- 
- 	/* Create the cgroup directory, which also creates the cgroup */
--	ret = vfs_mkdir(inode, dentry, S_IFDIR | 0755);
-+	ret = vfs_mkdir(inode, dentry, S_IFDIR | 0755, NULL);
- 	child = __d_cgrp(dentry);
- 	dput(dentry);
- 	if (ret) {
---- a/kernel/compat.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/compat.c	2008-04-19 15:14:52.000000000 -0400
-@@ -846,7 +846,7 @@ asmlinkage long compat_sys_time(compat_t
+--- a/kernel/compat.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/compat.c	2008-07-16 22:41:36.000000000 -0400
+@@ -845,7 +845,7 @@ asmlinkage long compat_sys_time(compat_t
  	compat_time_t i;
  	struct timeval tv;
  
@@ -15725,7 +15350,7 @@
  	i = tv.tv_sec;
  
  	if (tloc) {
-@@ -870,7 +870,7 @@ asmlinkage long compat_sys_stime(compat_
+@@ -869,7 +869,7 @@ asmlinkage long compat_sys_stime(compat_
  	if (err)
  		return err;
  
@@ -15734,9 +15359,9 @@
  	return 0;
  }
  
---- a/kernel/exit.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/exit.c	2008-04-19 15:14:52.000000000 -0400
-@@ -44,6 +44,11 @@
+--- a/kernel/exit.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/exit.c	2008-08-13 20:37:36.000000000 -0400
+@@ -45,6 +45,11 @@
  #include <linux/resource.h>
  #include <linux/blkdev.h>
  #include <linux/task_io_accounting_ops.h>
@@ -15748,7 +15373,7 @@
  
  #include <asm/uaccess.h>
  #include <asm/unistd.h>
-@@ -468,9 +473,11 @@ static void close_files(struct files_str
+@@ -477,9 +482,11 @@ static void close_files(struct files_str
  					filp_close(file, files);
  					cond_resched();
  				}
@@ -15760,7 +15385,15 @@
  		}
  	}
  }
-@@ -1014,6 +1021,10 @@ NORET_TYPE void do_exit(long code)
+@@ -548,6 +555,7 @@ void put_fs_struct(struct fs_struct *fs)
+ 		path_put(&fs->pwd);
+ 		if (fs->altroot.dentry)
+ 			path_put(&fs->altroot);
++		atomic_dec(&vs_global_fs);
+ 		kmem_cache_free(fs_cachep, fs);
+ 	}
+ }
+@@ -1090,6 +1098,10 @@ NORET_TYPE void do_exit(long code)
  	if (tsk->splice_pipe)
  		__free_pipe_info(tsk->splice_pipe);
  
@@ -15771,9 +15404,9 @@
  	preempt_disable();
  	/* causes final put_task_struct in finish_task_switch(). */
  	tsk->state = TASK_DEAD;
---- a/kernel/fork.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/fork.c	2008-04-21 11:09:01.000000000 -0400
-@@ -53,6 +53,11 @@
+--- a/kernel/fork.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/fork.c	2008-07-16 22:41:36.000000000 -0400
+@@ -54,6 +54,11 @@
  #include <linux/tty.h>
  #include <linux/proc_fs.h>
  #include <linux/blkdev.h>
@@ -15785,7 +15418,7 @@
  
  #include <asm/pgtable.h>
  #include <asm/pgalloc.h>
-@@ -113,6 +118,8 @@ void free_task(struct task_struct *tsk)
+@@ -114,6 +119,8 @@ void free_task(struct task_struct *tsk)
  	prop_local_destroy_single(&tsk->dirties);
  	free_thread_info(tsk->stack);
  	rt_mutex_debug_task_free(tsk);
@@ -15794,7 +15427,7 @@
  	free_task_struct(tsk);
  }
  EXPORT_SYMBOL(free_task);
-@@ -229,6 +236,8 @@ static int dup_mmap(struct mm_struct *mm
+@@ -253,6 +260,8 @@ static int dup_mmap(struct mm_struct *mm
  	mm->free_area_cache = oldmm->mmap_base;
  	mm->cached_hole_size = ~0UL;
  	mm->map_count = 0;
@@ -15803,7 +15436,7 @@
  	cpus_clear(mm->cpu_vm_mask);
  	mm->mm_rb = RB_ROOT;
  	rb_link = &mm->mm_rb.rb_node;
-@@ -240,7 +249,7 @@ static int dup_mmap(struct mm_struct *mm
+@@ -264,7 +273,7 @@ static int dup_mmap(struct mm_struct *mm
  
  		if (mpnt->vm_flags & VM_DONTCOPY) {
  			long pages = vma_pages(mpnt);
@@ -15812,7 +15445,7 @@
  			vm_stat_account(mm, mpnt->vm_flags, mpnt->vm_file,
  								-pages);
  			continue;
-@@ -351,8 +360,8 @@ static struct mm_struct * mm_init(struct
+@@ -375,8 +384,8 @@ static struct mm_struct * mm_init(struct
  				  : MMF_DUMP_FILTER_DEFAULT;
  	mm->core_waiters = 0;
  	mm->nr_ptes = 0;
@@ -15823,7 +15456,7 @@
  	spin_lock_init(&mm->page_table_lock);
  	rwlock_init(&mm->ioctx_list_lock);
  	mm->ioctx_list = NULL;
-@@ -362,6 +371,7 @@ static struct mm_struct * mm_init(struct
+@@ -386,6 +395,7 @@ static struct mm_struct * mm_init(struct
  
  	if (likely(!mm_alloc_pgd(mm))) {
  		mm->def_flags = 0;
@@ -15831,7 +15464,7 @@
  		return mm;
  	}
  
-@@ -395,6 +405,7 @@ void __mmdrop(struct mm_struct *mm)
+@@ -418,6 +428,7 @@ void __mmdrop(struct mm_struct *mm)
  	BUG_ON(mm == &init_mm);
  	mm_free_pgd(mm);
  	destroy_context(mm);
@@ -15839,7 +15472,7 @@
  	free_mm(mm);
  }
  EXPORT_SYMBOL_GPL(__mmdrop);
-@@ -511,6 +522,7 @@ static struct mm_struct *dup_mm(struct t
+@@ -534,6 +545,7 @@ struct mm_struct *dup_mm(struct task_str
  		goto fail_nomem;
  
  	memcpy(mm, oldmm, sizeof(*mm));
@@ -15847,7 +15480,7 @@
  
  	/* Initializing for Swap token stuff */
  	mm->token_priority = 0;
-@@ -542,6 +554,7 @@ fail_nocontext:
+@@ -567,6 +579,7 @@ fail_nocontext:
  	 * If init_new_context() failed, we cannot use mmput() to free the mm
  	 * because it calls destroy_context()
  	 */
@@ -15855,7 +15488,7 @@
  	mm_free_pgd(mm);
  	free_mm(mm);
  	return NULL;
-@@ -612,6 +625,7 @@ static struct fs_struct *__copy_fs_struc
+@@ -637,6 +650,7 @@ static struct fs_struct *__copy_fs_struc
  			fs->altroot.dentry = NULL;
  		}
  		read_unlock(&old->lock);
@@ -15863,16 +15496,7 @@
  	}
  	return fs;
  }
-@@ -730,6 +744,8 @@ static struct files_struct *dup_fd(struc
- 		struct file *f = *old_fds++;
- 		if (f) {
- 			get_file(f);
-+			/* TODO: sum it first for check and performance */
-+			vx_openfd_inc(open_files - i);
- 		} else {
- 			/*
- 			 * The fd may be claimed in the fd bitmap but not yet
-@@ -1011,6 +1027,8 @@ static struct task_struct *copy_process(
+@@ -879,6 +893,8 @@ static struct task_struct *copy_process(
  	int retval;
  	struct task_struct *p;
  	int cgroup_callbacks_done = 0;
@@ -15881,7 +15505,7 @@
  
  	if ((clone_flags & (CLONE_NEWNS|CLONE_FS)) == (CLONE_NEWNS|CLONE_FS))
  		return ERR_PTR(-EINVAL);
-@@ -1045,12 +1063,28 @@ static struct task_struct *copy_process(
+@@ -913,12 +929,28 @@ static struct task_struct *copy_process(
  	DEBUG_LOCKS_WARN_ON(!p->hardirqs_enabled);
  	DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled);
  #endif
@@ -15911,7 +15535,7 @@
  	}
  
  	atomic_inc(&p->user->__count);
-@@ -1352,6 +1386,18 @@ static struct task_struct *copy_process(
+@@ -1220,6 +1252,18 @@ static struct task_struct *copy_process(
  
  	total_forks++;
  	spin_unlock(&current->sighand->siglock);
@@ -15930,7 +15554,7 @@
  	write_unlock_irq(&tasklist_lock);
  	proc_fork_connector(p);
  	cgroup_post_fork(p);
-@@ -1398,6 +1444,9 @@ bad_fork_cleanup_count:
+@@ -1266,6 +1310,9 @@ bad_fork_cleanup_count:
  	put_group_info(p->group_info);
  	atomic_dec(&p->user->processes);
  	free_uid(p->user);
@@ -15940,38 +15564,37 @@
  bad_fork_free:
  	free_task(p);
  fork_out:
---- a/kernel/kthread.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/kthread.c	2008-04-19 15:14:52.000000000 -0400
+--- a/kernel/kthread.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/kthread.c	2008-07-27 14:11:48.000000000 -0400
 @@ -13,6 +13,7 @@
  #include <linux/file.h>
  #include <linux/module.h>
  #include <linux/mutex.h>
 +#include <linux/vs_pid.h>
- #include <asm/semaphore.h>
  
  #define KTHREAD_NICE_LEVEL (-5)
-@@ -99,7 +100,7 @@ static void create_kthread(struct kthrea
+ 
+@@ -98,7 +99,7 @@ static void create_kthread(struct kthrea
  		struct sched_param param = { .sched_priority = 0 };
  		wait_for_completion(&create->started);
  		read_lock(&tasklist_lock);
--		create->result = find_task_by_pid(pid);
+-		create->result = find_task_by_pid_ns(pid, &init_pid_ns);
 +		create->result = find_task_by_real_pid(pid);
  		read_unlock(&tasklist_lock);
  		/*
  		 * root may have changed our (kthreadd's) priority or CPU mask.
---- a/kernel/Makefile	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/Makefile	2008-04-19 15:14:52.000000000 -0400
-@@ -11,6 +11,8 @@ obj-y     = sched.o fork.o exec_domain.o
- 	    hrtimer.o rwsem.o nsproxy.o srcu.o \
- 	    notifier.o ksysfs.o pm_qos_params.o
+--- a/kernel/Makefile	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/Makefile	2008-07-27 12:40:25.000000000 -0400
+@@ -11,6 +11,7 @@ obj-y     = sched.o fork.o exec_domain.o
+ 	    hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o \
+ 	    notifier.o ksysfs.o pm_qos_params.o sched_clock.o
  
 +obj-y += vserver/
-+
- obj-$(CONFIG_SYSCTL) += sysctl_check.o
+ obj-$(CONFIG_SYSCTL_SYSCALL_CHECK) += sysctl_check.o
  obj-$(CONFIG_STACKTRACE) += stacktrace.o
  obj-y += time/
---- a/kernel/nsproxy.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/nsproxy.c	2008-04-19 15:14:52.000000000 -0400
+--- a/kernel/nsproxy.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/nsproxy.c	2008-07-16 22:41:36.000000000 -0400
 @@ -20,6 +20,8 @@
  #include <linux/mnt_namespace.h>
  #include <linux/utsname.h>
@@ -16104,7 +15727,7 @@
  	if (!old_ns)
  		return 0;
  
-@@ -155,6 +198,9 @@ int copy_namespaces(unsigned long flags,
+@@ -167,6 +210,9 @@ int copy_namespaces(unsigned long flags,
  
  out:
  	put_nsproxy(old_ns);
@@ -16114,15 +15737,18 @@
  	return err;
  }
  
-@@ -171,6 +217,7 @@ void free_nsproxy(struct nsproxy *ns)
+@@ -182,7 +228,9 @@ void free_nsproxy(struct nsproxy *ns)
+ 		put_pid_ns(ns->pid_ns);
  	if (ns->user_ns)
  		put_user_ns(ns->user_ns);
- 	put_net(ns->net_ns);
+-	put_net(ns->net_ns);
++	if (ns->net_ns)
++		put_net(ns->net_ns);
 +	atomic_dec(&vs_global_nsproxy);
  	kmem_cache_free(nsproxy_cachep, ns);
  }
  
-@@ -183,6 +230,10 @@ int unshare_nsproxy_namespaces(unsigned 
+@@ -195,6 +243,10 @@ int unshare_nsproxy_namespaces(unsigned 
  {
  	int err = 0;
  
@@ -16133,8 +15759,8 @@
  	if (!(unshare_flags & (CLONE_NEWNS | CLONE_NEWUTS | CLONE_NEWIPC |
  			       CLONE_NEWUSER | CLONE_NEWNET)))
  		return 0;
---- a/kernel/pid.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/pid.c	2008-04-29 17:56:00.000000000 -0400
+--- a/kernel/pid.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/pid.c	2008-07-16 22:41:36.000000000 -0400
 @@ -35,6 +35,8 @@
  #include <linux/pid_namespace.h>
  #include <linux/init_task.h>
@@ -16144,7 +15770,7 @@
  
  #define pid_hashfn(nr, ns)	\
  	hash_long((unsigned long)nr + (unsigned long)ns, pidhash_shift)
-@@ -303,7 +305,7 @@ EXPORT_SYMBOL_GPL(find_pid_ns);
+@@ -304,7 +306,7 @@ EXPORT_SYMBOL_GPL(find_pid_ns);
  
  struct pid *find_vpid(int nr)
  {
@@ -16153,7 +15779,7 @@
  }
  EXPORT_SYMBOL_GPL(find_vpid);
  
-@@ -359,6 +361,9 @@ void transfer_pid(struct task_struct *ol
+@@ -370,6 +372,9 @@ void transfer_pid(struct task_struct *ol
  struct task_struct *pid_task(struct pid *pid, enum pid_type type)
  {
  	struct task_struct *result = NULL;
@@ -16163,7 +15789,7 @@
  	if (pid) {
  		struct hlist_node *first;
  		first = rcu_dereference(pid->tasks[type].first);
-@@ -388,14 +393,14 @@ EXPORT_SYMBOL(find_task_by_pid);
+@@ -393,14 +398,14 @@ EXPORT_SYMBOL(find_task_by_pid_type_ns);
  
  struct task_struct *find_task_by_vpid(pid_t vnr)
  {
@@ -16180,7 +15806,7 @@
  }
  EXPORT_SYMBOL(find_task_by_pid_ns);
  
-@@ -430,7 +435,7 @@ struct pid *find_get_pid(pid_t nr)
+@@ -435,7 +440,7 @@ struct pid *find_get_pid(pid_t nr)
  	return pid;
  }
  
@@ -16189,7 +15815,7 @@
  {
  	struct upid *upid;
  	pid_t nr = 0;
-@@ -443,6 +448,11 @@ pid_t pid_nr_ns(struct pid *pid, struct 
+@@ -448,6 +453,11 @@ pid_t pid_nr_ns(struct pid *pid, struct 
  	return nr;
  }
  
@@ -16201,8 +15827,8 @@
  pid_t pid_vnr(struct pid *pid)
  {
  	return pid_nr_ns(pid, current->nsproxy->pid_ns);
---- a/kernel/pid_namespace.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/pid_namespace.c	2008-04-23 11:52:08.000000000 -0400
+--- a/kernel/pid_namespace.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/pid_namespace.c	2008-07-16 22:41:36.000000000 -0400
 @@ -12,6 +12,7 @@
  #include <linux/pid_namespace.h>
  #include <linux/syscalls.h>
@@ -16227,9 +15853,9 @@
  	kmem_cache_free(pid_ns_cachep, ns);
  }
  
---- a/kernel/posix-timers.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/posix-timers.c	2008-04-19 15:14:52.000000000 -0400
-@@ -47,6 +47,7 @@
+--- a/kernel/posix-timers.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/posix-timers.c	2008-07-27 12:57:35.000000000 -0400
+@@ -46,6 +46,7 @@
  #include <linux/wait.h>
  #include <linux/workqueue.h>
  #include <linux/module.h>
@@ -16237,7 +15863,7 @@
  
  /*
   * Management arrays for POSIX timers.	 Timers are kept in slab memory
-@@ -299,6 +300,12 @@ void do_schedule_next_timer(struct sigin
+@@ -298,6 +299,12 @@ void do_schedule_next_timer(struct sigin
  
  int posix_timer_event(struct k_itimer *timr,int si_private)
  {
@@ -16250,28 +15876,26 @@
  	memset(&timr->sigq->info, 0, sizeof(siginfo_t));
  	timr->sigq->info.si_sys_private = si_private;
  	/* Send signal to the process that owns this timer.*/
-@@ -311,11 +318,11 @@ int posix_timer_event(struct k_itimer *t
+@@ -310,10 +317,11 @@ int posix_timer_event(struct k_itimer *t
  
  	if (timr->it_sigev_notify & SIGEV_THREAD_ID) {
  		struct task_struct *leader;
--		int ret = send_sigqueue(timr->it_sigev_signo, timr->sigq,
--					timr->it_process);
+-		int ret = send_sigqueue(timr->sigq, timr->it_process, 0);
++
++		ret = send_sigqueue(timr->sigq, timr->it_process, 0);
  
-+		ret = send_sigqueue(timr->it_sigev_signo, timr->sigq,
-+				    timr->it_process);
  		if (likely(ret >= 0))
 -			return ret;
 +			goto out;
  
  		timr->it_sigev_notify = SIGEV_SIGNAL;
  		leader = timr->it_process->group_leader;
-@@ -323,8 +330,12 @@ int posix_timer_event(struct k_itimer *t
+@@ -321,7 +329,11 @@ int posix_timer_event(struct k_itimer *t
  		timr->it_process = leader;
  	}
  
--	return send_group_sigqueue(timr->it_sigev_signo, timr->sigq,
-+	ret = send_group_sigqueue(timr->it_sigev_signo, timr->sigq,
- 				   timr->it_process);
+-	return send_sigqueue(timr->sigq, timr->it_process, 1);
++	ret = send_sigqueue(timr->sigq, timr->it_process, 1);
 +out:
 +	leave_vx_info(&vxis);
 +	put_vx_info(vxi);
@@ -16279,8 +15903,8 @@
  }
  EXPORT_SYMBOL_GPL(posix_timer_event);
  
---- a/kernel/printk.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/printk.c	2008-04-21 10:59:28.000000000 -0400
+--- a/kernel/printk.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/printk.c	2008-07-16 22:41:36.000000000 -0400
 @@ -32,6 +32,7 @@
  #include <linux/security.h>
  #include <linux/bootmem.h>
@@ -16289,7 +15913,7 @@
  
  #include <asm/uaccess.h>
  
-@@ -297,18 +298,13 @@ int do_syslog(int type, char __user *buf
+@@ -300,18 +301,13 @@ int do_syslog(int type, char __user *buf
  	unsigned i, j, limit, count;
  	int do_clear = 0;
  	char c;
@@ -16310,7 +15934,7 @@
  		error = -EINVAL;
  		if (!buf || len < 0)
  			goto out;
-@@ -319,6 +315,16 @@ int do_syslog(int type, char __user *buf
+@@ -322,6 +318,16 @@ int do_syslog(int type, char __user *buf
  			error = -EFAULT;
  			goto out;
  		}
@@ -16327,7 +15951,7 @@
  		error = wait_event_interruptible(log_wait,
  							(log_start - log_end));
  		if (error)
-@@ -343,16 +349,6 @@ int do_syslog(int type, char __user *buf
+@@ -346,16 +352,6 @@ int do_syslog(int type, char __user *buf
  		do_clear = 1;
  		/* FALL THRU */
  	case 3:		/* Read last kernel messages */
@@ -16344,8 +15968,8 @@
  		count = len;
  		if (count > log_buf_len)
  			count = log_buf_len;
---- a/kernel/ptrace.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/ptrace.c	2008-04-21 10:50:28.000000000 -0400
+--- a/kernel/ptrace.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/ptrace.c	2008-07-16 22:41:36.000000000 -0400
 @@ -21,6 +21,7 @@
  #include <linux/audit.h>
  #include <linux/pid_namespace.h>
@@ -16366,7 +15990,7 @@
  
  	return security_ptrace(current, task);
  }
-@@ -562,6 +568,10 @@ asmlinkage long sys_ptrace(long request,
+@@ -556,6 +562,10 @@ asmlinkage long sys_ptrace(long request,
  		goto out;
  	}
  
@@ -16377,18 +16001,18 @@
  	if (request == PTRACE_ATTACH) {
  		ret = ptrace_attach(child);
  		/*
---- a/kernel/sched.c	2008-05-21 14:30:05.000000000 -0400
-+++ a/kernel/sched.c	2008-05-21 14:30:41.000000000 -0400
-@@ -66,6 +66,8 @@
- #include <linux/unistd.h>
- #include <linux/pagemap.h>
- #include <linux/hrtimer.h>
+--- a/kernel/sched.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/sched.c	2008-07-17 21:13:30.000000000 -0400
+@@ -70,6 +70,8 @@
+ #include <linux/bootmem.h>
+ #include <linux/debugfs.h>
+ #include <linux/ctype.h>
 +#include <linux/vs_sched.h>
 +#include <linux/vs_cvirt.h>
  
  #include <asm/tlb.h>
  #include <asm/irq_regs.h>
-@@ -375,6 +377,16 @@ struct root_domain {
+@@ -461,6 +463,16 @@ struct root_domain {
  static struct root_domain def_root_domain;
  
  #endif
@@ -16405,7 +16029,7 @@
  
  /*
   * This is the main, per-CPU runqueue data structure.
-@@ -1366,6 +1378,7 @@ static void set_load_weight(struct task_
+@@ -1546,6 +1558,7 @@ static void set_load_weight(struct task_
  
  static void enqueue_task(struct rq *rq, struct task_struct *p, int wakeup)
  {
@@ -16413,7 +16037,7 @@
  	sched_info_queued(p);
  	p->sched_class->enqueue_task(rq, p, wakeup);
  	p->se.on_rq = 1;
-@@ -1556,6 +1569,9 @@ struct migration_req {
+@@ -1736,6 +1749,9 @@ struct migration_req {
  	struct completion done;
  };
  
@@ -16423,7 +16047,7 @@
  /*
   * The task's runqueue lock must be held.
   * Returns true if you have to wait for migration thread.
-@@ -1565,6 +1581,7 @@ migrate_task(struct task_struct *p, int 
+@@ -1745,6 +1761,7 @@ migrate_task(struct task_struct *p, int 
  {
  	struct rq *rq = task_rq(p);
  
@@ -16431,7 +16055,7 @@
  	/*
  	 * If the task is not on a runqueue (and not running), then
  	 * it is sufficient to simply update the task's cpu field.
-@@ -1926,6 +1943,12 @@ static int try_to_wake_up(struct task_st
+@@ -2109,6 +2126,12 @@ static int try_to_wake_up(struct task_st
  		/* might preempt at this point */
  		rq = task_rq_lock(p, &flags);
  		old_state = p->state;
@@ -16444,7 +16068,7 @@
  		if (!(old_state & state))
  			goto out;
  		if (p->se.on_rq)
-@@ -3697,13 +3720,16 @@ unsigned long long task_sched_runtime(st
+@@ -3885,13 +3908,16 @@ unsigned long long task_sched_runtime(st
  void account_user_time(struct task_struct *p, cputime_t cputime)
  {
  	struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;
@@ -16462,7 +16086,7 @@
  		cpustat->nice = cputime64_add(cpustat->nice, tmp);
  	else
  		cpustat->user = cputime64_add(cpustat->user, tmp);
-@@ -3748,6 +3774,7 @@ void account_system_time(struct task_str
+@@ -3936,6 +3962,7 @@ void account_system_time(struct task_str
  			 cputime_t cputime)
  {
  	struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;
@@ -16470,15 +16094,15 @@
  	struct rq *rq = this_rq();
  	cputime64_t tmp;
  
-@@ -3755,6 +3782,7 @@ void account_system_time(struct task_str
- 		return account_guest_time(p, cputime);
+@@ -3945,6 +3972,7 @@ void account_system_time(struct task_str
+ 	}
  
  	p->stime = cputime_add(p->stime, cputime);
 +	vx_account_system(vxi, cputime, (p == rq->idle));
  
  	/* Add system time to cpustat. */
  	tmp = cputime_to_cputime64(cputime);
-@@ -4500,7 +4528,7 @@ asmlinkage long sys_nice(int increment)
+@@ -4656,7 +4684,7 @@ asmlinkage long sys_nice(int increment)
  		nice = 19;
  
  	if (increment < 0 && !can_nice(current, nice))
@@ -16487,18 +16111,19 @@
  
  	retval = security_task_setnice(current, nice);
  	if (retval)
---- a/kernel/sched_fair.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/sched_fair.c	2008-04-19 15:14:52.000000000 -0400
-@@ -537,6 +537,8 @@ enqueue_entity(struct cfs_rq *cfs_rq, st
+--- a/kernel/sched_fair.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/sched_fair.c	2008-07-17 21:17:35.000000000 -0400
+@@ -637,6 +637,9 @@ enqueue_entity(struct cfs_rq *cfs_rq, st
  	check_spread(cfs_rq, se);
  	if (se != cfs_rq->curr)
  		__enqueue_entity(cfs_rq, se);
++
 +	if (entity_is_task(se))
 +		vx_activate_task(task_of(se));
- 	account_entity_enqueue(cfs_rq, se);
  }
  
-@@ -580,6 +582,8 @@ dequeue_entity(struct cfs_rq *cfs_rq, st
+ static void update_avg(u64 *avg, u64 sample)
+@@ -679,6 +682,8 @@ dequeue_entity(struct cfs_rq *cfs_rq, st
  
  	if (se != cfs_rq->curr)
  		__dequeue_entity(cfs_rq, se);
@@ -16508,7 +16133,7 @@
  }
  
 --- a/kernel/sched_hard.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/sched_hard.h	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/sched_hard.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,324 @@
 +
 +#ifdef CONFIG_VSERVER_IDLELIMIT
@@ -16835,7 +16460,7 @@
 +#endif /* CONFIG_VSERVER_HARDCPU */
 +
 --- a/kernel/sched_mon.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/sched_mon.h	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/sched_mon.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,200 @@
 +
 +#include <linux/vserver/monitor.h>
@@ -17037,8 +16662,8 @@
 +
 +#endif /* CONFIG_VSERVER_MONITOR */
 +
---- a/kernel/signal.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/signal.c	2008-05-15 15:41:03.000000000 -0400
+--- a/kernel/signal.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/signal.c	2008-07-17 21:15:33.000000000 -0400
 @@ -26,6 +26,8 @@
  #include <linux/freezer.h>
  #include <linux/pid_namespace.h>
@@ -17048,9 +16673,9 @@
  
  #include <asm/param.h>
  #include <asm/uaccess.h>
-@@ -530,6 +532,14 @@ static int check_kill_permission(int sig
+@@ -573,6 +575,14 @@ static int check_kill_permission(int sig
  	if (!valid_signal(sig))
- 		return error;
+ 		return -EINVAL;
  
 +	if ((info != SEND_SIG_NOINFO) &&
 +		(is_si_special(info) || !SI_FROMUSER(info)))
@@ -17060,11 +16685,11 @@
 +		"check_kill_permission(%d,%p,%p[#%u,%u])",
 +		sig, info, t, vx_task_xid(t), t->pid);
 +
- 	if (info == SEND_SIG_NOINFO || (!is_si_special(info) && SI_FROMUSER(info))) {
- 		error = audit_signal_info(sig, t); /* Let audit system see the signal */
- 		if (error)
-@@ -543,6 +553,18 @@ static int check_kill_permission(int sig
- 		return error;
+ 	if (info != SEND_SIG_NOINFO && (is_si_special(info) || SI_FROMKERNEL(info)))
+ 		return 0;
+ 
+@@ -597,6 +607,18 @@ static int check_kill_permission(int sig
+ 		}
  	}
  
 +	error = -EPERM;
@@ -17082,7 +16707,16 @@
  	return security_task_kill(t, info, sig, 0);
  }
  
-@@ -1088,7 +1110,7 @@ int kill_pid_info_as_uid(int sig, struct
+@@ -1055,7 +1077,7 @@ int kill_pid_info(int sig, struct siginf
+ 	rcu_read_lock();
+ retry:
+ 	p = pid_task(pid, PIDTYPE_PID);
+-	if (p) {
++	if (p && vx_check(vx_task_xid(p), VS_WATCH | VS_IDENT)) {
+ 		error = group_send_sig_info(sig, info, p);
+ 		if (unlikely(error == -ESRCH))
+ 			/*
+@@ -1093,7 +1115,7 @@ int kill_pid_info_as_uid(int sig, struct
  
  	read_lock(&tasklist_lock);
  	p = pid_task(pid, PIDTYPE_PID);
@@ -17091,7 +16725,7 @@
  		ret = -ESRCH;
  		goto out_unlock;
  	}
-@@ -1140,7 +1162,9 @@ static int kill_something_info(int sig, 
+@@ -1145,7 +1167,9 @@ static int kill_something_info(int sig, 
  		struct task_struct * p;
  
  		for_each_process(p) {
@@ -17102,8 +16736,8 @@
  				int err = group_send_sig_info(sig, info, p);
  				++count;
  				if (err != -EPERM)
-@@ -1842,6 +1866,11 @@ relock:
- 		if (is_global_init(current))
+@@ -1809,6 +1833,11 @@ relock:
+ 		    !signal_group_exit(signal))
  			continue;
  
 +		/* virtual init is protected against user signals */
@@ -17114,8 +16748,8 @@
  		if (sig_kernel_stop(signr)) {
  			/*
  			 * The default action is to stop all threads in
---- a/kernel/softirq.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/softirq.c	2008-04-19 15:14:52.000000000 -0400
+--- a/kernel/softirq.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/softirq.c	2008-07-16 22:41:36.000000000 -0400
 @@ -21,6 +21,7 @@
  #include <linux/rcupdate.h>
  #include <linux/smp.h>
@@ -17124,8 +16758,8 @@
  
  #include <asm/irq.h>
  /*
---- a/kernel/sys.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/sys.c	2008-04-19 15:14:52.000000000 -0400
+--- a/kernel/sys.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/sys.c	2008-07-16 22:41:36.000000000 -0400
 @@ -38,6 +38,7 @@
  #include <linux/syscalls.h>
  #include <linux/kprobes.h>
@@ -17134,7 +16768,7 @@
  
  #include <asm/uaccess.h>
  #include <asm/io.h>
-@@ -116,7 +117,10 @@ static int set_one_prio(struct task_stru
+@@ -122,7 +123,10 @@ static int set_one_prio(struct task_stru
  		goto out;
  	}
  	if (niceval < task_nice(p) && !can_nice(p, niceval)) {
@@ -17146,7 +16780,7 @@
  		goto out;
  	}
  	no_nice = security_task_setnice(p, niceval);
-@@ -164,6 +168,8 @@ asmlinkage long sys_setpriority(int whic
+@@ -170,6 +174,8 @@ asmlinkage long sys_setpriority(int whic
  			else
  				pgrp = task_pgrp(current);
  			do_each_pid_task(pgrp, PIDTYPE_PGID, p) {
@@ -17155,7 +16789,7 @@
  				error = set_one_prio(p, niceval, error);
  			} while_each_pid_task(pgrp, PIDTYPE_PGID, p);
  			break;
-@@ -224,6 +230,8 @@ asmlinkage long sys_getpriority(int whic
+@@ -230,6 +236,8 @@ asmlinkage long sys_getpriority(int whic
  			else
  				pgrp = task_pgrp(current);
  			do_each_pid_task(pgrp, PIDTYPE_PGID, p) {
@@ -17164,7 +16798,7 @@
  				niceval = 20 - task_nice(p);
  				if (niceval > retval)
  					retval = niceval;
-@@ -353,6 +361,9 @@ void kernel_power_off(void)
+@@ -359,6 +367,9 @@ void kernel_power_off(void)
  	machine_power_off();
  }
  EXPORT_SYMBOL_GPL(kernel_power_off);
@@ -17174,7 +16808,7 @@
  /*
   * Reboot system call: for obvious reasons only root may call it,
   * and even root needs to set up some magic numbers in the registers
-@@ -383,6 +394,9 @@ asmlinkage long sys_reboot(int magic1, i
+@@ -389,6 +400,9 @@ asmlinkage long sys_reboot(int magic1, i
  	if ((cmd == LINUX_REBOOT_CMD_POWER_OFF) && !pm_power_off)
  		cmd = LINUX_REBOOT_CMD_HALT;
  
@@ -17184,7 +16818,7 @@
  	lock_kernel();
  	switch (cmd) {
  	case LINUX_REBOOT_CMD_RESTART:
-@@ -1343,7 +1357,7 @@ asmlinkage long sys_sethostname(char __u
+@@ -1361,7 +1375,7 @@ asmlinkage long sys_sethostname(char __u
  	int errno;
  	char tmp[__NEW_UTS_LEN];
  
@@ -17193,7 +16827,7 @@
  		return -EPERM;
  	if (len < 0 || len > __NEW_UTS_LEN)
  		return -EINVAL;
-@@ -1388,7 +1402,7 @@ asmlinkage long sys_setdomainname(char _
+@@ -1406,7 +1420,7 @@ asmlinkage long sys_setdomainname(char _
  	int errno;
  	char tmp[__NEW_UTS_LEN];
  
@@ -17202,7 +16836,7 @@
  		return -EPERM;
  	if (len < 0 || len > __NEW_UTS_LEN)
  		return -EINVAL;
-@@ -1455,7 +1469,7 @@ asmlinkage long sys_setrlimit(unsigned i
+@@ -1473,7 +1487,7 @@ asmlinkage long sys_setrlimit(unsigned i
  		return -EINVAL;
  	old_rlim = current->signal->rlim + resource;
  	if ((new_rlim.rlim_max > old_rlim->rlim_max) &&
@@ -17211,9 +16845,9 @@
  		return -EPERM;
  	if (resource == RLIMIT_NOFILE && new_rlim.rlim_max > sysctl_nr_open)
  		return -EPERM;
---- a/kernel/sysctl.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/sysctl.c	2008-04-19 15:14:52.000000000 -0400
-@@ -107,6 +107,7 @@ static int ngroups_max = NGROUPS_MAX;
+--- a/kernel/sysctl.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/sysctl.c	2008-07-16 22:41:36.000000000 -0400
+@@ -109,6 +109,7 @@ static int ngroups_max = NGROUPS_MAX;
  #ifdef CONFIG_KMOD
  extern char modprobe_path[];
  #endif
@@ -17221,7 +16855,7 @@
  #ifdef CONFIG_CHR_DEV_SG
  extern int sg_big_buff;
  #endif
-@@ -492,6 +493,15 @@ static struct ctl_table kern_table[] = {
+@@ -477,6 +478,15 @@ static struct ctl_table kern_table[] = {
  		.strategy	= &sysctl_string,
  	},
  #endif
@@ -17238,7 +16872,7 @@
  	{
  		.ctl_name	= KERN_SG_BIG_BUFF,
 --- a/kernel/sysctl_check.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/sysctl_check.c	2008-04-21 13:42:56.000000000 -0400
++++ a/kernel/sysctl_check.c	2008-07-16 22:41:36.000000000 -0400
 @@ -39,6 +39,7 @@ static const struct trans_ctl_table tran
  
  	{ KERN_PANIC,			"panic" },
@@ -17278,9 +16912,9 @@
  	{}
  };
  
---- a/kernel/time.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/time.c	2008-04-19 15:14:52.000000000 -0400
-@@ -60,6 +60,7 @@ EXPORT_SYMBOL(sys_tz);
+--- a/kernel/time.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/time.c	2008-07-16 22:41:36.000000000 -0400
+@@ -62,6 +62,7 @@ EXPORT_SYMBOL(sys_tz);
  asmlinkage long sys_time(time_t __user * tloc)
  {
  	time_t i = get_seconds();
@@ -17288,7 +16922,7 @@
  
  	if (tloc) {
  		if (put_user(i,tloc))
-@@ -89,7 +90,7 @@ asmlinkage long sys_stime(time_t __user 
+@@ -91,7 +92,7 @@ asmlinkage long sys_stime(time_t __user 
  	if (err)
  		return err;
  
@@ -17297,7 +16931,7 @@
  	return 0;
  }
  
-@@ -100,7 +101,7 @@ asmlinkage long sys_gettimeofday(struct 
+@@ -102,7 +103,7 @@ asmlinkage long sys_gettimeofday(struct 
  {
  	if (likely(tv != NULL)) {
  		struct timeval ktv;
@@ -17306,7 +16940,7 @@
  		if (copy_to_user(tv, &ktv, sizeof(ktv)))
  			return -EFAULT;
  	}
-@@ -175,7 +176,7 @@ int do_sys_settimeofday(struct timespec 
+@@ -177,7 +178,7 @@ int do_sys_settimeofday(struct timespec 
  		/* SMP safe, again the code in arch/foo/time.c should
  		 * globally block out interrupts when it runs.
  		 */
@@ -17315,7 +16949,7 @@
  	}
  	return 0;
  }
-@@ -307,7 +308,7 @@ void getnstimeofday(struct timespec *tv)
+@@ -309,7 +310,7 @@ void getnstimeofday(struct timespec *tv)
  {
  	struct timeval x;
  
@@ -17324,8 +16958,8 @@
  	tv->tv_sec = x.tv_sec;
  	tv->tv_nsec = x.tv_usec * NSEC_PER_USEC;
  }
---- a/kernel/timer.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/timer.c	2008-04-19 15:14:52.000000000 -0400
+--- a/kernel/timer.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/timer.c	2008-07-16 22:41:36.000000000 -0400
 @@ -37,6 +37,10 @@
  #include <linux/delay.h>
  #include <linux/tick.h>
@@ -17337,7 +16971,7 @@
  
  #include <asm/uaccess.h>
  #include <asm/unistd.h>
-@@ -955,12 +959,6 @@ asmlinkage unsigned long sys_alarm(unsig
+@@ -1089,12 +1093,6 @@ asmlinkage unsigned long sys_alarm(unsig
  
  #endif
  
@@ -17350,7 +16984,7 @@
  
  /**
   * sys_getpid - return the thread group id of the current process
-@@ -989,10 +987,23 @@ asmlinkage long sys_getppid(void)
+@@ -1123,10 +1121,23 @@ asmlinkage long sys_getppid(void)
  	rcu_read_lock();
  	pid = task_tgid_vnr(current->real_parent);
  	rcu_read_unlock();
@@ -17375,7 +17009,7 @@
  asmlinkage long sys_getuid(void)
  {
  	/* Only we change this so SMP safe */
-@@ -1160,6 +1171,8 @@ int do_sysinfo(struct sysinfo *info)
+@@ -1297,6 +1308,8 @@ int do_sysinfo(struct sysinfo *info)
  			tp.tv_nsec = tp.tv_nsec - NSEC_PER_SEC;
  			tp.tv_sec++;
  		}
@@ -17384,9 +17018,9 @@
  		info->uptime = tp.tv_sec + (tp.tv_nsec ? 1 : 0);
  
  		info->loads[0] = avenrun[0] << (SI_LOAD_SHIFT - FSHIFT);
---- a/kernel/user.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/user.c	2008-04-23 16:24:56.000000000 -0400
-@@ -219,14 +219,15 @@ static struct kobj_type uids_ktype = {
+--- a/kernel/user.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/user.c	2008-08-13 20:16:50.000000000 -0400
+@@ -243,12 +243,15 @@ static struct kobj_type uids_ktype = {
  };
  
  /* create /sys/kernel/uids/<uid>/cpu_share file for this user */
@@ -17394,17 +17028,17 @@
 +static int uids_user_create(struct user_namespace *ns, struct user_struct *up)
  {
  	struct kobject *kobj = &up->kobj;
- 	int error;
+-	int error;
++	int error = 0;
  
  	memset(kobj, 0, sizeof(struct kobject));
++	if (ns != &init_user_ns)
++		goto done;
++
  	kobj->kset = uids_kset;
--	error = kobject_init_and_add(kobj, &uids_ktype, NULL, "%d", up->uid);
-+	error = kobject_init_and_add(kobj, &uids_ktype, NULL,
-+		"%p:%d", ns, up->uid);
+ 	error = kobject_init_and_add(kobj, &uids_ktype, NULL, "%d", up->uid);
  	if (error) {
- 		kobject_put(kobj);
- 		goto done;
-@@ -248,7 +249,7 @@ int __init uids_sysfs_init(void)
+@@ -272,7 +275,7 @@ int __init uids_sysfs_init(void)
  	if (!uids_kset)
  		return -ENOMEM;
  
@@ -17413,7 +17047,22 @@
  }
  
  /* work function to remove sysfs directory for a user and free up
-@@ -308,7 +309,8 @@ static inline void free_user(struct user
+@@ -302,9 +305,11 @@ static void remove_user_sysfs_dir(struct
+ 	if (!remove_user)
+ 		goto done;
+ 
+-	kobject_uevent(&up->kobj, KOBJ_REMOVE);
+-	kobject_del(&up->kobj);
+-	kobject_put(&up->kobj);
++	if (up->kobj.name) {
++		kobject_uevent(&up->kobj, KOBJ_REMOVE);
++		kobject_del(&up->kobj);
++		kobject_put(&up->kobj);
++	}
+ 
+ 	sched_destroy_user(up);
+ 	key_put(up->uid_keyring);
+@@ -332,7 +337,8 @@ static inline void free_user(struct user
  #else	/* CONFIG_USER_SCHED && CONFIG_SYSFS */
  
  int uids_sysfs_init(void) { return 0; }
@@ -17423,26 +17072,26 @@
  static inline void uids_mutex_lock(void) { }
  static inline void uids_mutex_unlock(void) { }
  
-@@ -399,7 +401,7 @@ struct user_struct * alloc_uid(struct us
+@@ -409,7 +415,7 @@ struct user_struct *alloc_uid(struct use
  		if (sched_create_user(new) < 0)
- 			goto out_put_keys;
+ 			goto out_free_user;
  
 -		if (uids_user_create(new))
 +		if (uids_user_create(ns, new))
  			goto out_destoy_sched;
  
  		/*
---- a/kernel/user_namespace.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/kernel/user_namespace.c	2008-04-19 15:14:52.000000000 -0400
-@@ -9,6 +9,7 @@
- #include <linux/version.h>
+--- a/kernel/user_namespace.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/user_namespace.c	2008-07-16 22:41:36.000000000 -0400
+@@ -10,6 +10,7 @@
  #include <linux/nsproxy.h>
+ #include <linux/slab.h>
  #include <linux/user_namespace.h>
 +#include <linux/vserver/global.h>
  
  /*
   * Clone a new ns copying an original user ns, setting refcount to 1
-@@ -26,6 +27,7 @@ static struct user_namespace *clone_user
+@@ -27,6 +28,7 @@ static struct user_namespace *clone_user
  		return ERR_PTR(-ENOMEM);
  
  	kref_init(&ns->kref);
@@ -17450,24 +17099,25 @@
  
  	for (n = 0; n < UIDHASH_SZ; ++n)
  		INIT_HLIST_HEAD(ns->uidhash_table + n);
-@@ -71,5 +73,6 @@ void free_user_ns(struct kref *kref)
+@@ -72,6 +74,7 @@ void free_user_ns(struct kref *kref)
  
  	ns = container_of(kref, struct user_namespace, kref);
  	release_uids(ns);
 +	atomic_dec(&vs_global_user_ns);
  	kfree(ns);
  }
---- a/kernel/utsname.c	2008-04-17 10:37:25.000000000 -0400
-+++ a/kernel/utsname.c	2008-04-19 15:14:52.000000000 -0400
-@@ -14,6 +14,7 @@
- #include <linux/utsname.h>
+ EXPORT_SYMBOL(free_user_ns);
+--- a/kernel/utsname.c	2008-07-14 17:22:55.000000000 -0400
++++ a/kernel/utsname.c	2008-07-17 21:15:55.000000000 -0400
+@@ -15,6 +15,7 @@
  #include <linux/version.h>
  #include <linux/err.h>
+ #include <linux/slab.h>
 +#include <linux/vserver/global.h>
  
  /*
   * Clone a new ns copying an original utsname, setting refcount to 1
-@@ -32,6 +33,7 @@ static struct uts_namespace *clone_uts_n
+@@ -33,6 +34,7 @@ static struct uts_namespace *clone_uts_n
  	memcpy(&ns->name, &old_ns->name, sizeof(ns->name));
  	up_read(&uts_sem);
  	kref_init(&ns->kref);
@@ -17475,7 +17125,7 @@
  	return ns;
  }
  
-@@ -62,5 +64,6 @@ void free_uts_ns(struct kref *kref)
+@@ -63,5 +65,6 @@ void free_uts_ns(struct kref *kref)
  	struct uts_namespace *ns;
  
  	ns = container_of(kref, struct uts_namespace, kref);
@@ -17483,7 +17133,7 @@
  	kfree(ns);
  }
 --- a/kernel/vserver/cacct.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/cacct.c	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/vserver/cacct.c	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,42 @@
 +/*
 + *  linux/kernel/vserver/cacct.c
@@ -17528,7 +17178,7 @@
 +}
 +
 --- a/kernel/vserver/cacct_init.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/cacct_init.h	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/vserver/cacct_init.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,25 @@
 +
 +
@@ -17556,7 +17206,7 @@
 +}
 +
 --- a/kernel/vserver/cacct_proc.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/cacct_proc.h	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/vserver/cacct_proc.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,53 @@
 +#ifndef _VX_CACCT_PROC_H
 +#define _VX_CACCT_PROC_H
@@ -17612,8 +17262,8 @@
 +
 +#endif	/* _VX_CACCT_PROC_H */
 --- a/kernel/vserver/context.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/context.c	2008-04-23 22:26:24.000000000 -0400
-@@ -0,0 +1,1005 @@
++++ a/kernel/vserver/context.c	2008-07-27 14:10:37.000000000 -0400
+@@ -0,0 +1,1010 @@
 +/*
 + *  linux/kernel/vserver/context.c
 + *
@@ -17751,14 +17401,15 @@
 +
 +static void __dealloc_vx_info(struct vx_info *vxi)
 +{
++	struct vx_info_save vxis;
 +	int cpu;
 +
 +	vxdprintk(VXD_CBIT(xid, 0),
 +		"dealloc_vx_info(%p)", vxi);
 +	vxh_dealloc_vx_info(vxi);
 +
-+	vxi->vx_id = -1;
-+
++#ifdef	CONFIG_VSERVER_WARN
++	enter_vx_info(vxi, &vxis);
 +	vx_info_exit_limit(&vxi->limit);
 +	vx_info_exit_sched(&vxi->sched);
 +	vx_info_exit_cvirt(&vxi->cvirt);
@@ -17770,7 +17421,10 @@
 +		vx_info_exit_cvirt_pc(
 +			&vx_per_cpu(vxi, cvirt_pc, cpu), cpu);
 +	}
++	leave_vx_info(&vxis);
++#endif
 +
++	vxi->vx_id = -1;
 +	vxi->vx_state |= VXS_RELEASED;
 +
 +#ifdef CONFIG_SMP
@@ -18116,6 +17770,7 @@
 +
 +
 +#include <linux/file.h>
++#include <linux/fdtable.h>
 +
 +static int vx_openfd_task(struct task_struct *tsk)
 +{
@@ -18620,7 +18275,7 @@
 +EXPORT_SYMBOL_GPL(free_vx_info);
 +
 --- a/kernel/vserver/cvirt.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/cvirt.c	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/vserver/cvirt.c	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,301 @@
 +/*
 + *  linux/kernel/vserver/cvirt.c
@@ -18924,7 +18579,7 @@
 +#endif
 +
 --- a/kernel/vserver/cvirt_init.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/cvirt_init.h	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/vserver/cvirt_init.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,69 @@
 +
 +
@@ -18996,7 +18651,7 @@
 +}
 +
 --- a/kernel/vserver/cvirt_proc.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/cvirt_proc.h	2008-04-21 13:01:29.000000000 -0400
++++ a/kernel/vserver/cvirt_proc.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,135 @@
 +#ifndef _VX_CVIRT_PROC_H
 +#define _VX_CVIRT_PROC_H
@@ -19134,7 +18789,7 @@
 +
 +#endif	/* _VX_CVIRT_PROC_H */
 --- a/kernel/vserver/debug.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/debug.c	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/vserver/debug.c	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,32 @@
 +/*
 + *  kernel/vserver/debug.c
@@ -19169,7 +18824,7 @@
 +EXPORT_SYMBOL_GPL(dump_vx_info);
 +
 --- a/kernel/vserver/device.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/device.c	2008-04-21 12:35:24.000000000 -0400
++++ a/kernel/vserver/device.c	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,443 @@
 +/*
 + *  linux/kernel/vserver/device.c
@@ -19615,7 +19270,7 @@
 +
 +
 --- a/kernel/vserver/dlimit.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/dlimit.c	2008-04-21 12:36:09.000000000 -0400
++++ a/kernel/vserver/dlimit.c	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,521 @@
 +/*
 + *  linux/kernel/vserver/dlimit.c
@@ -20139,7 +19794,7 @@
 +EXPORT_SYMBOL_GPL(rcu_free_dl_info);
 +
 --- a/kernel/vserver/helper.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/helper.c	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/vserver/helper.c	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,199 @@
 +/*
 + *  linux/kernel/vserver/helper.c
@@ -20341,7 +19996,7 @@
 +}
 +
 --- a/kernel/vserver/history.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/history.c	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/vserver/history.c	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,258 @@
 +/*
 + *  kernel/vserver/history.c
@@ -20602,7 +20257,7 @@
 +#endif	/* CONFIG_COMPAT */
 +
 --- a/kernel/vserver/inet.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/inet.c	2008-05-29 18:56:59.000000000 -0400
++++ a/kernel/vserver/inet.c	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,225 @@
 +
 +#include <linux/in.h>
@@ -20830,7 +20485,7 @@
 +EXPORT_SYMBOL_GPL(ip_v4_find_src);
 +
 --- a/kernel/vserver/init.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/init.c	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/vserver/init.c	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,45 @@
 +/*
 + *  linux/kernel/init.c
@@ -20878,7 +20533,7 @@
 +module_exit(exit_vserver);
 +
 --- a/kernel/vserver/inode.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/inode.c	2008-04-21 16:52:16.000000000 -0400
++++ a/kernel/vserver/inode.c	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,409 @@
 +/*
 + *  linux/kernel/vserver/inode.c
@@ -20916,9 +20571,9 @@
 +
 +	*flags = IATTR_TAG
 +		| (IS_BARRIER(in) ? IATTR_BARRIER : 0)
-+		| (IS_IUNLINK(in) ? IATTR_IUNLINK : 0)
++		| (IS_IXUNLINK(in) ? IATTR_IXUNLINK : 0)
 +		| (IS_IMMUTABLE(in) ? IATTR_IMMUTABLE : 0);
-+	*mask = IATTR_IUNLINK | IATTR_IMMUTABLE;
++	*mask = IATTR_IXUNLINK | IATTR_IMMUTABLE;
 +
 +	if (S_ISDIR(in->i_mode))
 +		*mask |= IATTR_BARRIER;
@@ -21062,24 +20717,24 @@
 +			entry->vx_flags = iflags;
 +	}
 +
-+	if (*mask & (IATTR_BARRIER | IATTR_IUNLINK | IATTR_IMMUTABLE)) {
++	if (*mask & (IATTR_BARRIER | IATTR_IXUNLINK | IATTR_IMMUTABLE)) {
 +		if (*mask & IATTR_IMMUTABLE) {
 +			if (*flags & IATTR_IMMUTABLE)
 +				in->i_flags |= S_IMMUTABLE;
 +			else
 +				in->i_flags &= ~S_IMMUTABLE;
 +		}
-+		if (*mask & IATTR_IUNLINK) {
-+			if (*flags & IATTR_IUNLINK)
-+				in->i_flags |= S_IUNLINK;
++		if (*mask & IATTR_IXUNLINK) {
++			if (*flags & IATTR_IXUNLINK)
++				in->i_flags |= S_IXUNLINK;
 +			else
-+				in->i_flags &= ~S_IUNLINK;
++				in->i_flags &= ~S_IXUNLINK;
 +		}
 +		if (S_ISDIR(in->i_mode) && (*mask & IATTR_BARRIER)) {
 +			if (*flags & IATTR_BARRIER)
-+				in->i_flags |= S_BARRIER;
++				in->i_vflags |= V_BARRIER;
 +			else
-+				in->i_flags &= ~S_BARRIER;
++				in->i_vflags &= ~V_BARRIER;
 +		}
 +		if (in->i_op && in->i_op->sync_flags) {
 +			error = in->i_op->sync_flags(in);
@@ -21290,8 +20945,8 @@
 +#endif	/* CONFIG_PROPAGATE */
 +
 --- a/kernel/vserver/Kconfig	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/Kconfig	2008-05-21 15:02:48.000000000 -0400
-@@ -0,0 +1,252 @@
++++ a/kernel/vserver/Kconfig	2008-07-16 22:41:36.000000000 -0400
+@@ -0,0 +1,251 @@
 +#
 +# Linux VServer configuration
 +#
@@ -21534,7 +21189,6 @@
 +	select NAMESPACES
 +	select UTS_NS
 +	select IPC_NS
-+	select PID_NS
 +	select USER_NS
 +	select SYSVIPC
 +
@@ -21545,7 +21199,7 @@
 +	select SECURITY_CAPABILITIES
 +
 --- a/kernel/vserver/limit.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/limit.c	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/vserver/limit.c	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,319 @@
 +/*
 + *  linux/kernel/vserver/limit.c
@@ -21867,8 +21521,8 @@
 +}
 +
 --- a/kernel/vserver/limit_init.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/limit_init.h	2008-04-19 15:14:52.000000000 -0400
-@@ -0,0 +1,33 @@
++++ a/kernel/vserver/limit_init.h	2008-07-16 22:41:36.000000000 -0400
+@@ -0,0 +1,31 @@
 +
 +
 +static inline void vx_info_init_limit(struct _vx_limit *limit)
@@ -21887,7 +21541,6 @@
 +
 +static inline void vx_info_exit_limit(struct _vx_limit *limit)
 +{
-+#ifdef	CONFIG_VSERVER_WARN
 +	rlim_t value;
 +	int lim;
 +
@@ -21899,11 +21552,10 @@
 +			"!!! limit: %p[%s,%d] = %ld on exit.",
 +			limit, vlimit_name[lim], lim, (long)value);
 +	}
-+#endif
 +}
 +
 --- a/kernel/vserver/limit_proc.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/limit_proc.h	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/vserver/limit_proc.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,57 @@
 +#ifndef _VX_LIMIT_PROC_H
 +#define _VX_LIMIT_PROC_H
@@ -21963,7 +21615,7 @@
 +
 +
 --- a/kernel/vserver/Makefile	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/Makefile	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/vserver/Makefile	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,18 @@
 +#
 +# Makefile for the Linux vserver routines.
@@ -21984,7 +21636,7 @@
 +vserver-$(CONFIG_VSERVER_DEVICE) += device.o
 +
 --- a/kernel/vserver/monitor.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/monitor.c	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/vserver/monitor.c	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,138 @@
 +/*
 + *  kernel/vserver/monitor.c
@@ -22125,7 +21777,7 @@
 +#endif	/* CONFIG_COMPAT */
 +
 --- a/kernel/vserver/network.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/network.c	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/vserver/network.c	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,864 @@
 +/*
 + *  linux/kernel/vserver/network.c
@@ -22992,7 +22644,7 @@
 +EXPORT_SYMBOL_GPL(unhash_nx_info);
 +
 --- a/kernel/vserver/proc.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/proc.c	2008-04-21 13:42:34.000000000 -0400
++++ a/kernel/vserver/proc.c	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,1086 @@
 +/*
 + *  linux/kernel/vserver/proc.c
@@ -24081,7 +23733,7 @@
 +}
 +
 --- a/kernel/vserver/sched.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/sched.c	2008-04-29 18:40:09.000000000 -0400
++++ a/kernel/vserver/sched.c	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,413 @@
 +/*
 + *  linux/kernel/vserver/sched.c
@@ -24497,7 +24149,7 @@
 +}
 +
 --- a/kernel/vserver/sched_init.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/sched_init.h	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/vserver/sched_init.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,50 @@
 +
 +static inline void vx_info_init_sched(struct _vx_sched *sched)
@@ -24550,7 +24202,7 @@
 +	return;
 +}
 --- a/kernel/vserver/sched_proc.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/sched_proc.h	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/vserver/sched_proc.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,57 @@
 +#ifndef _VX_SCHED_PROC_H
 +#define _VX_SCHED_PROC_H
@@ -24610,7 +24262,7 @@
 +
 +#endif	/* _VX_SCHED_PROC_H */
 --- a/kernel/vserver/signal.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/signal.c	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/vserver/signal.c	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,132 @@
 +/*
 + *  linux/kernel/vserver/signal.c
@@ -24745,8 +24397,8 @@
 +}
 +
 --- a/kernel/vserver/space.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/space.c	2008-05-15 15:41:12.000000000 -0400
-@@ -0,0 +1,316 @@
++++ a/kernel/vserver/space.c	2008-07-16 22:41:36.000000000 -0400
+@@ -0,0 +1,372 @@
 +/*
 + *  linux/kernel/vserver/space.c
 + *
@@ -24787,14 +24439,42 @@
 +#include <linux/ipc_namespace.h>
 +#include <net/net_namespace.h>
 +
-+const struct vcmd_space_mask space_mask = {
-+	.mask = CLONE_NEWNS |
++
++static const struct vcmd_space_mask space_mask_v0 = {
++	.mask = CLONE_FS |
++		CLONE_NEWNS |
++		CLONE_NEWUTS |
++		CLONE_NEWIPC |
++		CLONE_NEWUSER |
++		0
++};
++
++static const struct vcmd_space_mask space_mask = {
++	.mask = CLONE_FS |
++		CLONE_NEWNS |
 +		CLONE_NEWUTS |
 +		CLONE_NEWIPC |
 +		CLONE_NEWUSER |
-+		CLONE_FS
++#ifdef	CONFIG_PID_NS
++		CLONE_NEWPID |
++#endif
++#ifdef	CONFIG_NET_NS
++		CLONE_NEWNET |
++#endif
++		0
 +};
 +
++static const struct vcmd_space_mask default_space_mask = {
++	.mask = CLONE_FS |
++		CLONE_NEWNS |
++		CLONE_NEWUTS |
++		CLONE_NEWIPC |
++		CLONE_NEWUSER |
++#ifdef	CONFIG_PID_NS
++//		CLONE_NEWPID |
++#endif
++		0
++};
 +
 +/*
 + *	build a new nsproxy mix
@@ -24809,9 +24489,13 @@
 +	struct mnt_namespace *old_ns;
 +	struct uts_namespace *old_uts;
 +	struct ipc_namespace *old_ipc;
-+	struct pid_namespace *old_pid;
 +	struct user_namespace *old_user;
++#ifdef	CONFIG_PID_NS
++	struct pid_namespace *old_pid;
++#endif
++#ifdef	CONFIG_NET_NS
 +	struct net *old_net;
++#endif
 +	struct nsproxy *nsproxy;
 +
 +	nsproxy = copy_nsproxy(old_nsproxy);
@@ -24850,6 +24534,7 @@
 +	} else
 +		old_user = NULL;
 +
++#ifdef	CONFIG_PID_NS
 +	if (mask & CLONE_NEWPID) {
 +		old_pid = nsproxy->pid_ns;
 +		nsproxy->pid_ns = new_nsproxy->pid_ns;
@@ -24857,7 +24542,8 @@
 +			get_pid_ns(nsproxy->pid_ns);
 +	} else
 +		old_pid = NULL;
-+
++#endif
++#ifdef	CONFIG_NET_NS
 +	if (mask & CLONE_NEWNET) {
 +		old_net = nsproxy->net_ns;
 +		nsproxy->net_ns = new_nsproxy->net_ns;
@@ -24865,19 +24551,23 @@
 +			get_net(nsproxy->net_ns);
 +	} else
 +		old_net = NULL;
-+
++#endif
 +	if (old_ns)
 +		put_mnt_ns(old_ns);
 +	if (old_uts)
 +		put_uts_ns(old_uts);
 +	if (old_ipc)
 +		put_ipc_ns(old_ipc);
-+	if (old_pid)
-+		put_pid_ns(old_pid);
 +	if (old_user)
 +		put_user_ns(old_user);
++#ifdef	CONFIG_PID_NS
++	if (old_pid)
++		put_pid_ns(old_pid);
++#endif
++#ifdef	CONFIG_NET_NS
 +	if (old_net)
 +		put_net(old_net);
++#endif
 +out:
 +	return nsproxy;
 +}
@@ -24934,6 +24624,9 @@
 +	struct fs_struct *fs, *fs_cur, *fs_new;
 +	int ret;
 +
++	vxdprintk(VXD_CBIT(space, 8), "vx_enter_space(%p[#%u],0x%08lx)",
++		vxi, vxi->vx_id, mask);
++
 +	if (vx_info_flags(vxi, VXF_INFO_PRIVATE, 0))
 +		return -EACCES;
 +
@@ -24989,9 +24682,12 @@
 +	struct fs_struct *fs_vxi, *fs_cur, *fs_new;
 +	int ret;
 +
++	vxdprintk(VXD_CBIT(space, 8), "vx_set_space(%p[#%u],0x%08lx)",
++		vxi, vxi->vx_id, mask);
++#if 0
 +	if (!mask)
-+		mask = space_mask.mask;
-+
++		mask = default_space_mask.mask;
++#endif
 +	if ((mask & space_mask.mask) != mask)
 +		return -EINVAL;
 +
@@ -25056,16 +24752,28 @@
 +	return vx_set_space(vxi, vc_data.mask);
 +}
 +
-+int vc_get_space_mask(struct vx_info *vxi, void __user *data)
++int vc_get_space_mask(void __user *data, int type)
 +{
-+	if (copy_to_user(data, &space_mask, sizeof(space_mask)))
++	const struct vcmd_space_mask *mask;
++
++	if (type == 0)
++		mask = &space_mask_v0;
++	else if (type == 1)
++		mask = &space_mask;
++	else
++		mask = &default_space_mask;
++
++	vxdprintk(VXD_CBIT(space, 10),
++		"vc_get_space_mask(%d) = %08llx", type, mask->mask);
++
++	if (copy_to_user(data, mask, sizeof(struct vcmd_space_mask)))
 +		return -EFAULT;
 +	return 0;
 +}
 +
 --- a/kernel/vserver/switch.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/switch.c	2008-04-29 18:40:18.000000000 -0400
-@@ -0,0 +1,529 @@
++++ a/kernel/vserver/switch.c	2008-07-16 22:41:36.000000000 -0400
+@@ -0,0 +1,537 @@
 +/*
 + *  linux/kernel/vserver/switch.c
 + *
@@ -25166,8 +24874,14 @@
 +	case VCMD_set_space:
 +		return vc_set_space(vxi, data);
 +
++	case VCMD_get_space_mask_v0:
++		return vc_get_space_mask(data, 0);
++	/* this is version 1 */
 +	case VCMD_get_space_mask:
-+		return vc_get_space_mask(vxi, data);
++		return vc_get_space_mask(data, 1);
++
++	case VCMD_get_space_default:
++		return vc_get_space_mask(data, -1);
 +
 +#ifdef	CONFIG_IA32_EMULATION
 +	case VCMD_get_rlimit:
@@ -25372,7 +25086,9 @@
 +	__VCMD(get_version,	 0, VCA_NONE,	0);
 +	__VCMD(get_vci,		 0, VCA_NONE,	0);
 +	__VCMD(get_rlimit_mask,	 0, VCA_NONE,	0);
++	__VCMD(get_space_mask_v0,0, VCA_NONE,   0);
 +	__VCMD(get_space_mask,	 0, VCA_NONE,   0);
++	__VCMD(get_space_default,0, VCA_NONE,   0);
 +
 +	/* info commands */
 +	__VCMD(task_xid,	 2, VCA_NONE,	0);
@@ -25596,7 +25312,7 @@
 +
 +#endif	/* CONFIG_COMPAT */
 --- a/kernel/vserver/sysctl.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/sysctl.c	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/vserver/sysctl.c	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,244 @@
 +/*
 + *  kernel/vserver/sysctl.c
@@ -25843,7 +25559,7 @@
 +EXPORT_SYMBOL_GPL(vx_debug_misc);
 +
 --- a/kernel/vserver/tag.c	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/tag.c	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/vserver/tag.c	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,63 @@
 +/*
 + *  linux/kernel/vserver/tag.c
@@ -25909,12 +25625,12 @@
 +
 +
 --- a/kernel/vserver/vci_config.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/kernel/vserver/vci_config.h	2008-04-19 15:14:52.000000000 -0400
++++ a/kernel/vserver/vci_config.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,81 @@
 +
 +/*  interface version */
 +
-+#define VCI_VERSION		0x00020302
++#define VCI_VERSION		0x00020303
 +
 +
 +enum {
@@ -25992,18 +25708,18 @@
 +	0;
 +}
 +
---- a/mm/filemap_xip.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/mm/filemap_xip.c	2008-04-19 15:14:52.000000000 -0400
+--- a/mm/filemap_xip.c	2008-07-14 17:22:56.000000000 -0400
++++ a/mm/filemap_xip.c	2008-07-16 22:41:36.000000000 -0400
 @@ -14,6 +14,7 @@
  #include <linux/uio.h>
  #include <linux/rmap.h>
  #include <linux/sched.h>
 +#include <linux/vs_memory.h>
  #include <asm/tlbflush.h>
+ #include <asm/io.h>
  
- /*
 --- a/mm/fremap.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/mm/fremap.c	2008-04-19 15:14:52.000000000 -0400
++++ a/mm/fremap.c	2008-07-16 22:41:36.000000000 -0400
 @@ -15,6 +15,7 @@
  #include <linux/rmap.h>
  #include <linux/module.h>
@@ -26012,8 +25728,8 @@
  
  #include <asm/mmu_context.h>
  #include <asm/cacheflush.h>
---- a/mm/hugetlb.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/mm/hugetlb.c	2008-04-19 15:14:52.000000000 -0400
+--- a/mm/hugetlb.c	2008-07-14 17:22:56.000000000 -0400
++++ a/mm/hugetlb.c	2008-07-16 22:41:36.000000000 -0400
 @@ -19,6 +19,7 @@
  #include <asm/pgtable.h>
  
@@ -26022,9 +25738,9 @@
  #include "internal.h"
  
  const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL;
---- a/mm/memory.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/mm/memory.c	2008-04-19 15:14:52.000000000 -0400
-@@ -505,6 +505,9 @@ static int copy_pte_range(struct mm_stru
+--- a/mm/memory.c	2008-07-14 17:22:56.000000000 -0400
++++ a/mm/memory.c	2008-07-16 22:41:36.000000000 -0400
+@@ -558,6 +558,9 @@ static int copy_pte_range(struct mm_stru
  	int progress = 0;
  	int rss[2];
  
@@ -26034,7 +25750,7 @@
  again:
  	rss[1] = rss[0] = 0;
  	dst_pte = pte_alloc_map_lock(dst_mm, dst_pmd, addr, &dst_ptl);
-@@ -2058,6 +2061,11 @@ static int do_swap_page(struct mm_struct
+@@ -2221,6 +2224,11 @@ static int do_swap_page(struct mm_struct
  		goto out;
  	}
  
@@ -26046,7 +25762,7 @@
  	mark_page_accessed(page);
  	lock_page(page);
  	delayacct_clear_flag(DELAYACCT_PF_SWAPIN);
-@@ -2129,6 +2137,8 @@ static int do_anonymous_page(struct mm_s
+@@ -2292,6 +2300,8 @@ static int do_anonymous_page(struct mm_s
  	/* Allocate our own private page. */
  	pte_unmap(page_table);
  
@@ -26055,7 +25771,7 @@
  	if (unlikely(anon_vma_prepare(vma)))
  		goto oom;
  	page = alloc_zeroed_user_highpage_movable(vma, address);
-@@ -2453,6 +2463,7 @@ static inline int handle_pte_fault(struc
+@@ -2606,6 +2616,7 @@ static inline int handle_pte_fault(struc
  {
  	pte_t entry;
  	spinlock_t *ptl;
@@ -26063,7 +25779,7 @@
  
  	entry = *pte;
  	if (!pte_present(entry)) {
-@@ -2480,9 +2491,12 @@ static inline int handle_pte_fault(struc
+@@ -2633,9 +2644,12 @@ static inline int handle_pte_fault(struc
  	if (unlikely(!pte_same(*pte, entry)))
  		goto unlock;
  	if (write_access) {
@@ -26078,7 +25794,7 @@
  		entry = pte_mkdirty(entry);
  	}
  	entry = pte_mkyoung(entry);
-@@ -2500,7 +2514,10 @@ static inline int handle_pte_fault(struc
+@@ -2653,7 +2667,10 @@ static inline int handle_pte_fault(struc
  	}
  unlock:
  	pte_unmap_unlock(pte, ptl);
@@ -26091,7 +25807,7 @@
  
  /*
 --- a/mm/mlock.c	2008-04-17 10:37:25.000000000 -0400
-+++ a/mm/mlock.c	2008-04-19 15:14:52.000000000 -0400
++++ a/mm/mlock.c	2008-07-16 22:41:36.000000000 -0400
 @@ -12,6 +12,7 @@
  #include <linux/syscalls.h>
  #include <linux/sched.h>
@@ -26148,12 +25864,12 @@
  	if (!(flags & MCL_CURRENT) || (current->mm->total_vm <= lock_limit) ||
  	    capable(CAP_IPC_LOCK))
  		ret = do_mlockall(flags);
---- a/mm/mmap.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/mm/mmap.c	2008-04-19 15:14:52.000000000 -0400
-@@ -1197,10 +1197,10 @@ munmap_back:
- 		kmem_cache_free(vm_area_cachep, vma);
- 	}
- out:	
+--- a/mm/mmap.c	2008-07-14 17:22:56.000000000 -0400
++++ a/mm/mmap.c	2008-07-16 22:41:36.000000000 -0400
+@@ -1210,10 +1210,10 @@ munmap_back:
+ 	if (correct_wcount)
+ 		atomic_inc(&inode->i_writecount);
+ out:
 -	mm->total_vm += len >> PAGE_SHIFT;
 +	vx_vmpages_add(mm, len >> PAGE_SHIFT);
  	vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT);
@@ -26163,7 +25879,7 @@
  		make_pages_present(addr, addr + len);
  	}
  	if ((flags & MAP_POPULATE) && !(flags & MAP_NONBLOCK))
-@@ -1549,9 +1549,9 @@ static int acct_stack_growth(struct vm_a
+@@ -1562,9 +1562,9 @@ static int acct_stack_growth(struct vm_a
  		return -ENOMEM;
  
  	/* Ok, everything looks good - let it rip */
@@ -26175,7 +25891,7 @@
  	vm_stat_account(mm, vma->vm_flags, vma->vm_file, grow);
  	return 0;
  }
-@@ -1722,9 +1722,9 @@ static void remove_vma_list(struct mm_st
+@@ -1735,9 +1735,9 @@ static void remove_vma_list(struct mm_st
  	do {
  		long nrpages = vma_pages(vma);
  
@@ -26187,7 +25903,7 @@
  		vm_stat_account(mm, vma->vm_flags, vma->vm_file, -nrpages);
  		vma = remove_vma(vma);
  	} while (vma);
-@@ -1967,6 +1967,8 @@ unsigned long do_brk(unsigned long addr,
+@@ -1983,6 +1983,8 @@ unsigned long do_brk(unsigned long addr,
  		lock_limit >>= PAGE_SHIFT;
  		if (locked > lock_limit && !capable(CAP_IPC_LOCK))
  			return -EAGAIN;
@@ -26196,7 +25912,7 @@
  	}
  
  	/*
-@@ -1993,7 +1995,8 @@ unsigned long do_brk(unsigned long addr,
+@@ -2009,7 +2011,8 @@ unsigned long do_brk(unsigned long addr,
  	if (mm->map_count > sysctl_max_map_count)
  		return -ENOMEM;
  
@@ -26206,7 +25922,7 @@
  		return -ENOMEM;
  
  	/* Can we just expand an old private anonymous mapping? */
-@@ -2018,9 +2021,9 @@ unsigned long do_brk(unsigned long addr,
+@@ -2034,9 +2037,9 @@ unsigned long do_brk(unsigned long addr,
  	vma->vm_page_prot = vm_get_page_prot(flags);
  	vma_link(mm, vma, prev, rb_link, rb_parent);
  out:
@@ -26218,7 +25934,7 @@
  		make_pages_present(addr, addr + len);
  	}
  	return addr;
-@@ -2049,6 +2052,11 @@ void exit_mmap(struct mm_struct *mm)
+@@ -2065,6 +2068,11 @@ void exit_mmap(struct mm_struct *mm)
  	free_pgtables(&tlb, vma, FIRST_USER_ADDRESS, 0);
  	tlb_finish_mmu(tlb, 0, end);
  
@@ -26230,7 +25946,7 @@
  	/*
  	 * Walk the list again, actually closing and freeing it,
  	 * with preemption enabled, without holding any MM locks.
-@@ -2088,7 +2096,8 @@ int insert_vm_struct(struct mm_struct * 
+@@ -2104,7 +2112,8 @@ int insert_vm_struct(struct mm_struct * 
  	if (__vma && __vma->vm_start < vma->vm_end)
  		return -ENOMEM;
  	if ((vma->vm_flags & VM_ACCOUNT) &&
@@ -26240,7 +25956,7 @@
  		return -ENOMEM;
  	vma_link(mm, vma, prev, rb_link, rb_parent);
  	return 0;
-@@ -2161,6 +2170,8 @@ int may_expand_vm(struct mm_struct *mm, 
+@@ -2180,6 +2189,8 @@ int may_expand_vm(struct mm_struct *mm, 
  
  	if (cur + npages > lim)
  		return 0;
@@ -26249,7 +25965,7 @@
  	return 1;
  }
  
-@@ -2238,7 +2249,6 @@ int install_special_mapping(struct mm_st
+@@ -2257,7 +2268,6 @@ int install_special_mapping(struct mm_st
  		return -ENOMEM;
  	}
  
@@ -26259,7 +25975,7 @@
  	return 0;
  }
 --- a/mm/mremap.c	2008-04-17 11:31:40.000000000 -0400
-+++ a/mm/mremap.c	2008-04-19 15:14:52.000000000 -0400
++++ a/mm/mremap.c	2008-07-16 22:41:36.000000000 -0400
 @@ -18,6 +18,7 @@
  #include <linux/highmem.h>
  #include <linux/security.h>
@@ -26309,9 +26025,9 @@
  				make_pages_present(addr + old_len,
  						   addr + new_len);
  			}
---- a/mm/nommu.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/mm/nommu.c	2008-04-19 15:14:52.000000000 -0400
-@@ -991,7 +991,7 @@ unsigned long do_mmap_pgoff(struct file 
+--- a/mm/nommu.c	2008-07-14 17:22:56.000000000 -0400
++++ a/mm/nommu.c	2008-07-16 22:41:36.000000000 -0400
+@@ -1007,7 +1007,7 @@ unsigned long do_mmap_pgoff(struct file 
  	realalloc += kobjsize(vma);
  	askedalloc += sizeof(*vma);
  
@@ -26320,7 +26036,7 @@
  
  	add_nommu_vma(vma);
  
-@@ -1117,7 +1117,7 @@ int do_munmap(struct mm_struct *mm, unsi
+@@ -1139,7 +1139,7 @@ int do_munmap(struct mm_struct *mm, unsi
  	kfree(vml);
  
  	update_hiwater_vm(mm);
@@ -26329,7 +26045,7 @@
  
  #ifdef DEBUG
  	show_process_blocks();
-@@ -1150,7 +1150,7 @@ void exit_mmap(struct mm_struct * mm)
+@@ -1172,7 +1172,7 @@ void exit_mmap(struct mm_struct * mm)
  		printk("Exit_mmap:\n");
  #endif
  
@@ -26338,8 +26054,8 @@
  
  		while ((tmp = mm->context.vmlist)) {
  			mm->context.vmlist = tmp->next;
---- a/mm/oom_kill.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/mm/oom_kill.c	2008-04-19 16:55:20.000000000 -0400
+--- a/mm/oom_kill.c	2008-07-14 17:22:56.000000000 -0400
++++ a/mm/oom_kill.c	2008-07-16 22:41:36.000000000 -0400
 @@ -26,6 +26,7 @@
  #include <linux/module.h>
  #include <linux/notifier.h>
@@ -26348,7 +26064,7 @@
  
  int sysctl_panic_on_oom;
  int sysctl_oom_kill_allocating_task;
-@@ -73,6 +74,12 @@ unsigned long badness(struct task_struct
+@@ -72,6 +73,12 @@ unsigned long badness(struct task_struct
  	points = mm->total_vm;
  
  	/*
@@ -26361,7 +26077,7 @@
  	 * After this unlock we can no longer dereference local variable `mm'
  	 */
  	task_unlock(p);
-@@ -162,8 +169,8 @@ unsigned long badness(struct task_struct
+@@ -161,8 +168,8 @@ unsigned long badness(struct task_struct
  	}
  
  #ifdef DEBUG
@@ -26372,7 +26088,7 @@
  #endif
  	return points;
  }
-@@ -322,8 +329,8 @@ static void __oom_kill_task(struct task_
+@@ -323,8 +330,8 @@ static void __oom_kill_task(struct task_
  	}
  
  	if (verbose)
@@ -26383,7 +26099,7 @@
  
  	/*
  	 * We give our sacrificial lamb high priority and access to
-@@ -403,8 +410,8 @@ static int oom_kill_process(struct task_
+@@ -404,8 +411,8 @@ static int oom_kill_process(struct task_
  		return 0;
  	}
  
@@ -26394,18 +26110,18 @@
  
  	/* Try to kill a child first */
  	list_for_each_entry(c, &p->children, sibling) {
---- a/mm/page_alloc.c	2008-05-21 14:30:05.000000000 -0400
-+++ a/mm/page_alloc.c	2008-05-21 14:30:41.000000000 -0400
-@@ -45,6 +45,8 @@
- #include <linux/fault-inject.h>
+--- a/mm/page_alloc.c	2008-07-14 17:22:56.000000000 -0400
++++ a/mm/page_alloc.c	2008-07-17 16:47:26.000000000 -0400
+@@ -46,6 +46,8 @@
  #include <linux/page-isolation.h>
  #include <linux/memcontrol.h>
+ #include <linux/debugobjects.h>
 +#include <linux/vs_base.h>
 +#include <linux/vs_limit.h>
  
  #include <asm/tlbflush.h>
  #include <asm/div64.h>
-@@ -1762,6 +1764,9 @@ void si_meminfo(struct sysinfo *val)
+@@ -1763,6 +1765,9 @@ void si_meminfo(struct sysinfo *val)
  	val->totalhigh = totalhigh_pages;
  	val->freehigh = nr_free_highpages();
  	val->mem_unit = PAGE_SIZE;
@@ -26415,7 +26131,7 @@
  }
  
  EXPORT_SYMBOL(si_meminfo);
-@@ -1782,6 +1787,9 @@ void si_meminfo_node(struct sysinfo *val
+@@ -1783,6 +1788,9 @@ void si_meminfo_node(struct sysinfo *val
  	val->freehigh = 0;
  #endif
  	val->mem_unit = PAGE_SIZE;
@@ -26425,8 +26141,8 @@
  }
  #endif
  
---- a/mm/rmap.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/mm/rmap.c	2008-04-19 16:53:36.000000000 -0400
+--- a/mm/rmap.c	2008-07-14 17:22:56.000000000 -0400
++++ a/mm/rmap.c	2008-07-16 22:41:36.000000000 -0400
 @@ -49,6 +49,7 @@
  #include <linux/module.h>
  #include <linux/kallsyms.h>
@@ -26435,8 +26151,8 @@
  
  #include <asm/tlbflush.h>
  
---- a/mm/shmem.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/mm/shmem.c	2008-04-19 15:14:52.000000000 -0400
+--- a/mm/shmem.c	2008-08-12 01:41:51.000000000 -0400
++++ a/mm/shmem.c	2008-08-12 01:42:21.000000000 -0400
 @@ -56,7 +56,6 @@
  #include <asm/pgtable.h>
  
@@ -26445,7 +26161,7 @@
  
  #define ENTRIES_PER_PAGE (PAGE_CACHE_SIZE/sizeof(unsigned long))
  #define ENTRIES_PER_PAGEPAGE (ENTRIES_PER_PAGE*ENTRIES_PER_PAGE)
-@@ -1773,7 +1772,7 @@ static int shmem_statfs(struct dentry *d
+@@ -1716,7 +1715,7 @@ static int shmem_statfs(struct dentry *d
  {
  	struct shmem_sb_info *sbinfo = SHMEM_SB(dentry->d_sb);
  
@@ -26454,7 +26170,7 @@
  	buf->f_bsize = PAGE_CACHE_SIZE;
  	buf->f_namelen = NAME_MAX;
  	spin_lock(&sbinfo->stat_lock);
-@@ -2341,7 +2340,7 @@ static int shmem_fill_super(struct super
+@@ -2284,7 +2283,7 @@ static int shmem_fill_super(struct super
  	sb->s_maxbytes = SHMEM_MAX_BYTES;
  	sb->s_blocksize = PAGE_CACHE_SIZE;
  	sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
@@ -26463,9 +26179,9 @@
  	sb->s_op = &shmem_ops;
  	sb->s_time_gran = 1;
  #ifdef CONFIG_TMPFS_POSIX_ACL
---- a/mm/slab.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/mm/slab.c	2008-04-19 15:14:52.000000000 -0400
-@@ -509,6 +509,8 @@ struct kmem_cache {
+--- a/mm/slab.c	2008-07-14 17:22:56.000000000 -0400
++++ a/mm/slab.c	2008-07-16 22:41:36.000000000 -0400
+@@ -508,6 +508,8 @@ struct kmem_cache {
  #define STATS_INC_FREEMISS(x)	do { } while (0)
  #endif
  
@@ -26474,7 +26190,7 @@
  #if DEBUG
  
  /*
-@@ -3344,6 +3346,7 @@ retry:
+@@ -3346,6 +3348,7 @@ retry:
  
  	obj = slab_get_obj(cachep, slabp, nodeid);
  	check_slabp(cachep, slabp);
@@ -26482,7 +26198,7 @@
  	l3->free_objects--;
  	/* move slabp to correct slabp list: */
  	list_del(&slabp->list);
-@@ -3416,6 +3419,7 @@ __cache_alloc_node(struct kmem_cache *ca
+@@ -3418,6 +3421,7 @@ __cache_alloc_node(struct kmem_cache *ca
  	/* ___cache_alloc_node can fall back to other nodes */
  	ptr = ____cache_alloc_node(cachep, flags, nodeid);
    out:
@@ -26490,7 +26206,7 @@
  	local_irq_restore(save_flags);
  	ptr = cache_alloc_debugcheck_after(cachep, flags, ptr, caller);
  
-@@ -3587,6 +3591,7 @@ static inline void __cache_free(struct k
+@@ -3589,6 +3593,7 @@ static inline void __cache_free(struct k
  
  	check_irq_off();
  	objp = cache_free_debugcheck(cachep, objp, __builtin_return_address(0));
@@ -26499,7 +26215,7 @@
  	/*
  	 * Skip calling cache_free_alien() when the platform is not numa.
 --- a/mm/slab_vs.h	1969-12-31 19:00:00.000000000 -0500
-+++ a/mm/slab_vs.h	2008-04-19 15:14:52.000000000 -0400
++++ a/mm/slab_vs.h	2008-07-16 22:41:36.000000000 -0400
 @@ -0,0 +1,27 @@
 +
 +#include <linux/vserver/context.h>
@@ -26528,8 +26244,8 @@
 +	atomic_sub(cachep->buffer_size, &current->vx_info->cacct.slab[what]);
 +}
 +
---- a/mm/swapfile.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/mm/swapfile.c	2008-04-19 15:14:52.000000000 -0400
+--- a/mm/swapfile.c	2008-07-14 17:22:56.000000000 -0400
++++ a/mm/swapfile.c	2008-07-16 22:41:36.000000000 -0400
 @@ -32,6 +32,8 @@
  #include <asm/pgtable.h>
  #include <asm/tlbflush.h>
@@ -26539,7 +26255,7 @@
  
  DEFINE_SPINLOCK(swap_lock);
  unsigned int nr_swapfiles;
-@@ -1743,6 +1745,8 @@ void si_swapinfo(struct sysinfo *val)
+@@ -1747,6 +1749,8 @@ void si_swapinfo(struct sysinfo *val)
  	val->freeswap = nr_swap_pages + nr_to_be_unused;
  	val->totalswap = total_swap_pages + nr_to_be_unused;
  	spin_unlock(&swap_lock);
@@ -26548,17 +26264,17 @@
  }
  
  /*
---- a/net/core/dev.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/net/core/dev.c	2008-04-19 15:14:52.000000000 -0400
-@@ -119,6 +119,7 @@
- #include <linux/err.h>
+--- a/net/core/dev.c	2008-07-14 17:22:57.000000000 -0400
++++ a/net/core/dev.c	2008-07-17 16:46:49.000000000 -0400
+@@ -120,6 +120,7 @@
  #include <linux/ctype.h>
  #include <linux/if_arp.h>
+ #include <linux/if_vlan.h>
 +#include <linux/vs_inet.h>
  
  #include "net-sysfs.h"
  
-@@ -2336,6 +2337,8 @@ static int dev_ifconf(struct net *net, c
+@@ -2366,6 +2367,8 @@ static int dev_ifconf(struct net *net, c
  
  	total = 0;
  	for_each_netdev(net, dev) {
@@ -26567,7 +26283,7 @@
  		for (i = 0; i < NPROTO; i++) {
  			if (gifconf_list[i]) {
  				int done;
-@@ -2404,6 +2407,9 @@ static void dev_seq_printf_stats(struct 
+@@ -2434,6 +2437,9 @@ static void dev_seq_printf_stats(struct 
  {
  	struct net_device_stats *stats = dev->get_stats(dev);
  
@@ -26577,9 +26293,9 @@
  	seq_printf(seq, "%6s:%8lu %7lu %4lu %4lu %4lu %5lu %10lu %9lu "
  		   "%8lu %7lu %4lu %4lu %4lu %5lu %7lu %10lu\n",
  		   dev->name, stats->rx_bytes, stats->rx_packets,
---- a/net/core/rtnetlink.c	2008-05-21 14:30:05.000000000 -0400
-+++ a/net/core/rtnetlink.c	2008-05-21 14:30:41.000000000 -0400
-@@ -674,6 +674,8 @@ static int rtnl_dump_ifinfo(struct sk_bu
+--- a/net/core/rtnetlink.c	2008-07-14 17:22:57.000000000 -0400
++++ a/net/core/rtnetlink.c	2008-07-16 22:41:36.000000000 -0400
+@@ -688,6 +688,8 @@ static int rtnl_dump_ifinfo(struct sk_bu
  
  	idx = 0;
  	for_each_netdev(net, dev) {
@@ -26588,7 +26304,7 @@
  		if (idx < s_idx)
  			goto cont;
  		if (rtnl_fill_ifinfo(skb, dev, RTM_NEWLINK,
-@@ -1207,6 +1209,9 @@ void rtmsg_ifinfo(int type, struct net_d
+@@ -1221,6 +1223,9 @@ void rtmsg_ifinfo(int type, struct net_d
  	struct sk_buff *skb;
  	int err = -ENOBUFS;
  
@@ -26598,8 +26314,8 @@
  	skb = nlmsg_new(if_nlmsg_size(dev), GFP_KERNEL);
  	if (skb == NULL)
  		goto errout;
---- a/net/core/sock.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/net/core/sock.c	2008-04-23 14:31:31.000000000 -0400
+--- a/net/core/sock.c	2008-07-14 17:22:57.000000000 -0400
++++ a/net/core/sock.c	2008-07-17 16:45:58.000000000 -0400
 @@ -126,6 +126,10 @@
  #include <linux/ipsec.h>
  
@@ -26611,7 +26327,7 @@
  
  #ifdef CONFIG_INET
  #include <net/tcp.h>
-@@ -907,6 +911,8 @@ static struct sock *sk_prot_alloc(struct
+@@ -899,6 +903,8 @@ static struct sock *sk_prot_alloc(struct
  		if (!try_module_get(prot->owner))
  			goto out_free_sec;
  	}
@@ -26620,10 +26336,10 @@
  
  	return sk;
  
-@@ -984,6 +990,11 @@ void sk_free(struct sock *sk)
- 		       __FUNCTION__, atomic_read(&sk->sk_omem_alloc));
+@@ -975,6 +981,11 @@ void sk_free(struct sock *sk)
+ 		       __func__, atomic_read(&sk->sk_omem_alloc));
  
- 	put_net(sk->sk_net);
+ 	put_net(sock_net(sk));
 +	vx_sock_dec(sk);
 +	clr_vx_info(&sk->sk_vx_info);
 +	sk->sk_xid = -1;
@@ -26632,16 +26348,16 @@
  	sk_prot_free(sk->sk_prot_creator, sk);
  }
  
-@@ -999,6 +1010,8 @@ struct sock *sk_clone(const struct sock 
+@@ -1010,6 +1021,8 @@ struct sock *sk_clone(const struct sock 
  
  		/* SANITY */
- 		get_net(newsk->sk_net);
+ 		get_net(sock_net(newsk));
 +		sock_vx_init(newsk);
 +		sock_nx_init(newsk);
  		sk_node_init(&newsk->sk_node);
  		sock_lock_init(newsk);
  		bh_lock_sock(newsk);
-@@ -1045,6 +1058,12 @@ struct sock *sk_clone(const struct sock 
+@@ -1056,6 +1069,12 @@ struct sock *sk_clone(const struct sock 
  		newsk->sk_priority = 0;
  		atomic_set(&newsk->sk_refcnt, 2);
  
@@ -26654,7 +26370,7 @@
  		/*
  		 * Increment the counter in the same struct proto as the master
  		 * sock (sk_refcnt_debug_inc uses newsk->sk_prot->socks, that
-@@ -1727,6 +1746,11 @@ void sock_init_data(struct socket *sock,
+@@ -1740,6 +1759,11 @@ void sock_init_data(struct socket *sock,
  
  	sk->sk_stamp = ktime_set(-1L, 0);
  
@@ -26666,8 +26382,8 @@
  	atomic_set(&sk->sk_refcnt, 1);
  	atomic_set(&sk->sk_drops, 0);
  }
---- a/net/ipv4/af_inet.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/net/ipv4/af_inet.c	2008-04-19 16:08:42.000000000 -0400
+--- a/net/ipv4/af_inet.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv4/af_inet.c	2008-07-29 18:05:52.000000000 -0400
 @@ -115,6 +115,7 @@
  #ifdef CONFIG_IP_MROUTE
  #include <linux/mroute.h>
@@ -26676,7 +26392,7 @@
  
  DEFINE_SNMP_STAT(struct linux_mib, net_statistics) __read_mostly;
  
-@@ -317,9 +318,12 @@ lookup_protocol:
+@@ -331,9 +332,12 @@ lookup_protocol:
  	}
  
  	err = -EPERM;
@@ -26687,10 +26403,10 @@
  		goto out_rcu_unlock;
 -
 +override:
- 	sock->ops = answer->ops;
- 	answer_prot = answer->prot;
- 	answer_no_check = answer->no_check;
-@@ -433,6 +437,7 @@ int inet_bind(struct socket *sock, struc
+ 	err = -EAFNOSUPPORT;
+ 	if (!inet_netns_ok(net, protocol))
+ 		goto out_rcu_unlock;
+@@ -451,6 +455,7 @@ int inet_bind(struct socket *sock, struc
  	struct sockaddr_in *addr = (struct sockaddr_in *)uaddr;
  	struct sock *sk = sock->sk;
  	struct inet_sock *inet = inet_sk(sk);
@@ -26698,20 +26414,20 @@
  	unsigned short snum;
  	int chk_addr_ret;
  	int err;
-@@ -446,7 +451,11 @@ int inet_bind(struct socket *sock, struc
+@@ -464,7 +469,11 @@ int inet_bind(struct socket *sock, struc
  	if (addr_len < sizeof(struct sockaddr_in))
  		goto out;
  
--	chk_addr_ret = inet_addr_type(&init_net, addr->sin_addr.s_addr);
+-	chk_addr_ret = inet_addr_type(sock_net(sk), addr->sin_addr.s_addr);
 +	err = v4_map_sock_addr(inet, addr, &nsa);
 +	if (err)
 +		goto out;
 +
-+	chk_addr_ret = inet_addr_type(&init_net, nsa.saddr);
++	chk_addr_ret = inet_addr_type(sock_net(sk), nsa.saddr);
  
  	/* Not specified by any standard per-se, however it breaks too
  	 * many applications when removed.  It is unfortunate since
-@@ -458,7 +467,7 @@ int inet_bind(struct socket *sock, struc
+@@ -476,7 +485,7 @@ int inet_bind(struct socket *sock, struc
  	err = -EADDRNOTAVAIL;
  	if (!sysctl_ip_nonlocal_bind &&
  	    !inet->freebind &&
@@ -26720,7 +26436,7 @@
  	    chk_addr_ret != RTN_LOCAL &&
  	    chk_addr_ret != RTN_MULTICAST &&
  	    chk_addr_ret != RTN_BROADCAST)
-@@ -483,7 +492,7 @@ int inet_bind(struct socket *sock, struc
+@@ -501,7 +510,7 @@ int inet_bind(struct socket *sock, struc
  	if (sk->sk_state != TCP_CLOSE || inet->num)
  		goto out_release_sock;
  
@@ -26729,7 +26445,7 @@
  	if (chk_addr_ret == RTN_MULTICAST || chk_addr_ret == RTN_BROADCAST)
  		inet->saddr = 0;  /* Use device */
  
-@@ -676,11 +685,13 @@ int inet_getname(struct socket *sock, st
+@@ -694,11 +703,13 @@ int inet_getname(struct socket *sock, st
  		     peer == 1))
  			return -ENOTCONN;
  		sin->sin_port = inet->dport;
@@ -26744,9 +26460,9 @@
  		sin->sin_port = inet->sport;
  		sin->sin_addr.s_addr = addr;
  	}
---- a/net/ipv4/devinet.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/net/ipv4/devinet.c	2008-04-19 15:14:52.000000000 -0400
-@@ -421,6 +421,7 @@ struct in_device *inetdev_by_index(struc
+--- a/net/ipv4/devinet.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv4/devinet.c	2008-07-29 17:27:07.000000000 -0400
+@@ -420,6 +420,7 @@ struct in_device *inetdev_by_index(struc
  	return in_dev;
  }
  
@@ -26754,7 +26470,7 @@
  /* Called only from RTNL semaphored context. No locks. */
  
  struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix,
-@@ -672,6 +673,8 @@ int devinet_ioctl(unsigned int cmd, void
+@@ -662,6 +663,8 @@ int devinet_ioctl(struct net *net, unsig
  		*colon = ':';
  
  	if ((in_dev = __in_dev_get_rtnl(dev)) != NULL) {
@@ -26763,7 +26479,7 @@
  		if (tryaddrmatch) {
  			/* Matthias Andree */
  			/* compare label and address (4.4BSD style) */
-@@ -680,6 +683,8 @@ int devinet_ioctl(unsigned int cmd, void
+@@ -670,6 +673,8 @@ int devinet_ioctl(struct net *net, unsig
  			   This is checked above. */
  			for (ifap = &in_dev->ifa_list; (ifa = *ifap) != NULL;
  			     ifap = &ifa->ifa_next) {
@@ -26772,7 +26488,7 @@
  				if (!strcmp(ifr.ifr_name, ifa->ifa_label) &&
  				    sin_orig.sin_addr.s_addr ==
  							ifa->ifa_address) {
-@@ -692,9 +697,12 @@ int devinet_ioctl(unsigned int cmd, void
+@@ -682,9 +687,12 @@ int devinet_ioctl(struct net *net, unsig
  		   comparing just the label */
  		if (!ifa) {
  			for (ifap = &in_dev->ifa_list; (ifa = *ifap) != NULL;
@@ -26786,7 +26502,7 @@
  		}
  	}
  
-@@ -846,6 +854,8 @@ static int inet_gifconf(struct net_devic
+@@ -835,6 +843,8 @@ static int inet_gifconf(struct net_devic
  		goto out;
  
  	for (; ifa; ifa = ifa->ifa_next) {
@@ -26795,15 +26511,15 @@
  		if (!buf) {
  			done += sizeof(ifr);
  			continue;
-@@ -1171,6 +1181,7 @@ static int inet_dump_ifaddr(struct sk_bu
+@@ -1154,6 +1164,7 @@ static int inet_dump_ifaddr(struct sk_bu
  	struct net_device *dev;
  	struct in_device *in_dev;
  	struct in_ifaddr *ifa;
 +	struct sock *sk = skb->sk;
  	int s_ip_idx, s_idx = cb->args[0];
  
- 	if (net != &init_net)
-@@ -1188,6 +1199,8 @@ static int inet_dump_ifaddr(struct sk_bu
+ 	s_ip_idx = ip_idx = cb->args[1];
+@@ -1168,6 +1179,8 @@ static int inet_dump_ifaddr(struct sk_bu
  
  		for (ifa = in_dev->ifa_list, ip_idx = 0; ifa;
  		     ifa = ifa->ifa_next, ip_idx++) {
@@ -26812,19 +26528,19 @@
  			if (ip_idx < s_ip_idx)
  				continue;
  			if (inet_fill_ifaddr(skb, ifa, NETLINK_CB(cb->skb).pid,
---- a/net/ipv4/fib_hash.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/net/ipv4/fib_hash.c	2008-04-19 15:14:52.000000000 -0400
-@@ -1025,7 +1025,7 @@ static int fib_seq_show(struct seq_file 
+--- a/net/ipv4/fib_hash.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv4/fib_hash.c	2008-07-29 17:58:34.000000000 -0400
+@@ -1024,7 +1024,7 @@ static int fib_seq_show(struct seq_file 
  	prefix	= f->fn_key;
  	mask	= FZ_MASK(iter->zone);
  	flags	= fib_flag_trans(fa->fa_type, mask, fi);
 -	if (fi)
 +	if (fi && nx_dev_visible(current->nx_info, fi->fib_dev))
- 		snprintf(bf, sizeof(bf),
- 			 "%s\t%08X\t%08X\t%04X\t%d\t%u\t%d\t%08X\t%d\t%u\t%u",
+ 		seq_printf(seq,
+ 			 "%s\t%08X\t%08X\t%04X\t%d\t%u\t%d\t%08X\t%d\t%u\t%u%n",
  			 fi->fib_dev ? fi->fib_dev->name : "*", prefix,
---- a/net/ipv4/inet_connection_sock.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/net/ipv4/inet_connection_sock.c	2008-04-19 15:14:52.000000000 -0400
+--- a/net/ipv4/inet_connection_sock.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv4/inet_connection_sock.c	2008-07-29 17:27:07.000000000 -0400
 @@ -47,10 +47,40 @@ void inet_get_local_port_range(int *low,
  }
  EXPORT_SYMBOL(inet_get_local_port_range);
@@ -26867,7 +26583,7 @@
  	struct sock *sk2;
  	struct hlist_node *node;
  	int reuse = sk->sk_reuse;
-@@ -63,9 +93,7 @@ int inet_csk_bind_conflict(const struct 
+@@ -70,9 +100,7 @@ int inet_csk_bind_conflict(const struct 
  		     sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) {
  			if (!reuse || !sk2->sk_reuse ||
  			    sk2->sk_state == TCP_LISTEN) {
@@ -26879,7 +26595,7 @@
  			}
  		}
 --- a/net/ipv4/inet_diag.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/net/ipv4/inet_diag.c	2008-04-19 16:05:51.000000000 -0400
++++ a/net/ipv4/inet_diag.c	2008-07-29 17:27:07.000000000 -0400
 @@ -34,6 +34,8 @@
  #include <linux/stddef.h>
  
@@ -26981,8 +26697,8 @@
  				if (num < s_num)
  					goto next_dying;
  				if (r->id.idiag_sport != tw->tw_sport &&
---- a/net/ipv4/inet_hashtables.c	2008-04-17 12:05:44.000000000 -0400
-+++ a/net/ipv4/inet_hashtables.c	2008-04-19 15:14:52.000000000 -0400
+--- a/net/ipv4/inet_hashtables.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv4/inet_hashtables.c	2008-07-29 17:27:07.000000000 -0400
 @@ -21,6 +21,7 @@
  
  #include <net/inet_connection_sock.h>
@@ -26991,7 +26707,7 @@
  #include <net/ip.h>
  
  /*
-@@ -144,11 +145,10 @@ static struct sock *inet_lookup_listener
+@@ -161,11 +162,10 @@ static struct sock *inet_lookup_listener
  			const __be32 rcv_saddr = inet->rcv_saddr;
  			int score = sk->sk_family == PF_INET ? 1 : 0;
  
@@ -27006,17 +26722,17 @@
  			if (sk->sk_bound_dev_if) {
  				if (sk->sk_bound_dev_if != dif)
  					continue;
-@@ -180,7 +180,7 @@ struct sock *__inet_lookup_listener(stru
+@@ -197,7 +197,7 @@ struct sock *__inet_lookup_listener(stru
  		const struct inet_sock *inet = inet_sk((sk = __sk_head(head)));
  
  		if (inet->num == hnum && !sk->sk_node.next &&
 -		    (!inet->rcv_saddr || inet->rcv_saddr == daddr) &&
 +		    v4_inet_addr_match(sk->sk_nx_info, daddr, inet->rcv_saddr) &&
  		    (sk->sk_family == PF_INET || !ipv6_only_sock(sk)) &&
- 		    !sk->sk_bound_dev_if && sk->sk_net == net)
+ 		    !sk->sk_bound_dev_if && net_eq(sock_net(sk), net))
  			goto sherry_cache;
---- a/net/ipv4/netfilter/nf_nat_helper.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/ipv4/netfilter/nf_nat_helper.c	2008-04-19 15:14:52.000000000 -0400
+--- a/net/ipv4/netfilter/nf_nat_helper.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv4/netfilter/nf_nat_helper.c	2008-07-16 22:41:36.000000000 -0400
 @@ -18,6 +18,7 @@
  #include <net/tcp.h>
  
@@ -27025,8 +26741,8 @@
  #include <net/netfilter/nf_conntrack.h>
  #include <net/netfilter/nf_conntrack_helper.h>
  #include <net/netfilter/nf_conntrack_ecache.h>
---- a/net/ipv4/netfilter.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/ipv4/netfilter.c	2008-04-19 15:14:52.000000000 -0400
+--- a/net/ipv4/netfilter.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv4/netfilter.c	2008-07-16 22:41:36.000000000 -0400
 @@ -4,7 +4,7 @@
  #include <linux/netfilter_ipv4.h>
  #include <linux/ip.h>
@@ -27036,18 +26752,18 @@
  #include <net/xfrm.h>
  #include <net/ip.h>
  #include <net/netfilter/nf_queue.h>
---- a/net/ipv4/raw.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/ipv4/raw.c	2008-04-29 20:28:52.000000000 -0400
-@@ -126,7 +126,7 @@ static struct sock *__raw_v4_lookup(stru
+--- a/net/ipv4/raw.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv4/raw.c	2008-07-29 17:31:11.000000000 -0400
+@@ -119,7 +119,7 @@ static struct sock *__raw_v4_lookup(stru
  
- 		if (sk->sk_net == net && inet->num == num 		&&
+ 		if (net_eq(sock_net(sk), net) && inet->num == num	&&
  		    !(inet->daddr && inet->daddr != raddr) 		&&
 -		    !(inet->rcv_saddr && inet->rcv_saddr != laddr)	&&
 +		    v4_sock_addr_match(sk->sk_nx_info, inet, laddr)	&&
  		    !(sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif))
  			goto found; /* gotcha */
  	}
-@@ -382,6 +382,12 @@ static int raw_send_hdrinc(struct sock *
+@@ -373,6 +373,12 @@ static int raw_send_hdrinc(struct sock *
  		icmp_out_count(((struct icmphdr *)
  			skb_transport_header(skb))->type);
  
@@ -27060,7 +26776,7 @@
  	err = NF_HOOK(PF_INET, NF_INET_LOCAL_OUT, skb, NULL, rt->u.dst.dev,
  		      dst_output);
  	if (err > 0)
-@@ -393,6 +399,7 @@ out:
+@@ -384,6 +390,7 @@ out:
  
  error_fault:
  	err = -EFAULT;
@@ -27068,21 +26784,21 @@
  	kfree_skb(skb);
  error:
  	IP_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
-@@ -560,6 +567,13 @@ static int raw_sendmsg(struct kiocb *ioc
+@@ -551,6 +558,13 @@ static int raw_sendmsg(struct kiocb *ioc
  		}
  
  		security_sk_classify_flow(sk, &fl);
 +		if (sk->sk_nx_info) {
-+			err = ip_v4_find_src(sk->sk_net,
++			err = ip_v4_find_src(sock_net(sk),
 +				sk->sk_nx_info, &rt, &fl);
 +
 +			if (err)
 +				goto done;
 +		}
- 		err = ip_route_output_flow(&init_net, &rt, &fl, sk, 1);
+ 		err = ip_route_output_flow(sock_net(sk), &rt, &fl, sk, 1);
  	}
  	if (err)
-@@ -622,17 +636,19 @@ static int raw_bind(struct sock *sk, str
+@@ -621,17 +635,19 @@ static int raw_bind(struct sock *sk, str
  {
  	struct inet_sock *inet = inet_sk(sk);
  	struct sockaddr_in *addr = (struct sockaddr_in *) uaddr;
@@ -27092,9 +26808,9 @@
  
  	if (sk->sk_state != TCP_CLOSE || addr_len < sizeof(struct sockaddr_in))
  		goto out;
--	chk_addr_ret = inet_addr_type(sk->sk_net, addr->sin_addr.s_addr);
+-	chk_addr_ret = inet_addr_type(sock_net(sk), addr->sin_addr.s_addr);
 +	v4_map_sock_addr(inet, addr, &nsa);
-+	chk_addr_ret = inet_addr_type(sk->sk_net, nsa.saddr);
++	chk_addr_ret = inet_addr_type(sock_net(sk), nsa.saddr);
  	ret = -EADDRNOTAVAIL;
 -	if (addr->sin_addr.s_addr && chk_addr_ret != RTN_LOCAL &&
 +	if (nsa.saddr && chk_addr_ret != RTN_LOCAL &&
@@ -27105,7 +26821,7 @@
  	if (chk_addr_ret == RTN_MULTICAST || chk_addr_ret == RTN_BROADCAST)
  		inet->saddr = 0;  /* Use device */
  	sk_dst_reset(sk);
-@@ -684,7 +700,8 @@ static int raw_recvmsg(struct kiocb *ioc
+@@ -683,7 +699,8 @@ static int raw_recvmsg(struct kiocb *ioc
  	/* Copy the address. */
  	if (sin) {
  		sin->sin_family = AF_INET;
@@ -27115,30 +26831,30 @@
  		sin->sin_port = 0;
  		memset(&sin->sin_zero, 0, sizeof(sin->sin_zero));
  	}
-@@ -862,7 +879,8 @@ static struct sock *raw_get_first(struct
+@@ -860,7 +877,8 @@ static struct sock *raw_get_first(struct
  		struct hlist_node *node;
  
  		sk_for_each(sk, node, &state->h->ht[state->bucket])
--			if (sk->sk_net == state->p.net)
-+			if ((sk->sk_net == state->p.net) &&
+-			if (sock_net(sk) == seq_file_net(seq))
++			if ((sock_net(sk) == seq_file_net(seq)) &&
 +				nx_check(sk->sk_nid, VS_WATCH_P | VS_IDENT))
  				goto found;
  	}
  	sk = NULL;
-@@ -878,7 +896,8 @@ static struct sock *raw_get_next(struct 
+@@ -876,7 +894,8 @@ static struct sock *raw_get_next(struct 
  		sk = sk_next(sk);
  try_again:
  		;
--	} while (sk && sk->sk_net != state->p.net);
-+	} while (sk && ((sk->sk_net != state->p.net) ||
+-	} while (sk && sock_net(sk) != seq_file_net(seq));
++	} while (sk && ((sock_net(sk) != seq_file_net(seq)) ||
 +		!nx_check(sk->sk_nid, VS_WATCH_P | VS_IDENT)));
  
  	if (!sk && ++state->bucket < RAW_HTABLE_SIZE) {
  		sk = sk_head(&state->h->ht[state->bucket]);
-@@ -937,7 +956,10 @@ static void raw_sock_seq_show(struct seq
+@@ -935,7 +954,10 @@ static void raw_sock_seq_show(struct seq
  
  	seq_printf(seq, "%4d: %08X:%04X %08X:%04X"
- 		" %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p %d",
+ 		" %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p %d\n",
 -		i, src, srcp, dest, destp, sp->sk_state,
 +		i,
 +		nx_map_sock_lback(current_nx_info(), src), srcp,
@@ -27147,19 +26863,19 @@
  		atomic_read(&sp->sk_wmem_alloc),
  		atomic_read(&sp->sk_rmem_alloc),
  		0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp),
---- a/net/ipv4/syncookies.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/ipv4/syncookies.c	2008-04-19 15:14:52.000000000 -0400
-@@ -20,6 +20,7 @@
+--- a/net/ipv4/syncookies.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv4/syncookies.c	2008-07-16 22:41:36.000000000 -0400
+@@ -18,6 +18,7 @@
  #include <linux/cryptohash.h>
  #include <linux/kernel.h>
  #include <net/tcp.h>
 +#include <net/route.h>
  
- extern int sysctl_tcp_syncookies;
- 
---- a/net/ipv4/tcp.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/ipv4/tcp.c	2008-04-19 15:14:52.000000000 -0400
-@@ -263,6 +263,7 @@
+ /* Timestamps: lowest 9 bits store TCP options */
+ #define TSBITS 9
+--- a/net/ipv4/tcp.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv4/tcp.c	2008-07-16 22:41:36.000000000 -0400
+@@ -266,6 +266,7 @@
  #include <linux/cache.h>
  #include <linux/err.h>
  #include <linux/crypto.h>
@@ -27167,9 +26883,9 @@
  
  #include <net/icmp.h>
  #include <net/tcp.h>
---- a/net/ipv4/tcp_ipv4.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/ipv4/tcp_ipv4.c	2008-04-19 15:14:52.000000000 -0400
-@@ -1965,6 +1965,12 @@ static void *listening_get_next(struct s
+--- a/net/ipv4/tcp_ipv4.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv4/tcp_ipv4.c	2008-07-29 17:42:09.000000000 -0400
+@@ -1959,6 +1959,12 @@ static void *listening_get_next(struct s
  		req = req->dl_next;
  		while (1) {
  			while (req) {
@@ -27179,10 +26895,10 @@
 +				if (req->sk &&
 +					!nx_check(req->sk->sk_nid, VS_WATCH_P | VS_IDENT))
 +					continue;
- 				if (req->rsk_ops->family == st->family) {
+ 				if (req->rsk_ops->family == st->family &&
+ 				    net_eq(sock_net(req->sk), net)) {
  					cur = req;
- 					goto out;
-@@ -1989,6 +1995,10 @@ get_req:
+@@ -1984,6 +1990,10 @@ get_req:
  	}
  get_sk:
  	sk_for_each_from(sk, node) {
@@ -27190,51 +26906,45 @@
 +			sk, sk->sk_nid, nx_current_nid());
 +		if (!nx_check(sk->sk_nid, VS_WATCH_P | VS_IDENT))
 +			continue;
- 		if (sk->sk_family == st->family) {
+ 		if (sk->sk_family == st->family && net_eq(sock_net(sk), net)) {
  			cur = sk;
  			goto out;
-@@ -2038,18 +2048,26 @@ static void *established_get_first(struc
+@@ -2034,6 +2044,11 @@ static void *established_get_first(struc
  
  		read_lock_bh(lock);
  		sk_for_each(sk, node, &tcp_hashinfo.ehash[st->bucket].chain) {
--			if (sk->sk_family != st->family) {
 +			vxdprintk(VXD_CBIT(net, 6),
 +				"sk,egf: %p [#%d] (from %d)",
 +				sk, sk->sk_nid, nx_current_nid());
 +			if (!nx_check(sk->sk_nid, VS_WATCH_P | VS_IDENT))
 +				continue;
-+			if (sk->sk_family != st->family)
+ 			if (sk->sk_family != st->family ||
+ 			    !net_eq(sock_net(sk), net)) {
  				continue;
--			}
- 			rc = sk;
- 			goto out;
- 		}
+@@ -2044,6 +2059,11 @@ static void *established_get_first(struc
  		st->state = TCP_SEQ_STATE_TIME_WAIT;
  		inet_twsk_for_each(tw, node,
  				   &tcp_hashinfo.ehash[st->bucket].twchain) {
--			if (tw->tw_family != st->family) {
 +			vxdprintk(VXD_CBIT(net, 6),
 +				"tw: %p [#%d] (from %d)",
 +				tw, tw->tw_nid, nx_current_nid());
 +			if (!nx_check(tw->tw_nid, VS_WATCH_P | VS_IDENT))
 +				continue;
-+			if (tw->tw_family != st->family)
+ 			if (tw->tw_family != st->family ||
+ 			    !net_eq(twsk_net(tw), net)) {
  				continue;
--			}
- 			rc = tw;
- 			goto out;
- 		}
-@@ -2073,7 +2091,8 @@ static void *established_get_next(struct
+@@ -2072,7 +2092,9 @@ static void *established_get_next(struct
  		tw = cur;
  		tw = tw_next(tw);
  get_tw:
--		while (tw && tw->tw_family != st->family) {
+-		while (tw && (tw->tw_family != st->family || !net_eq(twsk_net(tw), net))) {
 +		while (tw && (tw->tw_family != st->family ||
++			!net_eq(twsk_net(tw), net) ||
 +			!nx_check(tw->tw_nid, VS_WATCH_P | VS_IDENT))) {
  			tw = tw_next(tw);
  		}
  		if (tw) {
-@@ -2094,6 +2113,11 @@ get_tw:
+@@ -2093,6 +2115,11 @@ get_tw:
  		sk = sk_next(sk);
  
  	sk_for_each_from(sk, node) {
@@ -27243,12 +26953,12 @@
 +			sk, sk->sk_nid, nx_current_nid());
 +		if (!nx_check(sk->sk_nid, VS_WATCH_P | VS_IDENT))
 +			continue;
- 		if (sk->sk_family == st->family)
+ 		if (sk->sk_family == st->family && net_eq(sock_net(sk), net))
  			goto found;
  	}
-@@ -2266,9 +2290,9 @@ static void get_openreq4(struct sock *sk
- 	sprintf(tmpbuf, "%4d: %08X:%04X %08X:%04X"
- 		" %02X %08X:%08X %02X:%08lX %08X %5d %8d %u %d %p",
+@@ -2247,9 +2274,9 @@ static void get_openreq4(struct sock *sk
+ 	seq_printf(f, "%4d: %08X:%04X %08X:%04X"
+ 		" %02X %08X:%08X %02X:%08lX %08X %5d %8d %u %d %p%n",
  		i,
 -		ireq->loc_addr,
 +		nx_map_sock_lback(current_nx_info(), ireq->loc_addr),
@@ -27258,10 +26968,10 @@
  		ntohs(ireq->rmt_port),
  		TCP_SYN_RECV,
  		0, 0, /* could print option size, but that is af dependent. */
-@@ -2310,7 +2334,10 @@ static void get_tcp4_sock(struct sock *s
+@@ -2292,7 +2319,10 @@ static void get_tcp4_sock(struct sock *s
  
- 	sprintf(tmpbuf, "%4d: %08X:%04X %08X:%04X %02X %08X:%08X %02X:%08lX "
- 			"%08X %5d %8d %lu %d %p %u %u %u %u %d",
+ 	seq_printf(f, "%4d: %08X:%04X %08X:%04X %02X %08X:%08X %02X:%08lX "
+ 			"%08X %5d %8d %lu %d %p %lu %lu %u %u %d%n",
 -		i, src, srcp, dest, destp, sk->sk_state,
 +		i,
 +		nx_map_sock_lback(current_nx_info(), src), srcp,
@@ -27270,20 +26980,20 @@
  		tp->write_seq - tp->snd_una,
  		sk->sk_state == TCP_LISTEN ? sk->sk_ack_backlog :
  					     (tp->rcv_nxt - tp->copied_seq),
-@@ -2345,7 +2372,10 @@ static void get_timewait4_sock(struct in
+@@ -2328,7 +2358,10 @@ static void get_timewait4_sock(struct in
  
- 	sprintf(tmpbuf, "%4d: %08X:%04X %08X:%04X"
- 		" %02X %08X:%08X %02X:%08lX %08X %5d %8d %d %d %p",
+ 	seq_printf(f, "%4d: %08X:%04X %08X:%04X"
+ 		" %02X %08X:%08X %02X:%08lX %08X %5d %8d %d %d %p%n",
 -		i, src, srcp, dest, destp, tw->tw_substate, 0, 0,
 +		i,
 +		nx_map_sock_lback(current_nx_info(), src), srcp,
 +		nx_map_sock_lback(current_nx_info(), dest), destp,
 +		tw->tw_substate, 0, 0,
  		3, jiffies_to_clock_t(ttd), 0, 0, 0, 0,
- 		atomic_read(&tw->tw_refcnt), tw);
+ 		atomic_read(&tw->tw_refcnt), tw, len);
  }
---- a/net/ipv4/tcp_minisocks.c	2008-04-17 11:31:40.000000000 -0400
-+++ a/net/ipv4/tcp_minisocks.c	2008-04-19 15:14:52.000000000 -0400
+--- a/net/ipv4/tcp_minisocks.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv4/tcp_minisocks.c	2008-07-29 17:27:07.000000000 -0400
 @@ -28,6 +28,10 @@
  #include <net/inet_common.h>
  #include <net/xfrm.h>
@@ -27295,7 +27005,7 @@
  #ifdef CONFIG_SYSCTL
  #define SYNC_INIT 0 /* let the user enable it */
  #else
-@@ -293,6 +297,11 @@ void tcp_time_wait(struct sock *sk, int 
+@@ -295,6 +299,11 @@ void tcp_time_wait(struct sock *sk, int 
  		tcptw->tw_ts_recent	= tp->rx_opt.ts_recent;
  		tcptw->tw_ts_recent_stamp = tp->rx_opt.ts_recent_stamp;
  
@@ -27307,13 +27017,13 @@
  #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
  		if (tw->tw_family == PF_INET6) {
  			struct ipv6_pinfo *np = inet6_sk(sk);
---- a/net/ipv4/udp.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/ipv4/udp.c	2008-04-21 12:41:01.000000000 -0400
-@@ -246,14 +246,7 @@ int udp_get_port(struct sock *sk, unsign
- 	return  __udp_lib_get_port(sk, snum, udp_hash, scmp);
+--- a/net/ipv4/udp.c	2008-08-12 01:41:51.000000000 -0400
++++ a/net/ipv4/udp.c	2008-08-12 01:42:21.000000000 -0400
+@@ -239,20 +239,14 @@ fail:
+ 	return error;
  }
  
--int ipv4_rcv_saddr_equal(const struct sock *sk1, const struct sock *sk2)
+-static int ipv4_rcv_saddr_equal(const struct sock *sk1, const struct sock *sk2)
 -{
 -	struct inet_sock *inet1 = inet_sk(sk1), *inet2 = inet_sk(sk2);
 -
@@ -27321,19 +27031,19 @@
 -		  (!inet1->rcv_saddr || !inet2->rcv_saddr ||
 -		   inet1->rcv_saddr == inet2->rcv_saddr      ));
 -}
-+extern int ipv4_rcv_saddr_equal(const struct sock *sk1, const struct sock *sk2);
++extern int ipv4_rcv_saddr_equal(const struct sock *, const struct sock *);
  
- static inline int udp_v4_get_port(struct sock *sk, unsigned short snum)
+ int udp_v4_get_port(struct sock *sk, unsigned short snum)
  {
-@@ -273,16 +266,23 @@ static struct sock *__udp4_lib_lookup(st
- 	int badness = -1;
+ 	return udp_lib_get_port(sk, snum, ipv4_rcv_saddr_equal);
+ }
  
- 	read_lock(&udp_hash_lock);
 +
- 	sk_for_each(sk, node, &udptable[hnum & (UDP_HTABLE_SIZE - 1)]) {
- 		struct inet_sock *inet = inet_sk(sk);
- 
- 		if (sk->sk_net == net && sk->sk_hash == hnum &&
+ /* UDP is nearly always wildcards out the wazoo, it makes no sense to try
+  * harder than this. -DaveM
+  */
+@@ -272,10 +266,16 @@ static struct sock *__udp4_lib_lookup(st
+ 		if (net_eq(sock_net(sk), net) && sk->sk_hash == hnum &&
  				!ipv6_only_sock(sk)) {
  			int score = (sk->sk_family == PF_INET ? 1 : 0);
 +
@@ -27349,7 +27059,7 @@
  			}
  			if (inet->daddr) {
  				if (inet->daddr != saddr)
-@@ -308,6 +308,7 @@ static struct sock *__udp4_lib_lookup(st
+@@ -301,6 +301,7 @@ static struct sock *__udp4_lib_lookup(st
  			}
  		}
  	}
@@ -27357,7 +27067,7 @@
  	if (result)
  		sock_hold(result);
  	read_unlock(&udp_hash_lock);
-@@ -329,7 +330,7 @@ static inline struct sock *udp_v4_mcast_
+@@ -322,7 +323,7 @@ static inline struct sock *udp_v4_mcast_
  		if (s->sk_hash != hnum					||
  		    (inet->daddr && inet->daddr != rmt_addr)		||
  		    (inet->dport != rmt_port && inet->dport)		||
@@ -27366,12 +27076,12 @@
  		    ipv6_only_sock(s)					||
  		    (s->sk_bound_dev_if && s->sk_bound_dev_if != dif))
  			continue;
-@@ -662,7 +663,15 @@ int udp_sendmsg(struct kiocb *iocb, stru
+@@ -656,7 +657,15 @@ int udp_sendmsg(struct kiocb *iocb, stru
  				    .uli_u = { .ports =
  					       { .sport = inet->sport,
  						 .dport = dport } } };
 +		struct nx_info *nxi = sk->sk_nx_info;
-+		struct net *net = sk->sk_net;
++		struct net *net = sock_net(sk);
 +
  		security_sk_classify_flow(sk, &fl);
 +
@@ -27379,10 +27089,10 @@
 +		if (err)
 +			goto out;
 +
- 		err = ip_route_output_flow(&init_net, &rt, &fl, sk, 1);
+ 		err = ip_route_output_flow(sock_net(sk), &rt, &fl, sk, 1);
  		if (err) {
  			if (err == -ENETUNREACH)
-@@ -905,7 +914,8 @@ try_again:
+@@ -899,7 +908,8 @@ try_again:
  	{
  		sin->sin_family = AF_INET;
  		sin->sin_port = udp_hdr(skb)->source;
@@ -27392,30 +27102,30 @@
  		memset(sin->sin_zero, 0, sizeof(sin->sin_zero));
  	}
  	if (inet->cmsg_flags)
-@@ -1516,7 +1526,8 @@ static struct sock *udp_get_first(struct
- 	for (state->bucket = 0; state->bucket < UDP_HTABLE_SIZE; ++state->bucket) {
- 		struct hlist_node *node;
+@@ -1515,6 +1525,8 @@ static struct sock *udp_get_first(struct
  		sk_for_each(sk, node, state->hashtable + state->bucket) {
--			if (sk->sk_family == state->family)
-+			if (sk->sk_family == state->family &&
-+				nx_check(sk->sk_nid, VS_WATCH_P | VS_IDENT))
+ 			if (!net_eq(sock_net(sk), net))
+ 				continue;
++			if (!nx_check(sk->sk_nid, VS_WATCH_P | VS_IDENT))
++				continue;
+ 			if (sk->sk_family == state->family)
  				goto found;
  		}
- 	}
-@@ -1533,7 +1544,8 @@ static struct sock *udp_get_next(struct 
+@@ -1533,7 +1545,9 @@ static struct sock *udp_get_next(struct 
  		sk = sk_next(sk);
  try_again:
  		;
--	} while (sk && sk->sk_family != state->family);
-+	} while (sk && (sk->sk_family != state->family ||
+-	} while (sk && (!net_eq(sock_net(sk), net) || sk->sk_family != state->family));
++	} while (sk && (!net_eq(sock_net(sk), net) ||
++		sk->sk_family != state->family ||
 +		!nx_check(sk->sk_nid, VS_WATCH_P | VS_IDENT)));
  
  	if (!sk && ++state->bucket < UDP_HTABLE_SIZE) {
  		sk = sk_head(state->hashtable + state->bucket);
-@@ -1648,7 +1660,10 @@ static void udp4_format_sock(struct sock
+@@ -1634,7 +1648,10 @@ static void udp4_format_sock(struct sock
  
- 	sprintf(tmpbuf, "%4d: %08X:%04X %08X:%04X"
- 		" %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p",
+ 	seq_printf(f, "%4d: %08X:%04X %08X:%04X"
+ 		" %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p%n",
 -		bucket, src, srcp, dest, destp, sp->sk_state,
 +		bucket,
 +		nx_map_sock_lback(current_nx_info(), src), srcp,
@@ -27424,8 +27134,8 @@
  		atomic_read(&sp->sk_wmem_alloc),
  		atomic_read(&sp->sk_rmem_alloc),
  		0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp),
---- a/net/ipv6/addrconf.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/ipv6/addrconf.c	2008-04-19 16:44:23.000000000 -0400
+--- a/net/ipv6/addrconf.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv6/addrconf.c	2008-07-29 18:55:29.000000000 -0400
 @@ -87,6 +87,8 @@
  
  #include <linux/proc_fs.h>
@@ -27435,41 +27145,16 @@
  
  /* Set to 3 to get tracing... */
  #define ACONF_DEBUG 2
-@@ -918,7 +920,8 @@ static inline int ipv6_saddr_preferred(i
- }
+@@ -1078,7 +1080,7 @@ out:
  
- int ipv6_dev_get_saddr(struct net_device *daddr_dev,
--		       struct in6_addr *daddr, struct in6_addr *saddr)
-+		       struct in6_addr *daddr, struct in6_addr *saddr,
-+		       struct nx_info *nxi)
- {
- 	struct ipv6_saddr_score hiscore;
- 	struct inet6_ifaddr *ifa_result = NULL;
-@@ -964,6 +967,10 @@ int ipv6_dev_get_saddr(struct net_device
- 
- 			score.addr_type = __ipv6_addr_type(&ifa->addr);
- 
-+			/* Use only addresses assigned to the context */
-+			if (!v6_ifa_in_nx_info(ifa, nxi))
-+				continue;
-+
- 			/* Rule 0:
- 			 * - Tentative Address (RFC2462 section 5.4)
- 			 *  - A tentative address is not considered
-@@ -1181,9 +1188,10 @@ record_it:
- 
- 
- int ipv6_get_saddr(struct dst_entry *dst,
--		   struct in6_addr *daddr, struct in6_addr *saddr)
-+		   struct in6_addr *daddr, struct in6_addr *saddr,
-+		   struct nx_info *nxi)
- {
--	return ipv6_dev_get_saddr(dst ? ip6_dst_idev(dst)->dev : NULL, daddr, saddr);
-+	return ipv6_dev_get_saddr(dst ? ip6_dst_idev(dst)->dev : NULL, daddr, saddr, nxi);
- }
- 
- EXPORT_SYMBOL(ipv6_get_saddr);
-@@ -1287,35 +1295,46 @@ struct inet6_ifaddr *ipv6_get_ifaddr(str
+ int ipv6_dev_get_saddr(struct net_device *dst_dev,
+ 		       const struct in6_addr *daddr, unsigned int prefs,
+-		       struct in6_addr *saddr)
++		       struct in6_addr *saddr, struct nx_info *nxi)
+ {
+ 	struct ipv6_saddr_score scores[2],
+ 				*score = &scores[0], *hiscore = &scores[1];
+@@ -1335,35 +1337,46 @@ struct inet6_ifaddr *ipv6_get_ifaddr(str
  	return ifp;
  }
  
@@ -27521,7 +27206,7 @@
  		return 1;
  
  	return 0;
-@@ -2846,7 +2865,10 @@ static void if6_seq_stop(struct seq_file
+@@ -2935,7 +2948,10 @@ static void if6_seq_stop(struct seq_file
  static int if6_seq_show(struct seq_file *seq, void *v)
  {
  	struct inet6_ifaddr *ifp = (struct inet6_ifaddr *)v;
@@ -27533,19 +27218,20 @@
  		   NIP6_SEQFMT " %02x %02x %02x %02x %8s\n",
  		   NIP6(ifp->addr),
  		   ifp->idev->dev->ifindex,
-@@ -3337,6 +3359,11 @@ static int inet6_dump_addr(struct sk_buf
- 	struct inet6_ifaddr *ifa;
+@@ -3430,6 +3446,12 @@ static int inet6_dump_addr(struct sk_buf
  	struct ifmcaddr6 *ifmca;
  	struct ifacaddr6 *ifaca;
+ 	struct net *net = sock_net(skb->sk);
 +	struct nx_info *nxi = skb->sk ? skb->sk->sk_nx_info : NULL;
 +
 +	/* disable ipv6 on non v6 guests */
 +	if (nxi && !nx_info_has_v6(nxi))
 +		return skb->len;
++
  
  	s_idx = cb->args[0];
  	s_ip_idx = ip_idx = cb->args[1];
-@@ -3358,6 +3385,8 @@ static int inet6_dump_addr(struct sk_buf
+@@ -3451,6 +3473,8 @@ static int inet6_dump_addr(struct sk_buf
  			     ifa = ifa->if_next, ip_idx++) {
  				if (ip_idx < s_ip_idx)
  					continue;
@@ -27554,25 +27240,25 @@
  				err = inet6_fill_ifaddr(skb, ifa,
  							NETLINK_CB(cb->skb).pid,
  							cb->nlh->nlmsg_seq,
-@@ -3371,6 +3400,8 @@ static int inet6_dump_addr(struct sk_buf
+@@ -3464,6 +3488,8 @@ static int inet6_dump_addr(struct sk_buf
  			     ifmca = ifmca->next, ip_idx++) {
  				if (ip_idx < s_ip_idx)
  					continue;
-+				if (!v6_addr_in_nx_info(nxi, &ifa->addr, -1))
++				if (!v6_addr_in_nx_info(nxi, &ifmca->mca_addr, -1))
 +					continue;
  				err = inet6_fill_ifmcaddr(skb, ifmca,
  							  NETLINK_CB(cb->skb).pid,
  							  cb->nlh->nlmsg_seq,
-@@ -3384,6 +3415,8 @@ static int inet6_dump_addr(struct sk_buf
+@@ -3477,6 +3503,8 @@ static int inet6_dump_addr(struct sk_buf
  			     ifaca = ifaca->aca_next, ip_idx++) {
  				if (ip_idx < s_ip_idx)
  					continue;
-+				if (!v6_addr_in_nx_info(nxi, &ifa->addr, -1))
++				if (!v6_addr_in_nx_info(nxi, &ifaca->aca_addr, -1))
 +					continue;
  				err = inet6_fill_ifacaddr(skb, ifaca,
  							  NETLINK_CB(cb->skb).pid,
  							  cb->nlh->nlmsg_seq,
-@@ -3678,6 +3711,11 @@ static int inet6_dump_ifinfo(struct sk_b
+@@ -3760,12 +3788,19 @@ static int inet6_dump_ifinfo(struct sk_b
  	int s_idx = cb->args[0];
  	struct net_device *dev;
  	struct inet6_dev *idev;
@@ -27582,10 +27268,9 @@
 +	if (skb->sk && skb->sk->sk_vx_info)
 +		return skb->len; */
  
- 	if (net != &init_net)
- 		return 0;
-@@ -3687,6 +3725,8 @@ static int inet6_dump_ifinfo(struct sk_b
- 	for_each_netdev(&init_net, dev) {
+ 	read_lock(&dev_base_lock);
+ 	idx = 0;
+ 	for_each_netdev(net, dev) {
  		if (idx < s_idx)
  			goto cont;
 +		if (!v6_dev_in_nx_info(dev, nxi))
@@ -27593,8 +27278,8 @@
  		if ((idev = in6_dev_get(dev)) == NULL)
  			goto cont;
  		err = inet6_fill_ifinfo(skb, idev, NETLINK_CB(cb->skb).pid,
---- a/net/ipv6/af_inet6.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/ipv6/af_inet6.c	2008-04-19 15:14:52.000000000 -0400
+--- a/net/ipv6/af_inet6.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv6/af_inet6.c	2008-07-29 18:22:35.000000000 -0400
 @@ -43,6 +43,8 @@
  #include <linux/netdevice.h>
  #include <linux/icmpv6.h>
@@ -27626,15 +27311,15 @@
  	sock->ops = answer->ops;
  	answer_prot = answer->prot;
  	answer_no_check = answer->no_check;
-@@ -248,6 +254,7 @@ int inet6_bind(struct socket *sock, stru
- 	struct sock *sk = sock->sk;
+@@ -249,6 +255,7 @@ int inet6_bind(struct socket *sock, stru
  	struct inet_sock *inet = inet_sk(sk);
  	struct ipv6_pinfo *np = inet6_sk(sk);
+ 	struct net *net = sock_net(sk);
 +	struct nx_v6_sock_addr nsa;
  	__be32 v4addr = 0;
  	unsigned short snum;
  	int addr_type = 0;
-@@ -259,6 +266,11 @@ int inet6_bind(struct socket *sock, stru
+@@ -260,6 +267,11 @@ int inet6_bind(struct socket *sock, stru
  
  	if (addr_len < SIN6_LEN_RFC2133)
  		return -EINVAL;
@@ -27646,7 +27331,7 @@
  	addr_type = ipv6_addr_type(&addr->sin6_addr);
  	if ((addr_type & IPV6_ADDR_MULTICAST) && sock->type == SOCK_STREAM)
  		return -EINVAL;
-@@ -282,6 +294,10 @@ int inet6_bind(struct socket *sock, stru
+@@ -283,6 +295,10 @@ int inet6_bind(struct socket *sock, stru
  			err = -EADDRNOTAVAIL;
  			goto out;
  		}
@@ -27657,7 +27342,7 @@
  	} else {
  		if (addr_type != IPV6_ADDR_ANY) {
  			struct net_device *dev = NULL;
-@@ -307,6 +323,11 @@ int inet6_bind(struct socket *sock, stru
+@@ -308,6 +324,11 @@ int inet6_bind(struct socket *sock, stru
  				}
  			}
  
@@ -27669,7 +27354,7 @@
  			/* ipv4 addr of the socket is invalid.  Only the
  			 * unspecified and mapped address have a v4 equivalent.
  			 */
-@@ -325,6 +346,8 @@ int inet6_bind(struct socket *sock, stru
+@@ -326,6 +347,8 @@ int inet6_bind(struct socket *sock, stru
  		}
  	}
  
@@ -27678,7 +27363,7 @@
  	inet->rcv_saddr = v4addr;
  	inet->saddr = v4addr;
  
-@@ -419,9 +442,11 @@ int inet6_getname(struct socket *sock, s
+@@ -420,9 +443,11 @@ int inet6_getname(struct socket *sock, s
  			return -ENOTCONN;
  		sin->sin6_port = inet->dport;
  		ipv6_addr_copy(&sin->sin6_addr, &np->daddr);
@@ -27690,19 +27375,19 @@
  		if (ipv6_addr_any(&np->rcv_saddr))
  			ipv6_addr_copy(&sin->sin6_addr, &np->saddr);
  		else
---- a/net/ipv6/fib6_rules.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/ipv6/fib6_rules.c	2008-04-19 15:14:52.000000000 -0400
-@@ -86,7 +86,7 @@ static int fib6_rule_action(struct fib_r
- 		    r->src.plen && !(flags & RT6_LOOKUP_F_HAS_SADDR)) {
- 			struct in6_addr saddr;
- 			if (ipv6_get_saddr(&rt->u.dst, &flp->fl6_dst,
--					   &saddr))
-+					   &saddr, NULL))
+--- a/net/ipv6/fib6_rules.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv6/fib6_rules.c	2008-07-29 18:23:01.000000000 -0400
+@@ -95,7 +95,7 @@ static int fib6_rule_action(struct fib_r
+ 
+ 			if (ipv6_dev_get_saddr(ip6_dst_idev(&rt->u.dst)->dev,
+ 					       &flp->fl6_dst, srcprefs,
+-					       &saddr))
++					       &saddr, NULL))
  				goto again;
  			if (!ipv6_prefix_equal(&saddr, &r->src.addr,
  					       r->src.plen))
---- a/net/ipv6/inet6_hashtables.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/ipv6/inet6_hashtables.c	2008-04-19 15:14:52.000000000 -0400
+--- a/net/ipv6/inet6_hashtables.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv6/inet6_hashtables.c	2008-07-29 18:12:38.000000000 -0400
 @@ -16,6 +16,7 @@
  
  #include <linux/module.h>
@@ -27721,23 +27406,23 @@
  			}
  			if (sk->sk_bound_dev_if) {
  				if (sk->sk_bound_dev_if != dif)
---- a/net/ipv6/ip6_output.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/ipv6/ip6_output.c	2008-04-19 15:14:52.000000000 -0400
-@@ -920,7 +920,7 @@ static int ip6_dst_lookup_tail(struct so
- 		goto out_err_release;
- 
- 	if (ipv6_addr_any(&fl->fl6_src)) {
--		err = ipv6_get_saddr(*dst, &fl->fl6_dst, &fl->fl6_src);
-+		err = ipv6_get_saddr(*dst, &fl->fl6_dst, &fl->fl6_src, sk->sk_nx_info);
+--- a/net/ipv6/ip6_output.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv6/ip6_output.c	2008-07-29 18:25:00.000000000 -0400
+@@ -924,7 +924,7 @@ static int ip6_dst_lookup_tail(struct so
+ 		err = ipv6_dev_get_saddr(ip6_dst_idev(*dst)->dev,
+ 					 &fl->fl6_dst,
+ 					 sk ? inet6_sk(sk)->srcprefs : 0,
+-					 &fl->fl6_src);
++					 &fl->fl6_src, sk->sk_nx_info);
  		if (err)
  			goto out_err_release;
  	}
---- a/net/ipv6/Kconfig	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/ipv6/Kconfig	2008-04-19 15:14:52.000000000 -0400
+--- a/net/ipv6/Kconfig	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv6/Kconfig	2008-07-29 18:21:01.000000000 -0400
 @@ -4,8 +4,8 @@
  
  #   IPv6 as module will cause a CRASH if you try to unload it
- config IPV6
+ menuconfig IPV6
 -	tristate "The IPv6 protocol"
 -	default m
 +	bool "The IPv6 protocol"
@@ -27745,39 +27430,40 @@
  	---help---
  	  This is complemental support for the IP version 6.
  	  You will still be able to do traditional IPv4 networking as well.
---- a/net/ipv6/ndisc.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/ipv6/ndisc.c	2008-04-19 15:14:52.000000000 -0400
-@@ -563,7 +563,7 @@ static void ndisc_send_na(struct net_dev
- 			override = 0;
- 		in6_ifa_put(ifp);
+--- a/net/ipv6/ndisc.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv6/ndisc.c	2008-07-29 18:19:07.000000000 -0400
+@@ -551,7 +551,7 @@ static void ndisc_send_na(struct net_dev
  	} else {
--		if (ipv6_dev_get_saddr(dev, daddr, &tmpaddr))
-+		if (ipv6_dev_get_saddr(dev, daddr, &tmpaddr, NULL))
+ 		if (ipv6_dev_get_saddr(dev, daddr,
+ 				       inet6_sk(dev_net(dev)->ipv6.ndisc_sk)->srcprefs,
+-				       &tmpaddr))
++				       &tmpaddr, NULL /* FIXME: ? */ ))
  			return;
  		src_addr = &tmpaddr;
  	}
---- a/net/ipv6/route.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/ipv6/route.c	2008-04-19 15:14:52.000000000 -0400
-@@ -2122,7 +2122,7 @@ static int rt6_fill_node(struct sk_buff 
- 		NLA_PUT_U32(skb, RTA_IIF, iif);
- 	else if (dst) {
+--- a/net/ipv6/route.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv6/route.c	2008-07-29 18:56:21.000000000 -0400
+@@ -2181,7 +2181,8 @@ static int rt6_fill_node(struct sk_buff 
+ 	} else if (dst) {
  		struct in6_addr saddr_buf;
--		if (ipv6_get_saddr(&rt->u.dst, dst, &saddr_buf) == 0)
-+		if (ipv6_get_saddr(&rt->u.dst, dst, &saddr_buf, (skb->sk ? skb->sk->sk_nx_info : NULL)) == 0)
+ 		if (ipv6_dev_get_saddr(ip6_dst_idev(&rt->u.dst)->dev,
+-				       dst, 0, &saddr_buf) == 0)
++			dst, 0, &saddr_buf,
++			(skb->sk ? skb->sk->sk_nx_info : NULL)) == 0)
  			NLA_PUT(skb, RTA_PREFSRC, 16, &saddr_buf);
  	}
  
---- a/net/ipv6/tcp_ipv6.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/ipv6/tcp_ipv6.c	2008-04-19 15:14:52.000000000 -0400
-@@ -68,6 +68,7 @@
+--- a/net/ipv6/tcp_ipv6.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv6/tcp_ipv6.c	2008-07-29 18:12:38.000000000 -0400
+@@ -69,6 +69,7 @@
  
  #include <linux/crypto.h>
  #include <linux/scatterlist.h>
 +#include <linux/vs_inet6.h>
  
- /* Socket used for sending RSTs and ACKs */
- static struct socket *tcp6_socket;
-@@ -154,8 +155,15 @@ static int tcp_v6_connect(struct sock *s
+ static void	tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb);
+ static void	tcp_v6_reqsk_send_ack(struct sk_buff *skb, struct request_sock *req);
+@@ -152,8 +153,15 @@ static int tcp_v6_connect(struct sock *s
  	 *	connect() to INADDR_ANY means loopback (BSD'ism).
  	 */
  
@@ -27795,8 +27481,8 @@
  
  	addr_type = ipv6_addr_type(&usin->sin6_addr);
  
---- a/net/ipv6/udp.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/ipv6/udp.c	2008-04-19 15:14:52.000000000 -0400
+--- a/net/ipv6/udp.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv6/udp.c	2008-07-29 18:12:38.000000000 -0400
 @@ -49,6 +49,7 @@
  
  #include <linux/proc_fs.h>
@@ -27804,7 +27490,7 @@
 +#include <linux/vs_inet6.h>
  #include "udp_impl.h"
  
- static inline int udp_v6_get_port(struct sock *sk, unsigned short snum)
+ int udp_v6_get_port(struct sock *sk, unsigned short snum)
 @@ -83,6 +84,10 @@ static struct sock *__udp6_lib_lookup(st
  				if (!ipv6_addr_equal(&np->rcv_saddr, daddr))
  					continue;
@@ -27816,22 +27502,22 @@
  			}
  			if (!ipv6_addr_any(&np->daddr)) {
  				if (!ipv6_addr_equal(&np->daddr, saddr))
---- a/net/ipv6/xfrm6_policy.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/ipv6/xfrm6_policy.c	2008-04-19 16:13:21.000000000 -0400
-@@ -58,7 +58,7 @@ static int xfrm6_get_saddr(xfrm_address_
- 		return -EHOSTUNREACH;
- 
- 	ipv6_get_saddr(dst, (struct in6_addr *)&daddr->a6,
--		       (struct in6_addr *)&saddr->a6);
-+		       (struct in6_addr *)&saddr->a6, NULL);
+--- a/net/ipv6/xfrm6_policy.c	2008-07-14 17:22:58.000000000 -0400
++++ a/net/ipv6/xfrm6_policy.c	2008-07-29 18:21:53.000000000 -0400
+@@ -59,7 +59,7 @@ static int xfrm6_get_saddr(xfrm_address_
+ 
+ 	ipv6_dev_get_saddr(ip6_dst_idev(dst)->dev,
+ 			   (struct in6_addr *)&daddr->a6, 0,
+-			   (struct in6_addr *)&saddr->a6);
++			   (struct in6_addr *)&saddr->a6, NULL);
  	dst_release(dst);
  	return 0;
  }
---- a/net/netlink/af_netlink.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/netlink/af_netlink.c	2008-04-19 15:14:52.000000000 -0400
-@@ -56,6 +56,9 @@
+--- a/net/netlink/af_netlink.c	2008-07-14 17:23:03.000000000 -0400
++++ a/net/netlink/af_netlink.c	2008-07-16 22:51:45.000000000 -0400
+@@ -55,6 +55,9 @@
+ #include <linux/types.h>
  #include <linux/audit.h>
- #include <linux/selinux.h>
  #include <linux/mutex.h>
 +#include <linux/vs_context.h>
 +#include <linux/vs_network.h>
@@ -27839,19 +27525,49 @@
  
  #include <net/net_namespace.h>
  #include <net/sock.h>
---- a/net/sctp/ipv6.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/sctp/ipv6.c	2008-04-19 15:14:52.000000000 -0400
-@@ -316,7 +316,7 @@ static void sctp_v6_get_saddr(struct sct
- 			  __FUNCTION__, asoc, dst, NIP6(daddr->v6.sin6_addr));
- 
- 	if (!asoc) {
--		ipv6_get_saddr(dst, &daddr->v6.sin6_addr,&saddr->v6.sin6_addr);
-+		ipv6_get_saddr(dst, &daddr->v6.sin6_addr,&saddr->v6.sin6_addr, asoc->base.sk->sk_nx_info);
+@@ -1760,6 +1763,8 @@ static struct sock *netlink_seq_socket_i
+ 			sk_for_each(s, node, &hash->table[j]) {
+ 				if (sock_net(s) != seq_file_net(seq))
+ 					continue;
++				if (!nx_check(s->sk_nid, VS_WATCH_P | VS_IDENT))
++					continue;
+ 				if (off == pos) {
+ 					iter->link = i;
+ 					iter->hash_idx = j;
+@@ -1794,7 +1799,8 @@ static void *netlink_seq_next(struct seq
+ 	s = v;
+ 	do {
+ 		s = sk_next(s);
+-	} while (s && sock_net(s) != seq_file_net(seq));
++	} while (s && (sock_net(s) != seq_file_net(seq) ||
++		!nx_check(s->sk_nid, VS_WATCH_P | VS_IDENT)));
+ 	if (s)
+ 		return s;
+ 
+@@ -1806,7 +1812,8 @@ static void *netlink_seq_next(struct seq
+ 
+ 		for (; j <= hash->mask; j++) {
+ 			s = sk_head(&hash->table[j]);
+-			while (s && sock_net(s) != seq_file_net(seq))
++			while (s && (sock_net(s) != seq_file_net(seq) ||
++				!nx_check(s->sk_nid, VS_WATCH_P | VS_IDENT)))
+ 				s = sk_next(s);
+ 			if (s) {
+ 				iter->link = i;
+--- a/net/sctp/ipv6.c	2008-07-14 17:23:04.000000000 -0400
++++ a/net/sctp/ipv6.c	2008-07-29 18:16:30.000000000 -0400
+@@ -320,7 +320,8 @@ static void sctp_v6_get_saddr(struct sct
+ 		ipv6_dev_get_saddr(dst ? ip6_dst_idev(dst)->dev : NULL,
+ 				   &daddr->v6.sin6_addr,
+ 				   inet6_sk(&sk->inet.sk)->srcprefs,
+-				   &saddr->v6.sin6_addr);
++				   &saddr->v6.sin6_addr,
++				   asoc->base.sk->sk_nx_info);
  		SCTP_DEBUG_PRINTK("saddr from ipv6_get_saddr: " NIP6_FMT "\n",
  				  NIP6(saddr->v6.sin6_addr));
  		return;
---- a/net/socket.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/socket.c	2008-04-19 15:14:52.000000000 -0400
+--- a/net/socket.c	2008-07-14 17:23:05.000000000 -0400
++++ a/net/socket.c	2008-07-29 18:12:38.000000000 -0400
 @@ -93,6 +93,10 @@
  
  #include <net/sock.h>
@@ -27960,34 +27676,27 @@
  
  	err = sock1->ops->socketpair(sock1, sock2);
  	if (err < 0)
---- a/net/sunrpc/auth.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/sunrpc/auth.c	2008-04-19 15:14:52.000000000 -0400
-@@ -13,6 +13,7 @@
- #include <linux/errno.h>
+--- a/net/sunrpc/auth.c	2008-07-14 17:23:05.000000000 -0400
++++ a/net/sunrpc/auth.c	2008-07-16 22:41:36.000000000 -0400
+@@ -14,6 +14,7 @@
+ #include <linux/hash.h>
  #include <linux/sunrpc/clnt.h>
  #include <linux/spinlock.h>
 +#include <linux/vs_tag.h>
  
  #ifdef RPC_DEBUG
  # define RPCDBG_FACILITY	RPCDBG_AUTH
-@@ -345,6 +346,7 @@ rpcauth_lookupcred(struct rpc_auth *auth
+@@ -353,6 +354,8 @@ rpcauth_lookupcred(struct rpc_auth *auth
  	struct auth_cred acred = {
  		.uid = current->fsuid,
  		.gid = current->fsgid,
 +		.tag = dx_current_tag(),
- 		.group_info = current->group_info,
- 	};
- 	struct rpc_cred *ret;
-@@ -382,6 +384,7 @@ rpcauth_bindcred(struct rpc_task *task)
- 	struct auth_cred acred = {
- 		.uid = current->fsuid,
- 		.gid = current->fsgid,
 +		.tag = dx_current_tag(),
  		.group_info = current->group_info,
  	};
  	struct rpc_cred *ret;
---- a/net/sunrpc/auth_unix.c	2008-04-17 10:37:27.000000000 -0400
-+++ a/net/sunrpc/auth_unix.c	2008-04-19 15:14:52.000000000 -0400
+--- a/net/sunrpc/auth_unix.c	2008-07-14 17:23:05.000000000 -0400
++++ a/net/sunrpc/auth_unix.c	2008-07-17 16:38:01.000000000 -0400
 @@ -11,12 +11,14 @@
  #include <linux/module.h>
  #include <linux/sunrpc/clnt.h>
@@ -28003,33 +27712,26 @@
  	gid_t			uc_gids[NFS_NGROUPS];
  };
  #define uc_uid			uc_base.cr_uid
-@@ -73,6 +75,7 @@ unx_create_cred(struct rpc_auth *auth, s
- 	if (flags & RPCAUTH_LOOKUP_ROOTCREDS) {
- 		cred->uc_uid = 0;
- 		cred->uc_gid = 0;
-+		cred->uc_tag = dx_current_tag();
- 		cred->uc_gids[0] = NOGROUP;
- 	} else {
- 		int groups = acred->group_info->ngroups;
-@@ -80,6 +83,7 @@ unx_create_cred(struct rpc_auth *auth, s
- 			groups = NFS_NGROUPS;
- 
- 		cred->uc_gid = acred->gid;
-+		cred->uc_tag = acred->tag;
- 		for (i = 0; i < groups; i++)
- 			cred->uc_gids[i] = GROUP_AT(acred->group_info, i);
- 		if (i < NFS_NGROUPS)
-@@ -124,7 +128,8 @@ unx_match(struct auth_cred *acred, struc
- 		int groups;
- 
- 		if (cred->uc_uid != acred->uid
--		 || cred->uc_gid != acred->gid)
-+		 || cred->uc_gid != acred->gid
-+		 || cred->uc_tag != acred->tag)
- 			return 0;
+@@ -78,6 +80,7 @@ unx_create_cred(struct rpc_auth *auth, s
+ 		groups = NFS_NGROUPS;
+ 
+ 	cred->uc_gid = acred->gid;
++	cred->uc_tag = acred->tag;
+ 	for (i = 0; i < groups; i++)
+ 		cred->uc_gids[i] = GROUP_AT(acred->group_info, i);
+ 	if (i < NFS_NGROUPS)
+@@ -119,7 +122,9 @@ unx_match(struct auth_cred *acred, struc
+ 	unsigned int i;
+ 
+ 
+-	if (cred->uc_uid != acred->uid || cred->uc_gid != acred->gid)
++	if (cred->uc_uid != acred->uid ||
++		cred->uc_gid != acred->gid ||
++		cred->uc_tag != acred->tag)
+ 		return 0;
  
- 		groups = acred->group_info->ngroups;
-@@ -150,7 +155,7 @@ unx_marshal(struct rpc_task *task, __be3
+ 	if (acred->group_info != NULL)
+@@ -142,7 +147,7 @@ unx_marshal(struct rpc_task *task, __be3
  	struct rpc_clnt	*clnt = task->tk_client;
  	struct unx_cred	*cred = container_of(task->tk_msg.rpc_cred, struct unx_cred, uc_base);
  	__be32		*base, *hold;
@@ -28038,7 +27740,7 @@
  
  	*p++ = htonl(RPC_AUTH_UNIX);
  	base = p++;
-@@ -160,9 +165,12 @@ unx_marshal(struct rpc_task *task, __be3
+@@ -152,9 +157,12 @@ unx_marshal(struct rpc_task *task, __be3
  	 * Copy the UTS nodename captured when the client was created.
  	 */
  	p = xdr_encode_array(p, clnt->cl_nodename, clnt->cl_nodelen);
@@ -28053,8 +27755,8 @@
  	hold = p++;
  	for (i = 0; i < 16 && cred->uc_gids[i] != (gid_t) NOGROUP; i++)
  		*p++ = htonl((u32) cred->uc_gids[i]);
---- a/net/sunrpc/clnt.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/sunrpc/clnt.c	2008-04-19 16:09:36.000000000 -0400
+--- a/net/sunrpc/clnt.c	2008-07-14 17:23:05.000000000 -0400
++++ a/net/sunrpc/clnt.c	2008-07-16 22:41:36.000000000 -0400
 @@ -31,6 +31,7 @@
  #include <linux/utsname.h>
  #include <linux/workqueue.h>
@@ -28074,8 +27776,8 @@
  	return clnt;
  }
  EXPORT_SYMBOL_GPL(rpc_create);
---- a/net/unix/af_unix.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/unix/af_unix.c	2008-04-19 15:55:39.000000000 -0400
+--- a/net/unix/af_unix.c	2008-07-14 17:23:05.000000000 -0400
++++ a/net/unix/af_unix.c	2008-07-16 22:52:51.000000000 -0400
 @@ -116,6 +116,8 @@
  #include <linux/mount.h>
  #include <net/checksum.h>
@@ -28085,8 +27787,8 @@
  
  static struct hlist_head unix_socket_table[UNIX_HASH_SIZE + 1];
  static DEFINE_SPINLOCK(unix_table_lock);
-@@ -255,6 +257,8 @@ static struct sock *__unix_find_socket_b
- 		if (s->sk_net != net)
+@@ -260,6 +262,8 @@ static struct sock *__unix_find_socket_b
+ 		if (!net_eq(sock_net(s), net))
  			continue;
  
 +		if (!nx_check(s->sk_nid, VS_WATCH_P | VS_IDENT))
@@ -28094,17 +27796,27 @@
  		if (u->addr->len == len &&
  		    !memcmp(u->addr->name, sunname, len))
  			goto found;
-@@ -819,7 +823,7 @@ static int unix_bind(struct socket *sock
- 		 */
- 		mode = S_IFSOCK |
- 		       (SOCK_INODE(sock)->i_mode & ~current->fs->umask);
--		err = vfs_mknod(nd.path.dentry->d_inode, dentry, mode, 0);
-+		err = vfs_mknod(nd.path.dentry->d_inode, dentry, mode, 0, NULL);
- 		if (err)
- 			goto out_mknod_dput;
- 		mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
---- a/net/x25/af_x25.c	2008-04-17 12:05:45.000000000 -0400
-+++ a/net/x25/af_x25.c	2008-04-19 15:14:52.000000000 -0400
+@@ -2086,6 +2090,8 @@ static struct sock *unix_seq_idx(struct 
+ 	for (s = first_unix_socket(&iter->i); s; s = next_unix_socket(&iter->i, s)) {
+ 		if (sock_net(s) != seq_file_net(seq))
+ 			continue;
++		if (!nx_check(s->sk_nid, VS_WATCH_P | VS_IDENT))
++			continue;
+ 		if (off == pos)
+ 			return s;
+ 		++off;
+@@ -2111,7 +2117,8 @@ static void *unix_seq_next(struct seq_fi
+ 		sk = first_unix_socket(&iter->i);
+ 	else
+ 		sk = next_unix_socket(&iter->i, sk);
+-	while (sk && (sock_net(sk) != seq_file_net(seq)))
++	while (sk && (sock_net(sk) != seq_file_net(seq) ||
++		!nx_check(sk->sk_nid, VS_WATCH_P | VS_IDENT)))
+ 		sk = next_unix_socket(&iter->i, sk);
+ 	return sk;
+ }
+--- a/net/x25/af_x25.c	2008-07-14 17:23:05.000000000 -0400
++++ a/net/x25/af_x25.c	2008-07-16 22:41:36.000000000 -0400
 @@ -506,7 +506,10 @@ static int x25_create(struct net *net, s
  
  	x25 = x25_sk(sk);
@@ -28118,7 +27830,7 @@
  	x25_init_timers(sk);
  
 --- a/scripts/checksyscalls.sh	2008-04-17 11:31:42.000000000 -0400
-+++ a/scripts/checksyscalls.sh	2008-04-19 15:14:52.000000000 -0400
++++ a/scripts/checksyscalls.sh	2008-07-16 22:41:36.000000000 -0400
 @@ -108,7 +108,6 @@ cat << EOF
  #define __IGNORE_afs_syscall
  #define __IGNORE_getpmsg
@@ -28127,18 +27839,14 @@
  EOF
  }
  
---- a/security/commoncap.c	2008-04-17 12:05:46.000000000 -0400
-+++ a/security/commoncap.c	2008-04-23 22:22:54.000000000 -0400
-@@ -24,6 +24,7 @@
- #include <linux/hugetlb.h>
- #include <linux/mount.h>
+--- a/security/commoncap.c	2008-07-14 17:23:05.000000000 -0400
++++ a/security/commoncap.c	2008-07-16 22:48:47.000000000 -0400
+@@ -26,10 +26,11 @@
  #include <linux/sched.h>
+ #include <linux/prctl.h>
+ #include <linux/securebits.h>
 +#include <linux/vs_context.h>
  
- /* Global security state */
- 
-@@ -32,7 +33,7 @@ EXPORT_SYMBOL(securebits);
- 
  int cap_netlink_send(struct sock *sk, struct sk_buff *skb)
  {
 -	NETLINK_CB(skb).eff_cap = current->cap_effective;
@@ -28146,7 +27854,7 @@
  	return 0;
  }
  
-@@ -53,9 +54,24 @@ EXPORT_SYMBOL(cap_netlink_recv);
+@@ -50,9 +51,24 @@ EXPORT_SYMBOL(cap_netlink_recv);
   */
  int cap_capable (struct task_struct *tsk, int cap)
  {
@@ -28172,7 +27880,7 @@
  	return -EPERM;
  }
  
-@@ -583,7 +599,8 @@ void cap_task_reparent_to_init (struct t
+@@ -675,7 +691,8 @@ void cap_task_reparent_to_init (struct t
  
  int cap_syslog (int type)
  {
@@ -28182,17 +27890,17 @@
  		return -EPERM;
  	return 0;
  }
---- a/security/dummy.c	2008-04-17 12:05:46.000000000 -0400
-+++ a/security/dummy.c	2008-04-23 20:28:54.000000000 -0400
-@@ -27,6 +27,7 @@
- #include <linux/hugetlb.h>
- #include <linux/ptrace.h>
+--- a/security/dummy.c	2008-07-14 17:23:05.000000000 -0400
++++ a/security/dummy.c	2008-07-16 22:48:12.000000000 -0400
+@@ -29,6 +29,7 @@
  #include <linux/file.h>
+ #include <linux/prctl.h>
+ #include <linux/securebits.h>
 +#include <linux/vs_context.h>
  
  static int dummy_ptrace (struct task_struct *parent, struct task_struct *child)
  {
-@@ -714,7 +715,7 @@ static int dummy_sem_semop (struct sem_a
+@@ -749,7 +750,7 @@ static int dummy_sem_semop (struct sem_a
  
  static int dummy_netlink_send (struct sock *sk, struct sk_buff *skb)
  {
@@ -28201,9 +27909,9 @@
  	return 0;
  }
  
---- a/security/selinux/hooks.c	2008-05-21 14:30:05.000000000 -0400
-+++ a/security/selinux/hooks.c	2008-05-21 14:30:41.000000000 -0400
-@@ -64,7 +64,6 @@
+--- a/security/selinux/hooks.c	2008-07-14 17:23:05.000000000 -0400
++++ a/security/selinux/hooks.c	2008-07-16 22:41:36.000000000 -0400
+@@ -65,7 +65,6 @@
  #include <linux/dccp.h>
  #include <linux/quota.h>
  #include <linux/un.h>		/* for Unix socket types */

Modified: dists/sid/linux-2.6/debian/patches/series/1-extra
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/1-extra	(original)
+++ dists/sid/linux-2.6/debian/patches/series/1-extra	Thu Aug 14 10:00:31 2008
@@ -1,6 +1,3 @@
-+ features/all/vserver/vs2.3.0.34.11.patch featureset=vserver featureset=xen-vserver
-+ features/all/vserver/bindmount-dev.patch featureset=vserver featureset=xen-vserver
-
 + features/all/xen/vmlinuz-target.patch featureset=xen
 + features/all/xen/xenctrl.patch featureset=xen
 + features/all/xen/xenctrl-capabilities.patch featureset=xen

Added: dists/sid/linux-2.6/debian/patches/series/3-extra
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/series/3-extra	Thu Aug 14 10:00:31 2008
@@ -0,0 +1,2 @@
++ features/all/vserver/vs2.3.0.35.patch featureset=vserver
++ features/all/vserver/bindmount-dev.patch featureset=vserver



More information about the Kernel-svn-changes mailing list