[kernel] r6366 - in dists/sid/linux-2.6/debian: . patches
patches/series
Bastian Blank
waldi at costa.debian.org
Mon Apr 3 09:40:03 UTC 2006
Author: waldi
Date: Mon Apr 3 09:40:00 2006
New Revision: 6366
Added:
dists/sid/linux-2.6/debian/patches/series/5-extra
dists/sid/linux-2.6/debian/patches/vserver-vs2.0.2-rc15-update.patch (contents, props changed)
Modified:
dists/sid/linux-2.6/debian/changelog
Log:
Update vserver patch to 2.0.2-rc15.
* debian/changelog: Update.
* debian/patches/series/5-extra: Add vserver-vs2.0.2-rc15-update.patch.
* debian/patches/vserver-vs2.0.2-rc15-update.patch: Add.
Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog (original)
+++ dists/sid/linux-2.6/debian/changelog Mon Apr 3 09:40:00 2006
@@ -8,6 +8,7 @@
* Fix module package output.
* Include .kernelrelease in headers packages. (closes: #359813)
* Disable Cumana partition support completely. (closes: #359207)
+ * Update vserver patch to 2.0.2-rc15.
[ dann frazier ]
* [ia64] initramfs-tools works now, no longer restrict initramfs-generators
Added: dists/sid/linux-2.6/debian/patches/series/5-extra
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/series/5-extra Mon Apr 3 09:40:00 2006
@@ -0,0 +1 @@
++ vserver-vs2.0.2-rc15-update.patch *_vserver
Added: dists/sid/linux-2.6/debian/patches/vserver-vs2.0.2-rc15-update.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/vserver-vs2.0.2-rc15-update.patch Mon Apr 3 09:40:00 2006
@@ -0,0 +1,679 @@
+diff -u linux-2.6.16-vs2.0.2-rc14/drivers/block/vroot.c linux-2.6.16-vs2.0.2-rc15/drivers/block/vroot.c
+--- linux-2.6.16-vs2.0.2-rc14/drivers/block/vroot.c 2006-03-20 17:34:49 +0100
++++ linux-2.6.16-vs2.0.2-rc15/drivers/block/vroot.c 2006-03-24 16:50:44 +0100
+@@ -12,7 +12,6 @@
+ *
+ */
+
+-#include <linux/config.h>
+ #include <linux/module.h>
+ #include <linux/moduleparam.h>
+ #include <linux/file.h>
+diff -u linux-2.6.16-vs2.0.2-rc14/include/linux/vs_context.h linux-2.6.16-vs2.0.2-rc15/include/linux/vs_context.h
+--- linux-2.6.16-vs2.0.2-rc14/include/linux/vs_context.h 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/include/linux/vs_context.h 2006-04-03 05:31:18 +0200
+@@ -170,7 +170,7 @@
+ wake_up_interruptible(&vxi->vx_wait);
+ }
+
+-extern void exit_vx_info(struct task_struct *);
++extern void exit_vx_info(struct task_struct *, int);
+
+ static inline
+ struct task_struct *vx_child_reaper(struct task_struct *p)
+diff -u linux-2.6.16-vs2.0.2-rc14/include/linux/vs_memory.h linux-2.6.16-vs2.0.2-rc15/include/linux/vs_memory.h
+--- linux-2.6.16-vs2.0.2-rc14/include/linux/vs_memory.h 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/include/linux/vs_memory.h 2006-03-24 16:50:44 +0100
+@@ -1,7 +1,6 @@
+ #ifndef _VX_VS_MEMORY_H
+ #define _VX_VS_MEMORY_H
+
+-#include <linux/config.h>
+ #include "vserver/limit.h"
+ #include "vserver/debug.h"
+ #include "vserver/limit_int.h"
+diff -u linux-2.6.16-vs2.0.2-rc14/include/linux/vs_sched.h linux-2.6.16-vs2.0.2-rc15/include/linux/vs_sched.h
+--- linux-2.6.16-vs2.0.2-rc14/include/linux/vs_sched.h 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/include/linux/vs_sched.h 2006-03-24 16:50:44 +0100
+@@ -1,7 +1,6 @@
+ #ifndef _VX_VS_SCHED_H
+ #define _VX_VS_SCHED_H
+
+-#include <linux/config.h>
+ #include "vserver/sched.h"
+
+
+diff -u linux-2.6.16-vs2.0.2-rc14/include/linux/vserver/context.h linux-2.6.16-vs2.0.2-rc15/include/linux/vserver/context.h
+--- linux-2.6.16-vs2.0.2-rc14/include/linux/vserver/context.h 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/include/linux/vserver/context.h 2006-04-03 05:31:18 +0200
+@@ -1,7 +1,6 @@
+ #ifndef _VX_CONTEXT_H
+ #define _VX_CONTEXT_H
+
+-#include <linux/config.h>
+ #include <linux/types.h>
+
+
+@@ -111,13 +110,15 @@
+ struct task_struct *vx_reaper; /* guest reaper process */
+ pid_t vx_initpid; /* PID of guest init */
+
+- wait_queue_head_t vx_wait; /* context exit waitqueue */
+-
+ struct _vx_limit limit; /* vserver limits */
+ struct _vx_sched sched; /* vserver scheduler */
+ struct _vx_cvirt cvirt; /* virtual/bias stuff */
+ struct _vx_cacct cacct; /* context accounting */
+
++ wait_queue_head_t vx_wait; /* context exit waitqueue */
++ int reboot_cmd; /* last sys_reboot() cmd */
++ int exit_code; /* last process exit code */
++
+ char vx_name[65]; /* vserver name */
+ };
+
+@@ -128,6 +129,7 @@
+ #define VXS_PAUSED 0x0010
+ #define VXS_ONHOLD 0x0020
+ #define VXS_SHUTDOWN 0x0100
++#define VXS_HELPER 0x1000
+ #define VXS_RELEASED 0x8000
+
+ /* check conditions */
+diff -u linux-2.6.16-vs2.0.2-rc14/include/linux/vserver/cvirt_def.h linux-2.6.16-vs2.0.2-rc15/include/linux/vserver/cvirt_def.h
+--- linux-2.6.16-vs2.0.2-rc14/include/linux/vserver/cvirt_def.h 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/include/linux/vserver/cvirt_def.h 2006-03-24 16:50:44 +0100
+@@ -1,7 +1,6 @@
+ #ifndef _VX_CVIRT_DEF_H
+ #define _VX_CVIRT_DEF_H
+
+-#include <linux/config.h>
+ #include <linux/jiffies.h>
+ #include <linux/utsname.h>
+ #include <linux/spinlock.h>
+diff -u linux-2.6.16-vs2.0.2-rc14/include/linux/vserver/debug.h linux-2.6.16-vs2.0.2-rc15/include/linux/vserver/debug.h
+--- linux-2.6.16-vs2.0.2-rc14/include/linux/vserver/debug.h 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/include/linux/vserver/debug.h 2006-03-24 16:50:44 +0100
+@@ -1,8 +1,6 @@
+ #ifndef _VX_DEBUG_H
+ #define _VX_DEBUG_H
+
+-#include <linux/config.h>
+-
+
+ #define VXD_CBIT(n,m) (vx_debug_ ## n & (1 << (m)))
+ #define VXD_CMIN(n,m) (vx_debug_ ## n > (m))
+diff -u linux-2.6.16-vs2.0.2-rc14/include/linux/vserver/dlimit_cmd.h linux-2.6.16-vs2.0.2-rc15/include/linux/vserver/dlimit_cmd.h
+--- linux-2.6.16-vs2.0.2-rc14/include/linux/vserver/dlimit_cmd.h 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/include/linux/vserver/dlimit_cmd.h 2006-03-24 16:50:44 +0100
+@@ -1,8 +1,6 @@
+ #ifndef _VX_DLIMIT_CMD_H
+ #define _VX_DLIMIT_CMD_H
+
+-#include <linux/config.h>
+-
+
+ /* dlimit vserver commands */
+
+diff -u linux-2.6.16-vs2.0.2-rc14/include/linux/vserver/inode.h linux-2.6.16-vs2.0.2-rc15/include/linux/vserver/inode.h
+--- linux-2.6.16-vs2.0.2-rc14/include/linux/vserver/inode.h 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/include/linux/vserver/inode.h 2006-03-24 16:50:44 +0100
+@@ -15,8 +15,6 @@
+
+ #ifdef __KERNEL__
+
+-#include <linux/config.h>
+-
+
+ #ifdef CONFIG_VSERVER_PROC_SECURE
+ #define IATTR_PROC_DEFAULT ( IATTR_ADMIN | IATTR_HIDE )
+diff -u linux-2.6.16-vs2.0.2-rc14/include/linux/vserver/inode_cmd.h linux-2.6.16-vs2.0.2-rc15/include/linux/vserver/inode_cmd.h
+--- linux-2.6.16-vs2.0.2-rc14/include/linux/vserver/inode_cmd.h 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/include/linux/vserver/inode_cmd.h 2006-03-24 16:50:44 +0100
+@@ -28,8 +28,6 @@
+
+ #ifdef __KERNEL__
+
+-#include <linux/config.h>
+-
+
+ #ifdef CONFIG_COMPAT
+
+diff -u linux-2.6.16-vs2.0.2-rc14/include/linux/vserver/limit_cmd.h linux-2.6.16-vs2.0.2-rc15/include/linux/vserver/limit_cmd.h
+--- linux-2.6.16-vs2.0.2-rc14/include/linux/vserver/limit_cmd.h 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/include/linux/vserver/limit_cmd.h 2006-04-03 02:37:59 +0200
+@@ -28,10 +28,28 @@
+ #ifdef __KERNEL__
+
++#ifdef CONFIG_IA32_EMULATION
++
++struct vcmd_ctx_rlimit_v0_x32 {
++ uint32_t id;
++ uint64_t minimum;
++ uint64_t softlimit;
++ uint64_t maximum;
++} __attribute__ ((aligned (4)));
++
++#endif /* CONFIG_IA32_EMULATION */
++
+ #include <linux/compiler.h>
+
+ extern int vc_get_rlimit(uint32_t, void __user *);
+ extern int vc_set_rlimit(uint32_t, void __user *);
+ extern int vc_get_rlimit_mask(uint32_t, void __user *);
+
++#ifdef CONFIG_IA32_EMULATION
++
++extern int vc_get_rlimit_x32(uint32_t, void __user *);
++extern int vc_set_rlimit_x32(uint32_t, void __user *);
++
++#endif /* CONFIG_IA32_EMULATION */
++
+ #endif /* __KERNEL__ */
+ #endif /* _VX_LIMIT_CMD_H */
+diff -u linux-2.6.16-vs2.0.2-rc14/include/linux/vserver/limit_def.h linux-2.6.16-vs2.0.2-rc15/include/linux/vserver/limit_def.h
+--- linux-2.6.16-vs2.0.2-rc14/include/linux/vserver/limit_def.h 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/include/linux/vserver/limit_def.h 2006-03-24 16:50:44 +0100
+@@ -1,7 +1,6 @@
+ #ifndef _VX_LIMIT_DEF_H
+ #define _VX_LIMIT_DEF_H
+
+-#include <linux/config.h>
+ #include <asm/atomic.h>
+ #include <asm/resource.h>
+
+diff -u linux-2.6.16-vs2.0.2-rc14/include/linux/vserver/sched_def.h linux-2.6.16-vs2.0.2-rc15/include/linux/vserver/sched_def.h
+--- linux-2.6.16-vs2.0.2-rc14/include/linux/vserver/sched_def.h 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/include/linux/vserver/sched_def.h 2006-03-24 16:50:44 +0100
+@@ -1,7 +1,6 @@
+ #ifndef _VX_SCHED_DEF_H
+ #define _VX_SCHED_DEF_H
+
+-#include <linux/config.h>
+ #include <linux/spinlock.h>
+ #include <linux/jiffies.h>
+ #include <linux/cpumask.h>
+diff -u linux-2.6.16-vs2.0.2-rc14/include/linux/vserver/signal_cmd.h linux-2.6.16-vs2.0.2-rc15/include/linux/vserver/signal_cmd.h
+--- linux-2.6.16-vs2.0.2-rc14/include/linux/vserver/signal_cmd.h 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/include/linux/vserver/signal_cmd.h 2006-04-03 05:31:18 +0200
+@@ -13,8 +13,8 @@
+ };
+
+ struct vcmd_wait_exit_v0 {
+- int32_t a;
+- int32_t b;
++ int32_t reboot_cmd;
++ int32_t exit_code;
+ };
+
+ #ifdef __KERNEL__
+diff -u linux-2.6.16-vs2.0.2-rc14/kernel/exit.c linux-2.6.16-vs2.0.2-rc15/kernel/exit.c
+--- linux-2.6.16-vs2.0.2-rc14/kernel/exit.c 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/kernel/exit.c 2006-04-03 05:31:18 +0200
+@@ -869,7 +869,7 @@
+ __exit_files(tsk);
+ __exit_fs(tsk);
+ exit_namespace(tsk);
+- exit_vx_info(tsk);
++ exit_vx_info(tsk, code);
+ exit_nx_info(tsk);
+ exit_thread();
+ cpuset_exit(tsk);
+diff -u linux-2.6.16-vs2.0.2-rc14/kernel/vserver/Kconfig linux-2.6.16-vs2.0.2-rc15/kernel/vserver/Kconfig
+--- linux-2.6.16-vs2.0.2-rc14/kernel/vserver/Kconfig 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/kernel/vserver/Kconfig 2006-03-24 16:50:44 +0100
+@@ -2,21 +2,6 @@
+ # Linux VServer configuration
+ #
+
+-config VSERVER
+- bool
+- default y
+-
+-config VSERVER_SECURITY
+- bool
+- depends on SECURITY
+- default y
+- select SECURITY_CAPABILITIES
+-
+-config VSERVER_LEGACYNET
+- bool
+- depends on !VSERVER_NGNET
+- default y
+-
+ menu "Linux VServer"
+
+ config VSERVER_LEGACY
+@@ -179,0 +165,16 @@
++
++config VSERVER
++ bool
++ default y
++
++config VSERVER_SECURITY
++ bool
++ depends on SECURITY
++ default y
++ select SECURITY_CAPABILITIES
++
++config VSERVER_LEGACYNET
++ bool
++ depends on !VSERVER_NGNET
++ default y
++
+diff -u linux-2.6.16-vs2.0.2-rc14/kernel/vserver/context.c linux-2.6.16-vs2.0.2-rc15/kernel/vserver/context.c
+--- linux-2.6.16-vs2.0.2-rc14/kernel/vserver/context.c 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/kernel/vserver/context.c 2006-04-03 05:31:18 +0200
+@@ -19,7 +19,6 @@
+ *
+ */
+
+-#include <linux/config.h>
+ #include <linux/slab.h>
+ #include <linux/types.h>
+ #include <linux/namespace.h>
+@@ -82,6 +81,9 @@
+ new->vx_bcaps = CAP_INIT_EFF_SET;
+ new->vx_ccaps = 0;
+
++ new->reboot_cmd = 0;
++ new->exit_code = 0;
++
+ vxdprintk(VXD_CBIT(xid, 0),
+ "alloc_vx_info(%d) = %p", xid, new);
+ vxh_alloc_vx_info(new);
+@@ -617,12 +619,13 @@
+ return 0;
+ }
+
+-void vx_exit_init(struct vx_info *vxi, struct task_struct *p)
++void vx_exit_init(struct vx_info *vxi, struct task_struct *p, int code)
+ {
+ vxdprintk(VXD_CBIT(xid, 6),
+ "vx_exit_init(%p[#%d],%p[#%d,%d,%d])",
+ vxi, vxi->vx_id, p, p->xid, p->pid, p->tgid);
+
++ vxi->exit_code = code;
+ vxi->vx_initpid = 0;
+ }
+
+@@ -643,7 +646,7 @@
+
+ /* task must be current or locked */
+
+-void exit_vx_info(struct task_struct *p)
++void exit_vx_info(struct task_struct *p, int code)
+ {
+ struct vx_info *vxi = p->vx_info;
+
+@@ -651,8 +654,9 @@
+ atomic_dec(&vxi->cvirt.nr_threads);
+ vx_nproc_dec(p);
+
++ vxi->exit_code = code;
+ if (vxi->vx_initpid == p->tgid)
+- vx_exit_init(vxi, p);
++ vx_exit_init(vxi, p, code);
+ if (vxi->vx_reaper == p)
+ vx_set_reaper(vxi, child_reaper);
+ release_vx_info(vxi, p);
+diff -u linux-2.6.16-vs2.0.2-rc14/kernel/vserver/cvirt_init.h linux-2.6.16-vs2.0.2-rc15/kernel/vserver/cvirt_init.h
+--- linux-2.6.16-vs2.0.2-rc14/kernel/vserver/cvirt_init.h 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/kernel/vserver/cvirt_init.h 2006-03-24 16:50:48 +0100
+@@ -1,6 +1,4 @@
+
+-#include <linux/config.h>
+-
+
+ #include <linux/config.h>
+
+diff -u linux-2.6.16-vs2.0.2-rc14/kernel/vserver/dlimit.c linux-2.6.16-vs2.0.2-rc15/kernel/vserver/dlimit.c
+--- linux-2.6.16-vs2.0.2-rc14/kernel/vserver/dlimit.c 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/kernel/vserver/dlimit.c 2006-03-24 16:50:48 +0100
+@@ -10,7 +10,6 @@
+ *
+ */
+
+-#include <linux/config.h>
+ #include <linux/fs.h>
+ #include <linux/namespace.h>
+ #include <linux/namei.h>
+diff -u linux-2.6.16-vs2.0.2-rc14/kernel/vserver/helper.c linux-2.6.16-vs2.0.2-rc15/kernel/vserver/helper.c
+--- linux-2.6.16-vs2.0.2-rc14/kernel/vserver/helper.c 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/kernel/vserver/helper.c 2006-04-03 05:30:52 +0200
+@@ -9,7 +9,6 @@
+ *
+ */
+
+-#include <linux/config.h>
+ #include <linux/errno.h>
+ #include <linux/kmod.h>
+ #include <linux/sched.h>
+@@ -64,6 +63,10 @@
+ "PATH=/sbin:/usr/sbin:/bin:/usr/bin",
+ uid_buf, pid_buf, cmd_buf, 0};
+
++ if (vx_info_state(vxi, VXS_HELPER))
++ return -EAGAIN;
++ vxi->vx_state |= VXS_HELPER;
++
+ snprintf(id_buf, sizeof(id_buf)-1, "%d", vxi->vx_id);
+
+ snprintf(cmd_buf, sizeof(cmd_buf)-1, "VS_CMD=%08x", cmd);
+@@ -88,6 +91,7 @@
+ break;
+
+ default:
++ vxi->vx_state &= ~VXS_HELPER;
+ return 0;
+ }
+
+@@ -96,6 +100,8 @@
+ #else
+ ret = do_vshelper(vshelper_path, argv, envp, 0);
+ #endif
++ vxi->vx_state &= ~VXS_HELPER;
++ __wakeup_vx_info(vxi);
+ return (ret) ? -EPERM : 0;
+ }
+
+@@ -108,6 +114,12 @@
+ vxdprintk(VXD_CBIT(misc, 5),
+ "vs_reboot(%p[#%d],%d)",
+ vxi, vxi?vxi->vx_id:0, cmd);
++
++ ret = vs_reboot_helper(vxi, cmd, arg);
++ if (ret)
++ return ret;
++
++ vxi->reboot_cmd = cmd;
+ if (vx_info_flags(vxi, VXF_REBOOT_KILL, 0)) {
+ switch (cmd) {
+ case LINUX_REBOOT_CMD_RESTART:
+@@ -118,10 +130,8 @@
+ default:
+ break;
+ }
+- } else {
+- ret = vs_reboot_helper(vxi, cmd, arg);
+ }
+- return ret;
++ return 0;
+ }
+
+
+diff -u linux-2.6.16-vs2.0.2-rc14/kernel/vserver/history.c linux-2.6.16-vs2.0.2-rc15/kernel/vserver/history.c
+--- linux-2.6.16-vs2.0.2-rc14/kernel/vserver/history.c 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/kernel/vserver/history.c 2006-03-24 16:50:48 +0100
+@@ -11,7 +11,6 @@
+ *
+ */
+
+-#include <linux/config.h>
+ #include <linux/errno.h>
+ #include <linux/module.h>
+ #include <linux/types.h>
+diff -u linux-2.6.16-vs2.0.2-rc14/kernel/vserver/init.c linux-2.6.16-vs2.0.2-rc15/kernel/vserver/init.c
+--- linux-2.6.16-vs2.0.2-rc14/kernel/vserver/init.c 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/kernel/vserver/init.c 2006-03-24 16:50:44 +0100
+@@ -9,7 +9,6 @@
+ *
+ */
+
+-#include <linux/config.h>
+ #include <linux/errno.h>
+ #include <linux/init.h>
+ #include <linux/module.h>
+diff -u linux-2.6.16-vs2.0.2-rc14/kernel/vserver/inode.c linux-2.6.16-vs2.0.2-rc15/kernel/vserver/inode.c
+--- linux-2.6.16-vs2.0.2-rc14/kernel/vserver/inode.c 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/kernel/vserver/inode.c 2006-03-24 16:50:48 +0100
+@@ -9,7 +9,6 @@
+ *
+ */
+
+-#include <linux/config.h>
+ #include <linux/sched.h>
+ #include <linux/vs_context.h>
+ #include <linux/proc_fs.h>
+diff -u linux-2.6.16-vs2.0.2-rc14/kernel/vserver/limit.c linux-2.6.16-vs2.0.2-rc15/kernel/vserver/limit.c
+--- linux-2.6.16-vs2.0.2-rc14/kernel/vserver/limit.c 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/kernel/vserver/limit.c 2006-04-03 01:43:40 +0200
+@@ -71,53 +71,114 @@
+ return limit;
+ }
+
+-int vc_get_rlimit(uint32_t id, void __user *data)
++int do_get_rlimit(xid_t xid, uint32_t id,
++ uint64_t *minimum, uint64_t *softlimit, uint64_t *maximum)
+ {
+ struct vx_info *vxi;
+- struct vcmd_ctx_rlimit_v0 vc_data;
+
+- if (copy_from_user (&vc_data, data, sizeof(vc_data)))
+- return -EFAULT;
+- if (!is_valid_rlimit(vc_data.id))
++ if (!is_valid_rlimit(id))
+ return -EINVAL;
+
+- vxi = lookup_vx_info(id);
++ vxi = lookup_vx_info(xid);
+ if (!vxi)
+ return -ESRCH;
+
+- vc_data.maximum = vc_get_rlim(vxi, vc_data.id);
+- vc_data.minimum = CRLIM_UNSET;
+- vc_data.softlimit = CRLIM_UNSET;
++ if (minimum)
++ *minimum = CRLIM_UNSET;
++ if (softlimit)
++ *softlimit = CRLIM_UNSET;
++ if (maximum)
++ *maximum = vc_get_rlim(vxi, id);
+ put_vx_info(vxi);
++ return 0;
++}
++
++int vc_get_rlimit(uint32_t id, void __user *data)
++{
++ struct vcmd_ctx_rlimit_v0 vc_data;
++ int ret;
++
++ if (copy_from_user (&vc_data, data, sizeof(vc_data)))
++ return -EFAULT;
++
++ ret = do_get_rlimit(id, vc_data.id,
++ &vc_data.minimum, &vc_data.softlimit, &vc_data.maximum);
++ if (ret)
++ return ret;
+
+ if (copy_to_user (data, &vc_data, sizeof(vc_data)))
+ return -EFAULT;
+ return 0;
+ }
+
+-int vc_set_rlimit(uint32_t id, void __user *data)
++int do_set_rlimit(xid_t xid, uint32_t id,
++ uint64_t minimum, uint64_t softlimit, uint64_t maximum)
+ {
+ struct vx_info *vxi;
++
++ if (!is_valid_rlimit(id))
++ return -EINVAL;
++
++ vxi = lookup_vx_info(xid);
++ if (!vxi)
++ return -ESRCH;
++
++ if (maximum != CRLIM_KEEP)
++ vxi->limit.rlim[id] = maximum;
++
++ put_vx_info(vxi);
++ return 0;
++}
++
++int vc_set_rlimit(uint32_t id, void __user *data)
++{
+ struct vcmd_ctx_rlimit_v0 vc_data;
+
+ if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RESOURCE))
+ return -EPERM;
+ if (copy_from_user (&vc_data, data, sizeof(vc_data)))
+ return -EFAULT;
+- if (!is_valid_rlimit(vc_data.id))
+- return -EINVAL;
+
+- vxi = lookup_vx_info(id);
+- if (!vxi)
+- return -ESRCH;
++ return do_set_rlimit(id, vc_data.id,
++ vc_data.minimum, vc_data.softlimit, vc_data.maximum);
++}
+
+- if (vc_data.maximum != CRLIM_KEEP)
+- vxi->limit.rlim[vc_data.id] = vc_data.maximum;
+- put_vx_info(vxi);
++#ifdef CONFIG_IA32_EMULATION
++
++int vc_set_rlimit_x32(uint32_t id, void __user *data)
++{
++ struct vcmd_ctx_rlimit_v0_x32 vc_data;
++
++ if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RESOURCE))
++ return -EPERM;
++ if (copy_from_user (&vc_data, data, sizeof(vc_data)))
++ return -EFAULT;
++
++ return do_set_rlimit(id, vc_data.id,
++ vc_data.minimum, vc_data.softlimit, vc_data.maximum);
++}
+
++int vc_get_rlimit_x32(uint32_t id, void __user *data)
++{
++ struct vcmd_ctx_rlimit_v0_x32 vc_data;
++ int ret;
++
++ if (copy_from_user (&vc_data, data, sizeof(vc_data)))
++ return -EFAULT;
++
++ ret = do_get_rlimit(id, vc_data.id,
++ &vc_data.minimum, &vc_data.softlimit, &vc_data.maximum);
++ if (ret)
++ return ret;
++
++ if (copy_to_user (data, &vc_data, sizeof(vc_data)))
++ return -EFAULT;
+ return 0;
+ }
+
++#endif /* CONFIG_IA32_EMULATION */
++
++
+ int vc_get_rlimit_mask(uint32_t id, void __user *data)
+ {
+ static struct vcmd_ctx_rlimit_mask_v0 mask = {
+diff -u linux-2.6.16-vs2.0.2-rc14/kernel/vserver/limit_init.h linux-2.6.16-vs2.0.2-rc15/kernel/vserver/limit_init.h
+--- linux-2.6.16-vs2.0.2-rc14/kernel/vserver/limit_init.h 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/kernel/vserver/limit_init.h 2006-03-24 16:50:48 +0100
+@@ -1,6 +1,4 @@
+
+-#include <linux/config.h>
+-
+
+ #include <linux/config.h>
+
+diff -u linux-2.6.16-vs2.0.2-rc14/kernel/vserver/network.c linux-2.6.16-vs2.0.2-rc15/kernel/vserver/network.c
+--- linux-2.6.16-vs2.0.2-rc14/kernel/vserver/network.c 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/kernel/vserver/network.c 2006-03-24 16:50:48 +0100
+@@ -13,7 +13,6 @@
+ *
+ */
+
+-#include <linux/config.h>
+ #include <linux/slab.h>
+ #include <linux/vserver/network_cmd.h>
+ #include <linux/rcupdate.h>
+diff -u linux-2.6.16-vs2.0.2-rc14/kernel/vserver/sched.c linux-2.6.16-vs2.0.2-rc15/kernel/vserver/sched.c
+--- linux-2.6.16-vs2.0.2-rc14/kernel/vserver/sched.c 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/kernel/vserver/sched.c 2006-03-24 16:50:48 +0100
+@@ -10,7 +10,6 @@
+ *
+ */
+
+-#include <linux/config.h>
+ #include <linux/sched.h>
+ #include <linux/vs_context.h>
+ #include <linux/vs_sched.h>
+diff -u linux-2.6.16-vs2.0.2-rc14/kernel/vserver/signal.c linux-2.6.16-vs2.0.2-rc15/kernel/vserver/signal.c
+--- linux-2.6.16-vs2.0.2-rc14/kernel/vserver/signal.c 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/kernel/vserver/signal.c 2006-04-03 05:31:18 +0200
+@@ -99,7 +99,8 @@
+ set_current_state(TASK_INTERRUPTIBLE);
+
+ wait:
+- if (vx_info_state(vxi, VXS_SHUTDOWN|VXS_HASHED) == VXS_SHUTDOWN)
++ if (vx_info_state(vxi,
++ VXS_SHUTDOWN|VXS_HASHED|VXS_HELPER) == VXS_SHUTDOWN)
+ goto out;
+ if (signal_pending(current)) {
+ ret = -ERESTARTSYS;
+@@ -119,6 +120,7 @@
+ int vc_wait_exit(uint32_t id, void __user *data)
+ {
+ struct vx_info *vxi;
++ struct vcmd_wait_exit_v0 vc_data;
+ int ret;
+
+ vxi = lookup_vx_info(id);
+@@ -126,7 +128,12 @@
+ return -ESRCH;
+
+ ret = __wait_exit(vxi);
++ vc_data.reboot_cmd = vxi->reboot_cmd;
++ vc_data.exit_code = vxi->exit_code;
+ put_vx_info(vxi);
++
++ if (copy_to_user (data, &vc_data, sizeof(vc_data)))
++ ret = -EFAULT;
+ return ret;
+ }
+
+diff -u linux-2.6.16-vs2.0.2-rc14/kernel/vserver/switch.c linux-2.6.16-vs2.0.2-rc15/kernel/vserver/switch.c
+--- linux-2.6.16-vs2.0.2-rc14/kernel/vserver/switch.c 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/kernel/vserver/switch.c 2006-04-03 02:38:01 +0200
+@@ -14,7 +14,6 @@
+ *
+ */
+
+-#include <linux/config.h>
+ #include <linux/linkage.h>
+ #include <linux/sched.h>
+ #include <linux/compat.h>
+@@ -131,10 +130,17 @@
+ #endif
+
+ switch (cmd) {
++#ifdef CONFIG_IA32_EMULATION
++ case VCMD_get_rlimit:
++ return __COMPAT(vc_get_rlimit, id, data, compat);
++ case VCMD_set_rlimit:
++ return __COMPAT(vc_set_rlimit, id, data, compat);
++#else
+ case VCMD_get_rlimit:
+ return vc_get_rlimit(id, data);
+ case VCMD_set_rlimit:
+ return vc_set_rlimit(id, data);
++#endif
+ case VCMD_get_rlimit_mask:
+ return vc_get_rlimit_mask(id, data);
+
+diff -u linux-2.6.16-vs2.0.2-rc14/kernel/vserver/vci_config.h linux-2.6.16-vs2.0.2-rc15/kernel/vserver/vci_config.h
+--- linux-2.6.16-vs2.0.2-rc14/kernel/vserver/vci_config.h 2006-03-20 17:34:50 +0100
++++ linux-2.6.16-vs2.0.2-rc15/kernel/vserver/vci_config.h 2006-03-24 16:50:44 +0100
+@@ -1,7 +1,4 @@
+
+-#include <linux/config.h>
+-
+-
+ enum {
+ VCI_KCBIT_LEGACY = 1,
+ VCI_KCBIT_LEGACYNET,
More information about the Kernel-svn-changes
mailing list