SOURCES (Titanium): linux-2.6-vs2.3.patch - back to patch-2.6.27.4-vs2.3.0....

hawk hawk at pld-linux.org
Wed Nov 12 21:47:18 CET 2008


Author: hawk                         Date: Wed Nov 12 20:47:18 2008 GMT
Module: SOURCES                       Tag: Titanium
---- Log message:
- back to patch-2.6.27.4-vs2.3.0.35.9.diff with /proc issue fixed

---- Files affected:
SOURCES:
   linux-2.6-vs2.3.patch (1.1.2.17.2.26 -> 1.1.2.17.2.27) 

---- Diffs:

================================================================
Index: SOURCES/linux-2.6-vs2.3.patch
diff -u SOURCES/linux-2.6-vs2.3.patch:1.1.2.17.2.26 SOURCES/linux-2.6-vs2.3.patch:1.1.2.17.2.27
--- SOURCES/linux-2.6-vs2.3.patch:1.1.2.17.2.26	Wed Nov 12 19:29:52 2008
+++ SOURCES/linux-2.6-vs2.3.patch	Wed Nov 12 21:47:11 2008
@@ -1612,7 +1612,7 @@
  		retval = -1;
  	return retval;
 diff -NurpP --minimal linux-2.6.27.4/drivers/char/tty_io.c linux-2.6.27.4-vs2.3.0.35.9/drivers/char/tty_io.c
---- linux-2.6.27.4/drivers/char/tty_io.c	2008-10-24 02:21:28.000000000 +0200
+--- linux-2.6.27.4/drivers/char/tty_io.c	2008-10-30 01:14:41.000000000 +0100
 +++ linux-2.6.27.4-vs2.3.0.35.9/drivers/char/tty_io.c	2008-10-24 02:21:46.000000000 +0200
 @@ -106,6 +106,7 @@
  
@@ -3379,7 +3379,7 @@
  		ext4_std_error(sb, fatal);
 diff -NurpP --minimal linux-2.6.27.4/fs/ext4/ext4.h linux-2.6.27.4-vs2.3.0.35.9/fs/ext4/ext4.h
 --- linux-2.6.27.4/fs/ext4/ext4.h	2008-10-13 14:52:05.000000000 +0200
-+++ linux-2.6.27.4-vs2.3.0.35.9/fs/ext4/ext4.h	2008-10-24 03:34:52.000000000 +0200
++++ linux-2.6.27.4-vs2.3.0.35.9/fs/ext4/ext4.h	2008-10-31 18:15:18.000000000 +0100
 @@ -242,8 +242,12 @@ struct flex_groups {
  #define EXT4_HUGE_FILE_FL               0x00040000 /* Set to each huge file */
  #define EXT4_EXTENTS_FL			0x00080000 /* Inode uses extents */
@@ -3387,7 +3387,7 @@
 +#define EXT4_IXUNLINK_FL		0x08000000 /* Immutable invert on unlink */
  #define EXT4_RESERVED_FL		0x80000000 /* reserved for ext4 lib */
  
-+#define EXT4_BARRIER_FL			0x10000000 /* Barrier for chroot() */
++#define EXT4_BARRIER_FL			0x04000000 /* Barrier for chroot() */
 +#define EXT4_COW_FL			0x20000000 /* Copy on Write marker */
 +
  #define EXT4_FL_USER_VISIBLE		0x000BDFFF /* User visible flags */
@@ -4162,7 +4162,7 @@
  				err = -EPERM;
 diff -NurpP --minimal linux-2.6.27.4/fs/jfs/jfs_dinode.h linux-2.6.27.4-vs2.3.0.35.9/fs/jfs/jfs_dinode.h
 --- linux-2.6.27.4/fs/jfs/jfs_dinode.h	2008-07-13 23:51:29.000000000 +0200
-+++ linux-2.6.27.4-vs2.3.0.35.9/fs/jfs/jfs_dinode.h	2008-10-24 03:34:52.000000000 +0200
++++ linux-2.6.27.4-vs2.3.0.35.9/fs/jfs/jfs_dinode.h	2008-10-31 18:15:18.000000000 +0100
 @@ -161,9 +161,13 @@ struct dinode {
  
  #define JFS_APPEND_FL		0x01000000 /* writes to file may only append */
@@ -4171,7 +4171,7 @@
  
 -#define JFS_FL_USER_VISIBLE	0x03F80000
 -#define JFS_FL_USER_MODIFIABLE	0x03F80000
-+#define JFS_BARRIER_FL		0x10000000 /* Barrier for chroot() */
++#define JFS_BARRIER_FL		0x04000000 /* Barrier for chroot() */
 +#define JFS_COW_FL		0x20000000 /* Copy on Write marker */
 +
 +#define JFS_FL_USER_VISIBLE	0x07F80000
@@ -5045,7 +5045,7 @@
  	return 0;
 diff -NurpP --minimal linux-2.6.27.4/fs/namei.c linux-2.6.27.4-vs2.3.0.35.9/fs/namei.c
 --- linux-2.6.27.4/fs/namei.c	2008-10-13 14:52:05.000000000 +0200
-+++ linux-2.6.27.4-vs2.3.0.35.9/fs/namei.c	2008-10-24 03:52:44.000000000 +0200
++++ linux-2.6.27.4-vs2.3.0.35.9/fs/namei.c	2008-10-31 18:18:18.000000000 +0100
 @@ -31,6 +31,14 @@
  #include <linux/file.h>
  #include <linux/fcntl.h>
@@ -5061,7 +5061,7 @@
  #include <asm/uaccess.h>
  
  #define ACC_MODE(x) ("\000\004\002\006"[(x)&O_ACCMODE])
-@@ -167,6 +175,59 @@ void putname(const char *name)
+@@ -167,6 +175,76 @@ void putname(const char *name)
  EXPORT_SYMBOL(putname);
  #endif
  
@@ -5074,31 +5074,38 @@
 +	return 0;
 +}
 +
-+int dx_permission(struct inode *inode, int mask)
++static int __dx_permission(struct inode *inode, int mask)
 +{
-+	if (vx_check(0, VS_ADMIN | VS_WATCH))
-+		return 0;
-+
 +	if (dx_barrier(inode))
 +		return -EACCES;
 +
 +	if (inode->i_sb->s_magic == DEVPTS_SUPER_MAGIC) {
 +		/* devpts is xid tagged */
 +		if (S_ISDIR(inode->i_mode) ||
-+		    vx_check((xid_t)inode->i_tag, VS_IDENT))
++		    vx_check((xid_t)inode->i_tag, VS_IDENT | VS_WATCH_P))
 +			return 0;
 +	}
 +	else if (inode->i_sb->s_magic == PROC_SUPER_MAGIC) {
-+		struct pid *pid = PROC_I(inode)->pid;
-+		struct task_struct *tsk;
++		struct proc_dir_entry *de = PDE(inode);
++
++		if (de && !vx_hide_check(0, de->vx_flags))
++			goto out;
++
 +		if ((mask & (MAY_WRITE | MAY_APPEND))) {
++			struct pid *pid;
++			struct task_struct *tsk;
++
++			if (vx_check(0, VS_ADMIN | VS_WATCH_P))
++				return 0;
++
++			pid = PROC_I(inode)->pid;
 +			if (!pid)
 +				goto out;
 +
 +			tsk = pid_task(pid, PIDTYPE_PID);
 +			vxdprintk(VXD_CBIT(tag, 0), "accessing %p[#%u]",
-+				       tsk, (tsk ? vx_task_xid(tsk) : 0));
-+			if (tsk && vx_check(vx_task_xid(tsk), VS_IDENT))
++				  tsk, (tsk ? vx_task_xid(tsk) : 0));
++			if (tsk && vx_check(vx_task_xid(tsk), VS_IDENT | VS_WATCH_P))
 +				return 0;
 +		}
 +		else {
@@ -5108,20 +5115,30 @@
 +	}
 +	else {
 +		if (dx_notagcheck(inode->i_sb) ||
-+		    dx_check(inode->i_tag, DX_HOSTID|DX_ADMIN|DX_WATCH|DX_IDENT))
++		    dx_check(inode->i_tag, DX_HOSTID | DX_ADMIN | DX_WATCH |
++			     DX_IDENT))
 +			return 0;
 +	}
 +
 +out:
-+	vxwprintk_task(1, "denied access to %s:%p[#%d,%lu].",
-+		inode->i_sb->s_id, inode, inode->i_tag, inode->i_ino);
 +	return -EACCES;
 +}
 +
++int dx_permission(struct inode *inode, int mask)
++{
++	int ret = __dx_permission(inode, mask);
++	if (unlikely(ret)) {
++		vxwprintk_task(1, "denied %x access to %s:%p[#%d,%lu]",
++			mask, inode->i_sb->s_id, inode, inode->i_tag,
++			inode->i_ino);
++	}
++	return ret;
++}
++
  
  /**
   * generic_permission  -  check for access rights on a Posix-like filesystem
-@@ -244,10 +305,14 @@ int inode_permission(struct inode *inode
+@@ -244,10 +322,14 @@ int inode_permission(struct inode *inode
  		/*
  		 * Nobody gets write access to an immutable file.
  		 */
@@ -5137,7 +5154,7 @@
  	/* Ordinary permission routines do not understand MAY_APPEND. */
  	if (inode->i_op && inode->i_op->permission) {
  		retval = inode->i_op->permission(inode, mask);
-@@ -451,6 +516,8 @@ static int exec_permission_lite(struct i
+@@ -451,6 +533,8 @@ static int exec_permission_lite(struct i
  {
  	umode_t	mode = inode->i_mode;
  
@@ -5146,7 +5163,7 @@
  	if (inode->i_op && inode->i_op->permission)
  		return -EAGAIN;
  
-@@ -773,7 +840,8 @@ static __always_inline void follow_dotdo
+@@ -773,7 +857,8 @@ static __always_inline void follow_dotdo
  		if (nd->path.dentry == fs->root.dentry &&
  		    nd->path.mnt == fs->root.mnt) {
                          read_unlock(&fs->lock);
@@ -5156,7 +5173,7 @@
  		}
                  read_unlock(&fs->lock);
  		spin_lock(&dcache_lock);
-@@ -810,16 +878,39 @@ static int do_lookup(struct nameidata *n
+@@ -810,16 +895,30 @@ static int do_lookup(struct nameidata *n
  {
  	struct vfsmount *mnt = nd->path.mnt;
  	struct dentry *dentry = __d_lookup(nd->path.dentry, name);
@@ -5170,33 +5187,24 @@
 +	if (!inode)
 +		goto done;
 +
-+	if (inode->i_sb->s_magic == PROC_SUPER_MAGIC) {
-+		struct proc_dir_entry *de = PDE(inode);
++	if (__dx_permission(inode, MAY_ACCESS))
++		goto hidden;
 +
-+		if (de && !vx_hide_check(0, de->vx_flags))
-+			goto hidden;
-+	} else if (inode->i_sb->s_magic == DEVPTS_SUPER_MAGIC) {
-+		if (!vx_check((xid_t)inode->i_tag, VS_WATCH_P | VS_IDENT))
-+			goto hidden;
-+	} else {
-+		if (!dx_notagcheck(inode->i_sb) && !dx_check(inode->i_tag,
-+			DX_WATCH | DX_ADMIN | DX_HOSTID | DX_IDENT))
-+			goto hidden;
-+	}
  done:
  	path->mnt = mnt;
  	path->dentry = dentry;
  	__follow_mount(path);
  	return 0;
 +hidden:
-+	vxwprintk_task(1, "did lookup hidden %p[#%d,%lu] »%s«.",
-+		inode, inode->i_tag, inode->i_ino, vxd_path(&nd->path));
++	vxwprintk_task(1, "did lookup hidden %s:%p[#%d,%lu] »%s«.",
++		inode->i_sb->s_id, inode, inode->i_tag, inode->i_ino,
++		vxd_path(&nd->path));
 +	dput(dentry);
 +	return -ENOENT;
  
  need_lookup:
  	dentry = real_lookup(nd->path.dentry, name, nd);
-@@ -1407,7 +1498,7 @@ static int may_delete(struct inode *dir,
+@@ -1407,7 +1506,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)||
@@ -5205,7 +5213,7 @@
  		return -EPERM;
  	if (isdir) {
  		if (!S_ISDIR(victim->d_inode->i_mode))
-@@ -1551,6 +1642,14 @@ int may_open(struct nameidata *nd, int a
+@@ -1551,6 +1650,14 @@ int may_open(struct nameidata *nd, int a
  		flag &= ~O_TRUNC;
  	}
  
@@ -5220,7 +5228,7 @@
  	error = vfs_permission(nd, acc_mode);
  	if (error)
  		return error;
-@@ -1677,6 +1776,11 @@ struct file *do_filp_open(int dfd, const
+@@ -1677,6 +1784,11 @@ struct file *do_filp_open(int dfd, const
  	int will_write;
  	int flag = open_to_namei_flags(open_flag);
  
@@ -5232,7 +5240,7 @@
  	acc_mode = MAY_OPEN | ACC_MODE(flag);
  
  	/* O_TRUNC implies we need access checks for write permissions */
-@@ -1800,6 +1904,25 @@ ok:
+@@ -1800,6 +1912,25 @@ ok:
  			goto exit;
  	}
  	error = may_open(&nd, acc_mode, flag);
@@ -5258,7 +5266,7 @@
  	if (error) {
  		if (will_write)
  			mnt_drop_write(nd.path.mnt);
-@@ -1952,9 +2075,17 @@ int vfs_mknod(struct inode *dir, struct 
+@@ -1952,9 +2083,17 @@ int vfs_mknod(struct inode *dir, struct 
  	if (error)
  		return error;
  
@@ -5277,7 +5285,7 @@
  	if (!dir->i_op || !dir->i_op->mknod)
  		return -EPERM;
  
-@@ -2395,7 +2526,7 @@ int vfs_link(struct dentry *old_dentry, 
+@@ -2395,7 +2534,7 @@ int vfs_link(struct dentry *old_dentry, 
  	/*
  	 * A link to an append-only or immutable file cannot be created.
  	 */
@@ -5286,7 +5294,7 @@
  		return -EPERM;
  	if (!dir->i_op || !dir->i_op->link)
  		return -EPERM;
-@@ -2756,6 +2887,214 @@ int vfs_follow_link(struct nameidata *nd
+@@ -2756,6 +2895,214 @@ int vfs_follow_link(struct nameidata *nd
  	return __vfs_follow_link(nd, link);
  }
  
@@ -7294,7 +7302,11 @@
 diff -NurpP --minimal linux-2.6.27.4/fs/proc/root.c linux-2.6.27.4-vs2.3.0.35.9/fs/proc/root.c
 --- linux-2.6.27.4/fs/proc/root.c	2008-07-13 23:51:29.000000000 +0200
 +++ linux-2.6.27.4-vs2.3.0.35.9/fs/proc/root.c	2008-10-13 14:54:20.000000000 +0200
-@@ -22,6 +22,10 @@
+@@ -19,9 +19,14 @@
+ #include <linux/smp_lock.h>
+ #include <linux/mount.h>
+ #include <linux/pid_namespace.h>
++#include <linux/vserver/inode.h>
  
  #include "internal.h"
  
@@ -7313,6 +7325,14 @@
  }
  
  static int proc_root_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat
+@@ -214,6 +215,7 @@ struct proc_dir_entry proc_root = {
+ 	.proc_iops	= &proc_root_inode_operations, 
+ 	.proc_fops	= &proc_root_operations,
+ 	.parent		= &proc_root,
++	.vx_flags	= IATTR_ADMIN | IATTR_WATCH,
+ };
+ 
+ int pid_ns_prepare_proc(struct pid_namespace *ns)
 diff -NurpP --minimal linux-2.6.27.4/fs/quota.c linux-2.6.27.4-vs2.3.0.35.9/fs/quota.c
 --- linux-2.6.27.4/fs/quota.c	2008-10-13 14:52:06.000000000 +0200
 +++ linux-2.6.27.4-vs2.3.0.35.9/fs/quota.c	2008-10-13 14:54:20.000000000 +0200
@@ -8294,7 +8314,7 @@
  #define clear_opt(o, opt)		o &= ~EXT2_MOUNT_##opt
 diff -NurpP --minimal linux-2.6.27.4/include/linux/ext3_fs.h linux-2.6.27.4-vs2.3.0.35.9/include/linux/ext3_fs.h
 --- linux-2.6.27.4/include/linux/ext3_fs.h	2008-10-13 14:52:09.000000000 +0200
-+++ linux-2.6.27.4-vs2.3.0.35.9/include/linux/ext3_fs.h	2008-10-24 03:34:52.000000000 +0200
++++ linux-2.6.27.4-vs2.3.0.35.9/include/linux/ext3_fs.h	2008-10-31 18:15:18.000000000 +0100
 @@ -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) */
@@ -8304,7 +8324,7 @@
  
 -#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_BARRIER_FL			0x04000000 /* Barrier for chroot() */
 +#define EXT3_COW_FL			0x20000000 /* Copy on Write marker */
 +
 +#define EXT3_FL_USER_VISIBLE		0x0103DFFF /* User visible flags */
@@ -8347,8 +8367,8 @@
  extern int  ext3_write_inode (struct inode *, int);
 diff -NurpP --minimal linux-2.6.27.4/include/linux/fs.h linux-2.6.27.4-vs2.3.0.35.9/include/linux/fs.h
 --- linux-2.6.27.4/include/linux/fs.h	2008-10-13 14:52:09.000000000 +0200
-+++ linux-2.6.27.4-vs2.3.0.35.9/include/linux/fs.h	2008-10-24 03:34:52.000000000 +0200
-@@ -128,13 +128,16 @@ extern int dir_notify_enable;
++++ linux-2.6.27.4-vs2.3.0.35.9/include/linux/fs.h	2008-10-31 18:18:18.000000000 +0100
+@@ -128,6 +128,9 @@ 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 */
@@ -8358,14 +8378,6 @@
  #define MS_ACTIVE	(1<<30)
  #define MS_NOUSER	(1<<31)
  
- /*
-  * Superblock flags that can be altered by MS_REMOUNT
-  */
--#define MS_RMT_MASK	(MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK)
-+#define MS_RMT_MASK	(MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOTAGCHECK)
- 
- /*
-  * Old magic mount flag and mask
 @@ -154,6 +157,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 */
@@ -8425,7 +8437,7 @@
  
 -#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_BARRIER_FL			0x04000000 /* Barrier for chroot() */
 +#define FS_COW_FL			0x20000000 /* Copy on Write marker */
  
 +#define FS_FL_USER_VISIBLE		0x0103DFFF /* User visible flags */
@@ -10238,8 +10250,8 @@
 +#endif	/* _VX_CONTEXT_CMD_H */
 diff -NurpP --minimal linux-2.6.27.4/include/linux/vserver/context.h linux-2.6.27.4-vs2.3.0.35.9/include/linux/vserver/context.h
 --- linux-2.6.27.4/include/linux/vserver/context.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.27.4-vs2.3.0.35.9/include/linux/vserver/context.h	2008-10-13 14:54:20.000000000 +0200
-@@ -0,0 +1,176 @@
++++ linux-2.6.27.4-vs2.3.0.35.9/include/linux/vserver/context.h	2008-10-31 18:15:28.000000000 +0100
+@@ -0,0 +1,178 @@
 +#ifndef _VX_CONTEXT_H
 +#define _VX_CONTEXT_H
 +
@@ -10328,6 +10340,8 @@
 +#include "cacct_def.h"
 +#include "device_def.h"
 +
++#define VX_SPACES	2
++
 +struct _vx_info_pc {
 +	struct _vx_sched_pc sched_pc;
 +	struct _vx_cvirt_pc cvirt_pc;
@@ -10341,9 +10355,9 @@
 +	struct vx_info *vx_parent;		/* parent context */
 +	int vx_state;				/* context state */
 +
-+	unsigned long vx_nsmask;		/* assignment mask */
-+	struct nsproxy *vx_nsproxy;		/* private namespace */
-+	struct fs_struct *vx_fs;		/* private namespace fs */
++	unsigned long vx_nsmask[VX_SPACES];	/* assignment mask */
++	struct nsproxy *vx_nsproxy[VX_SPACES];	/* private namespaces */
++	struct fs_struct *vx_fs[VX_SPACES];	/* private namespace fs */
 +
 +	uint64_t vx_flags;			/* context flags */
 +	uint64_t vx_ccaps;			/* context caps (vserver) */
@@ -12498,17 +12512,19 @@
 +#endif	/* _VX_SIGNAL_H */
 diff -NurpP --minimal linux-2.6.27.4/include/linux/vserver/space_cmd.h linux-2.6.27.4-vs2.3.0.35.9/include/linux/vserver/space_cmd.h
 --- linux-2.6.27.4/include/linux/vserver/space_cmd.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.27.4-vs2.3.0.35.9/include/linux/vserver/space_cmd.h	2008-10-13 14:54:20.000000000 +0200
-@@ -0,0 +1,29 @@
++++ linux-2.6.27.4-vs2.3.0.35.9/include/linux/vserver/space_cmd.h	2008-10-31 03:49:36.000000000 +0100
+@@ -0,0 +1,38 @@
 +#ifndef _VX_SPACE_CMD_H
 +#define _VX_SPACE_CMD_H
 +
 +
 +#define VCMD_enter_space_v0	VC_CMD(PROCALT, 1, 0)
-+#define VCMD_enter_space	VC_CMD(PROCALT, 1, 1)
++#define VCMD_enter_space_v1	VC_CMD(PROCALT, 1, 1)
++#define VCMD_enter_space	VC_CMD(PROCALT, 1, 2)
 +
 +#define VCMD_set_space_v0	VC_CMD(PROCALT, 3, 0)
-+#define VCMD_set_space		VC_CMD(PROCALT, 3, 1)
++#define VCMD_set_space_v1	VC_CMD(PROCALT, 3, 1)
++#define VCMD_set_space		VC_CMD(PROCALT, 3, 2)
 +
 +#define VCMD_get_space_mask_v0	VC_CMD(PROCALT, 4, 0)
 +
@@ -12516,13 +12532,20 @@
 +#define VCMD_get_space_default	VC_CMD(VSPACE, 1, 0)
 +
 +
-+struct	vcmd_space_mask {
++struct	vcmd_space_mask_v1 {
 +	uint64_t mask;
 +};
 +
++struct	vcmd_space_mask_v2 {
++	uint64_t mask;
++	uint32_t index;
++};
++
 +
 +#ifdef	__KERNEL__
 +
++extern int vc_enter_space_v1(struct vx_info *, void __user *);
++extern int vc_set_space_v1(struct vx_info *, void __user *);
 +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(void __user *, int);
@@ -12531,17 +12554,16 @@
 +#endif	/* _VX_SPACE_CMD_H */
 diff -NurpP --minimal linux-2.6.27.4/include/linux/vserver/space.h linux-2.6.27.4-vs2.3.0.35.9/include/linux/vserver/space.h
 --- linux-2.6.27.4/include/linux/vserver/space.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.27.4-vs2.3.0.35.9/include/linux/vserver/space.h	2008-10-13 14:54:20.000000000 +0200
-@@ -0,0 +1,13 @@
++++ linux-2.6.27.4-vs2.3.0.35.9/include/linux/vserver/space.h	2008-10-31 04:02:02.000000000 +0100
+@@ -0,0 +1,12 @@
 +#ifndef _VX_SPACE_H
 +#define _VX_SPACE_H
 +
-+
 +#include <linux/types.h>
 +
 +struct vx_info;
 +
-+int vx_set_space(struct vx_info *vxi, unsigned long mask);
++int vx_set_space(struct vx_info *vxi, unsigned long mask, unsigned index);
 +
 +#else	/* _VX_SPACE_H */
 +#warning duplicate inclusion
@@ -16644,8 +16666,8 @@
 +#endif	/* _VX_CACCT_PROC_H */
 diff -NurpP --minimal linux-2.6.27.4/kernel/vserver/context.c linux-2.6.27.4-vs2.3.0.35.9/kernel/vserver/context.c
 --- linux-2.6.27.4/kernel/vserver/context.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.27.4-vs2.3.0.35.9/kernel/vserver/context.c	2008-10-13 14:54:20.000000000 +0200
-@@ -0,0 +1,1010 @@
++++ linux-2.6.27.4-vs2.3.0.35.9/kernel/vserver/context.c	2008-10-31 03:56:55.000000000 +0100
+@@ -0,0 +1,1018 @@
 +/*
 + *  linux/kernel/vserver/context.c
 + *
@@ -16820,19 +16842,22 @@
 +{
 +	struct nsproxy *nsproxy;
 +	struct fs_struct *fs;
++	int index;
 +
 +	might_sleep();
 +
 +	vxi->vx_state |= VXS_SHUTDOWN;
 +	vs_state_change(vxi, VSC_SHUTDOWN);
 +
-+	nsproxy = xchg(&vxi->vx_nsproxy, NULL);
-+	fs = xchg(&vxi->vx_fs, NULL);
-+
-+	if (nsproxy)
-+		put_nsproxy(nsproxy);
-+	if (fs)
-+		put_fs_struct(fs);
++	for (index = 0; index < VX_SPACES; index++) {
++		nsproxy = xchg(&vxi->vx_nsproxy[index], NULL);
++		if (nsproxy)
++			put_nsproxy(nsproxy);
++
++		fs = xchg(&vxi->vx_fs[index], NULL);
++		if (fs)
++			put_fs_struct(fs);
++	}
 +}
 +
 +/* exported stuff */
@@ -16840,6 +16865,7 @@
 +void free_vx_info(struct vx_info *vxi)
 +{
 +	unsigned long flags;
++	unsigned index;
 +
 +	/* check for reference counts first */
 +	BUG_ON(atomic_read(&vxi->vx_usecnt));
@@ -16851,8 +16877,11 @@
 +	/* context shutdown is mandatory */
 +	BUG_ON(!vx_info_state(vxi, VXS_SHUTDOWN));
 +
-+	BUG_ON(vxi->vx_nsproxy);
-+	BUG_ON(vxi->vx_fs);
++	/* nsproxy and fs check */
++	for (index = 0; index < VX_SPACES; index++) {
++		BUG_ON(vxi->vx_nsproxy[index]);
++		BUG_ON(vxi->vx_fs[index]);
++	}
 +
 +	spin_lock_irqsave(&vx_info_inactive_lock, flags);
 +	hlist_del(&vxi->vx_hlist);
@@ -17259,7 +17288,8 @@
 +				goto out;
 +
 +			old_nsp = xchg(&p->nsproxy, new_nsp);
-+			vx_set_space(vxi, CLONE_NEWUTS | CLONE_NEWIPC | CLONE_NEWUSER);
++			vx_set_space(vxi,
++				CLONE_NEWUTS | CLONE_NEWIPC | CLONE_NEWUSER, 0);
 +			put_nsproxy(old_nsp);
 +		}
 +	}
@@ -17658,8 +17688,8 @@
 +
 diff -NurpP --minimal linux-2.6.27.4/kernel/vserver/cvirt.c linux-2.6.27.4-vs2.3.0.35.9/kernel/vserver/cvirt.c
 --- linux-2.6.27.4/kernel/vserver/cvirt.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.27.4-vs2.3.0.35.9/kernel/vserver/cvirt.c	2008-10-13 14:54:20.000000000 +0200
-@@ -0,0 +1,301 @@
++++ linux-2.6.27.4-vs2.3.0.35.9/kernel/vserver/cvirt.c	2008-10-31 03:49:36.000000000 +0100
+@@ -0,0 +1,300 @@
 +/*
 + *  linux/kernel/vserver/cvirt.c
 + *
@@ -17828,11 +17858,10 @@
 +	struct nsproxy *nsproxy;
 +	struct uts_namespace *uts;
 +
-+
 +	if (id == VHIN_CONTEXT)
 +		return vxi->vx_name;
 +
-+	nsproxy = vxi->vx_nsproxy;
++	nsproxy = vxi->vx_nsproxy[0];
 +	if (!nsproxy)
 +		return NULL;
 +
@@ -22059,8 +22088,8 @@
 +
 diff -NurpP --minimal linux-2.6.27.4/kernel/vserver/proc.c linux-2.6.27.4-vs2.3.0.35.9/kernel/vserver/proc.c
 --- linux-2.6.27.4/kernel/vserver/proc.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.27.4-vs2.3.0.35.9/kernel/vserver/proc.c	2008-10-13 14:54:20.000000000 +0200
-@@ -0,0 +1,1086 @@
++++ linux-2.6.27.4-vs2.3.0.35.9/kernel/vserver/proc.c	2008-10-31 18:15:28.000000000 +0100
+@@ -0,0 +1,1092 @@
 +/*
 + *  linux/kernel/vserver/proc.c
 + *
@@ -22189,9 +22218,9 @@
 +
 +	buffer += sprintf(buffer,
 +		"CCaps:\t%016llx\n"
-+		"Spaces:\t%08lx\n",
++		"Spaces:\t%08lx %08lx\n",
 +		(unsigned long long)vxi->vx_ccaps,
-+		vxi->vx_nsmask);
++		vxi->vx_nsmask[0], vxi->vx_nsmask[1]);
 +	return buffer - orig;
 +}
 +
@@ -22213,9 +22242,14 @@
 +	return length;
 +}
 +
-+int proc_vxi_nsproxy(struct vx_info *vxi, char *buffer)
++int proc_vxi_nsproxy0(struct vx_info *vxi, char *buffer)
++{
++	return vx_info_proc_nsproxy(vxi->vx_nsproxy[0], buffer);
++}
++
++int proc_vxi_nsproxy1(struct vx_info *vxi, char *buffer)
 +{
-+	return vx_info_proc_nsproxy(vxi->vx_nsproxy, buffer);
++	return vx_info_proc_nsproxy(vxi->vx_nsproxy[1], buffer);
 +}
 +
 +int proc_vxi_cvirt(struct vx_info *vxi, char *buffer)
@@ -22607,7 +22641,8 @@
 +	VINF("status",	S_IRUGO, vxi_status),
 +	VINF("limit",	S_IRUGO, vxi_limit),
 +	VINF("sched",	S_IRUGO, vxi_sched),
-+	VINF("nsproxy",	S_IRUGO, vxi_nsproxy),
++	VINF("nsproxy",	S_IRUGO, vxi_nsproxy0),
++	VINF("nsproxy1",S_IRUGO, vxi_nsproxy1),
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/linux-2.6-vs2.3.patch?r1=1.1.2.17.2.26&r2=1.1.2.17.2.27&f=u



More information about the pld-cvs-commit mailing list