diff -NurpP --minimal linux-2.6.9-rc2-vs1.9.2.27.2/include/linux/vs_limit.h linux-2.6.9-rc2-vs1.9.2.27.3/include/linux/vs_limit.h --- linux-2.6.9-rc2-vs1.9.2.27.2/include/linux/vs_limit.h 2004-09-15 20:15:34.000000000 +0200 +++ linux-2.6.9-rc2-vs1.9.2.27.3/include/linux/vs_limit.h 2004-09-16 00:13:41.000000000 +0200 @@ -47,17 +47,23 @@ extern void __freeup_files(struct vx_inf } while (0) #define vx_files_inc(f) do {\ - vx_acc_cres((f)->f_vx_info, 1, (f), RLIMIT_NOFILE); \ - if ((f)->f_vx_info) {\ + struct vx_info *vxi = (f)->f_vx_info; \ + vx_acc_cres(vxi, 1, (f), RLIMIT_NOFILE); \ + if (vxi) { \ + spin_lock(&vxi->vx_lock); \ printk("··· vx_files_inc(%p)\n", (f)); \ - list_add(&(f)->f_vx_list, &(f)->f_vx_info->vx_files); \ + list_add(&(f)->f_vx_list, &vxi->vx_files); \ + spin_unlock(&vxi->vx_lock); \ }} while (0) #define vx_files_dec(f) do {\ - vx_acc_cres((f)->f_vx_info,-1, (f), RLIMIT_NOFILE); \ - if ((f)->f_vx_info) {\ - list_del(&(f)->f_vx_list); \ + struct vx_info *vxi = (f)->f_vx_info; \ + vx_acc_cres(vxi,-1, (f), RLIMIT_NOFILE); \ + if (vxi) { \ + spin_lock(&vxi->vx_lock); \ printk("··· vx_files_dec(%p)\n", (f)); \ + list_del(&(f)->f_vx_list); \ + spin_unlock(&vxi->vx_lock); \ }} while (0) /* diff -NurpP --minimal linux-2.6.9-rc2-vs1.9.2.27.2/include/linux/vserver/context.h linux-2.6.9-rc2-vs1.9.2.27.3/include/linux/vserver/context.h --- linux-2.6.9-rc2-vs1.9.2.27.2/include/linux/vserver/context.h 2004-09-15 18:32:22.000000000 +0200 +++ linux-2.6.9-rc2-vs1.9.2.27.3/include/linux/vserver/context.h 2004-09-15 22:59:51.000000000 +0200 @@ -36,6 +36,8 @@ struct vx_info { uint64_t vx_ccaps; /* context caps (vserver) */ pid_t vx_initpid; /* PID of fake init process */ + + spinlock_t vx_lock; struct list_head vx_files; struct _vx_limit limit; /* vserver limits */ Files linux-2.6.9-rc2-vs1.9.2.27.2/kernel/vserver/.context.c.swp and linux-2.6.9-rc2-vs1.9.2.27.3/kernel/vserver/.context.c.swp differ diff -NurpP --minimal linux-2.6.9-rc2-vs1.9.2.27.2/kernel/vserver/context.c linux-2.6.9-rc2-vs1.9.2.27.3/kernel/vserver/context.c --- linux-2.6.9-rc2-vs1.9.2.27.2/kernel/vserver/context.c 2004-09-15 20:39:09.000000000 +0200 +++ linux-2.6.9-rc2-vs1.9.2.27.3/kernel/vserver/context.c 2004-09-16 00:23:37.000000000 +0200 @@ -61,6 +61,7 @@ static struct vx_info *__alloc_vx_info(x vx_info_init_cacct(&new->cacct); INIT_LIST_HEAD(&new->vx_files); + new->vx_lock = SPIN_LOCK_UNLOCKED; new->vx_flags = VXF_STATE_SETUP|VXF_STATE_INIT; new->vx_bcaps = CAP_INIT_EFF_SET; @@ -116,16 +117,18 @@ void __dump_filepath(struct file *f) void __freeup_files(struct vx_info *vxi) { - struct list_head *entry, *helper; + struct list_head *entry; printk("__freeup_files() dumping ...\n"); - list_for_each_safe(entry, helper, &vxi->vx_files) { + spin_lock(&vxi->vx_lock); + list_for_each(entry, &vxi->vx_files) { struct file *fp = list_entry(entry, struct file, f_vx_list); __dump_filepath(fp); // vx_files_dec(fp); // clr_vx_info(&fp->f_vx_info); } + spin_unlock(&vxi->vx_lock); } static inline int __free_vx_info(struct vx_info *vxi)