diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/arch/i386/Kconfig linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/i386/Kconfig --- linux-2.6.11.7-vs2.0-pre2/arch/i386/Kconfig 2005-04-23 02:25:22.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/i386/Kconfig 2005-04-29 19:01:29.000000000 +0200 @@ -568,6 +568,14 @@ config X86_IO_APIC depends on !SMP && X86_UP_IOAPIC default y +config KERNEL_HZ + int "Timer Frequency (100-10000)" + range 100 10000 + default "1000" + help + This allows you to specify the frequency at which the + kernel timer interrupt will occur. + config X86_TSC bool depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2) && !X86_NUMAQ diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/arch/i386/kernel/cpu/proc.c linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/i386/kernel/cpu/proc.c --- linux-2.6.11.7-vs2.0-pre2/arch/i386/kernel/cpu/proc.c 2005-03-09 12:57:47.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/i386/kernel/cpu/proc.c 2005-04-29 19:01:29.000000000 +0200 @@ -124,8 +124,8 @@ static int show_cpuinfo(struct seq_file seq_printf(m, " %s", x86_cap_flags[i]); seq_printf(m, "\nbogomips\t: %lu.%02lu\n\n", - c->loops_per_jiffy/(500000/HZ), - (c->loops_per_jiffy/(5000/HZ)) % 100); + HZ*(c->loops_per_jiffy >> 3)/62500, + (HZ*(c->loops_per_jiffy >> 3)/625) % 100); return 0; } diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/arch/i386/kernel/smpboot.c linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/i386/kernel/smpboot.c --- linux-2.6.11.7-vs2.0-pre2/arch/i386/kernel/smpboot.c 2005-03-09 12:57:47.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/i386/kernel/smpboot.c 2005-04-29 19:01:29.000000000 +0200 @@ -1025,8 +1025,8 @@ static void __init smp_boot_cpus(unsigne printk(KERN_INFO "Total of %d processors activated (%lu.%02lu BogoMIPS).\n", cpucount+1, - bogosum/(500000/HZ), - (bogosum/(5000/HZ))%100); + HZ*(bogosum >> 3)/62500, + (HZ*(bogosum >> 3)/625) % 100); Dprintk("Before bogocount - setting activated=1.\n"); diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/arch/ia64/ia32/ia32_entry.S linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/ia64/ia32/ia32_entry.S --- linux-2.6.11.7-vs2.0-pre2/arch/ia64/ia32/ia32_entry.S 2005-03-09 12:57:47.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/ia64/ia32/ia32_entry.S 2005-04-29 19:01:29.000000000 +0200 @@ -483,7 +483,7 @@ ia32_syscall_table: data8 sys_tgkill /* 270 */ data8 compat_sys_utimes data8 sys32_fadvise64_64 - data8 sys_ni_syscall + data8 sys32_vserver data8 sys_ni_syscall data8 sys_ni_syscall /* 275 */ data8 sys_ni_syscall diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/arch/mips/kernel/scall32-o32.S linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/mips/kernel/scall32-o32.S --- linux-2.6.11.7-vs2.0-pre2/arch/mips/kernel/scall32-o32.S 2005-03-09 12:57:48.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/mips/kernel/scall32-o32.S 2005-04-29 19:01:30.000000000 +0200 @@ -617,7 +617,7 @@ einval: li v0, -EINVAL sys sys_mq_timedreceive 5 sys sys_mq_notify 2 /* 4275 */ sys sys_mq_getsetattr 3 - sys sys_ni_syscall 0 /* sys_vserver */ + sys sys_vserver 3 sys sys_waitid 4 sys sys_ni_syscall 0 /* available, was setaltroot */ sys sys_add_key 5 diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/arch/mips/kernel/scall64-64.S linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/mips/kernel/scall64-64.S --- linux-2.6.11.7-vs2.0-pre2/arch/mips/kernel/scall64-64.S 2005-03-09 12:57:48.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/mips/kernel/scall64-64.S 2005-04-29 19:01:30.000000000 +0200 @@ -443,7 +443,7 @@ sys_call_table: PTR sys_mq_timedreceive PTR sys_mq_notify PTR sys_mq_getsetattr /* 5235 */ - PTR sys_ni_syscall /* sys_vserver */ + PTR sys_vserver PTR sys_waitid PTR sys_ni_syscall /* available, was setaltroot */ PTR sys_add_key diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/arch/mips/kernel/scall64-n32.S linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/mips/kernel/scall64-n32.S --- linux-2.6.11.7-vs2.0-pre2/arch/mips/kernel/scall64-n32.S 2005-03-09 12:57:48.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/mips/kernel/scall64-n32.S 2005-04-29 19:01:30.000000000 +0200 @@ -357,7 +357,7 @@ EXPORT(sysn32_call_table) PTR compat_sys_mq_timedreceive PTR compat_sys_mq_notify PTR compat_sys_mq_getsetattr - PTR sys_ni_syscall /* 6240, sys_vserver */ + PTR sys32_vserver /* 6240 */ PTR sys_waitid PTR sys_ni_syscall /* available, was setaltroot */ PTR sys_add_key diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/arch/mips/kernel/scall64-o32.S linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/mips/kernel/scall64-o32.S --- linux-2.6.11.7-vs2.0-pre2/arch/mips/kernel/scall64-o32.S 2005-03-09 12:57:48.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/mips/kernel/scall64-o32.S 2005-04-29 19:01:30.000000000 +0200 @@ -479,7 +479,7 @@ sys_call_table: PTR compat_sys_mq_timedreceive PTR compat_sys_mq_notify /* 4275 */ PTR compat_sys_mq_getsetattr - PTR sys_ni_syscall /* sys_vserver */ + PTR sys32_vserver PTR sys_waitid PTR sys_ni_syscall /* available, was setaltroot */ PTR sys_add_key /* 4280 */ diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/arch/ppc/boot/include/serial.h linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/ppc/boot/include/serial.h --- linux-2.6.11.7-vs2.0-pre2/arch/ppc/boot/include/serial.h 2004-12-24 22:33:48.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/ppc/boot/include/serial.h 2005-04-29 19:01:30.000000000 +0200 @@ -36,8 +36,8 @@ struct serial_state { int count; u8 *iomem_base; u16 iomem_reg_shift; - unsigned short close_delay; - unsigned short closing_wait; /* time to wait before closing */ + unsigned int close_delay; + unsigned int closing_wait; /* time to wait before closing */ unsigned long icount; int io_type; void *info; diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/arch/ppc64/kernel/misc.S linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/ppc64/kernel/misc.S --- linux-2.6.11.7-vs2.0-pre2/arch/ppc64/kernel/misc.S 2005-04-23 02:25:22.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/ppc64/kernel/misc.S 2005-04-29 19:01:30.000000000 +0200 @@ -924,7 +924,7 @@ _GLOBAL(sys_call_table32) .llong .ppc32_fadvise64_64 /* 32bit only fadvise64_64 */ .llong .ppc_rtas /* 255 */ .llong .sys_ni_syscall /* 256 reserved for sys_debug_setcontext */ - .llong .sys_vserver + .llong .sys32_vserver .llong .sys_ni_syscall /* 258 reserved for new sys_remap_file_pages */ .llong .compat_sys_mbind .llong .compat_sys_get_mempolicy /* 260 */ @@ -1199,7 +1199,7 @@ _GLOBAL(sys_call_table) .llong .sys_ni_syscall /* 32bit only fadvise64_64 */ .llong .ppc_rtas /* 255 */ .llong .sys_ni_syscall /* 256 reserved for sys_debug_setcontext */ - .llong .sys_ni_syscall /* 257 reserved for vserver */ + .llong .sys_vserver .llong .sys_ni_syscall /* 258 reserved for new sys_remap_file_pages */ .llong .sys_mbind .llong .sys_get_mempolicy /* 260 */ diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/arch/s390/kernel/syscalls.S linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/s390/kernel/syscalls.S --- linux-2.6.11.7-vs2.0-pre2/arch/s390/kernel/syscalls.S 2005-04-23 02:25:22.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/s390/kernel/syscalls.S 2005-04-29 19:01:30.000000000 +0200 @@ -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) SYSCALL(sys_clock_nanosleep,sys_clock_nanosleep,sys32_clock_nanosleep_wrapper) -SYSCALL(sys_vserver,sys_vserver,sys_vserver) +SYSCALL(sys_vserver,sys_vserver,sys32_vserver) 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) diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/arch/sparc64/kernel/systbls.S linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/sparc64/kernel/systbls.S --- linux-2.6.11.7-vs2.0-pre2/arch/sparc64/kernel/systbls.S 2005-04-23 02:25:22.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/sparc64/kernel/systbls.S 2005-04-29 19:01:30.000000000 +0200 @@ -73,7 +73,7 @@ sys_call_table32: /*250*/ .word sys32_mremap, sys32_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl .word sys_ni_syscall, sys32_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep /*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun - .word sys_timer_delete, sys32_timer_create, sys_vserver, compat_sys_io_setup, sys_io_destroy + .word sys_timer_delete, sys32_timer_create, sys32_vserver, compat_sys_io_setup, sys_io_destroy /*270*/ .word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink .word sys_mq_timedsend, sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, compat_sys_waitid /*280*/ .word sys_ni_syscall, sys_add_key, sys_request_key, sys_keyctl diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/arch/x86_64/ia32/ia32entry.S linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/x86_64/ia32/ia32entry.S --- linux-2.6.11.7-vs2.0-pre2/arch/x86_64/ia32/ia32entry.S 2005-04-23 02:25:22.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/arch/x86_64/ia32/ia32entry.S 2005-04-29 19:01:30.000000000 +0200 @@ -579,7 +579,7 @@ ia32_sys_call_table: .quad sys_tgkill /* 270 */ .quad compat_sys_utimes .quad sys32_fadvise64_64 - .quad sys_vserver + .quad sys32_vserver .quad sys_mbind .quad compat_sys_get_mempolicy /* 275 */ .quad sys_set_mempolicy diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/debug.txt linux-2.6.11.7-vs2.0-pre3-allno_fix/debug.txt --- linux-2.6.11.7-vs2.0-pre2/debug.txt 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/debug.txt 2005-04-29 19:01:33.000000000 +0200 @@ -0,0 +1,171 @@ + +debug_switch: + + 0 1 + + 1 2 + + 2 4 + + 3 8 + + 4 16 + + 5 32 + + 6 64 + + 7 128 + + +debug_xid: + + 0 1 "alloc_vx_info(%d) = %p\n" + "dealloc_vx_info(%p)" + "loc_vx_info(%d) = %p (not available)" + "loc_vx_info(%d) = %p (found)" + "loc_vx_info(%d) = %p (new)" + + 1 2 "alloc_vx_info(%d)*" + "loc_vx_info(%d)*" + "locate_vx_info(%d)" + + 2 4 "get_vx_info(%p[#%d.%d])" + "put_vx_info(%p[#%d.%d])" + + 3 8 "set_vx_info(%p[#%d.%d.%d])" + "clr_vx_info(%p[#%d.%d.%d])" + "rcu_free_vx_info(%p): uc=%d" + + 4 16 "__hash_vx_info: %p[#%d]" + "__unhash_vx_info: %p[#%d]" + "__vx_dynamic_id: [#%d]" + + 5 32 "vx_migrate_task(%p,%p[#%d.%d])" + "task_get_vx_info(%p)" + + 6 64 "vx_set_init(%p[#%d],%p[#%d,%d,%d])" + + 7 128 "vx_propagate_xid(%p[#%d.%d]): %d" + + +debug_nid: + + 0 1 "alloc_nx_info() = %p" + "dealloc_nx_info(%p)" + "loc_nx_info(%d) = %p (not available)" + "loc_nx_info(%d) = %p (found)" + "loc_nx_info(%d) = %p (new)" + + 1 2 "alloc_nx_info(%d)*" + "loc_nx_info(%d)*" + + 2 4 "get_nx_info(%p[#%d.%d])" + "put_nx_info(%p[#%d.%d])" + + 3 8 "set_nx_info(%p[#%d.%d.%d])" + "clr_nx_info(%p[#%d.%d.%d])" + "rcu_free_nx_info(%p): uc=%d" + + 4 16 "__hash_nx_info: %p[#%d]" + "__unhash_nx_info: %p[#%d]" + "__nx_dynamic_id: [#%d]" + + 5 32 "nx_migrate_task(%p,%p[#%d.%d])" + "task_get_nx_info(%p)" + "create_nx_info()" + + 6 64 + + 7 128 + + +debug_dlim: + + 0 1 "alloc_dl_info(%p,%d) = %p" + "dealloc_dl_info(%p)" + "locate_dl_info(%p,#%d) = %p" + + 1 2 "alloc_dl_info(%p,%d)*" + + 2 4 "get_dl_info(%p[#%d.%d])" + "put_dl_info(%p[#%d.%d])" + + 3 8 "rcu_free_dl_info(%p)" + "__hash_dl_info: %p[#%d]" + "__unhash_dl_info: %p[#%d]" + + + 4 16 "ALLOC (%p,#%d)%c inode (%d)" + "FREE (%p,#%d)%c inode" + + 5 32 "ALLOC (%p,#%d)%c %lld bytes (%d)" + "FREE (%p,#%d)%c %lld bytes" + + 6 64 "ADJUST: %lld,%lld on %d,%d [mult=%d]" + + 7 128 "ext3_has_free_blocks(%p): free=%u, root=%u" + "ext3_has_free_blocks(%p): %u<%u+1, %c, %u!=%u r=%d" + + + +debug_cvirt: + + + 0 1 + + 1 2 + + 2 4 "vx_map_tgid: %p/%llx: %d -> %d" + "vx_rmap_tgid: %p/%llx: %d -> %d" + + 3 8 + + 4 16 + + 5 32 + + 6 64 + + 7 128 + + + +debug_net: + + + 0 1 + + 1 2 + + 2 4 "nx_addr_conflict(%p,%p) %d.%d,%d.%d" + + 3 8 "inet_bind(%p)* %p,%p;%lx %d.%d.%d.%d" + "inet_bind(%p) %d.%d.%d.%d, %d.%d.%d.%d, %d.%d.%d.%d" + + 4 16 "ip_route_connect(%p) %p,%p;%lx" + + 5 32 "__addr_in_socket(%p,%d.%d.%d.%d) %p:%d.%d.%d.%d %p;%lx" + + 6 64 "sk: %p [#%d] (from %d)" + "sk,req: %p [#%d] (from %d)" + "sk,egf: %p [#%d] (from %d)" + "sk,egn: %p [#%d] (from %d)" + "tw: %p [#%d] (from %d)" + + 7 128 "__sock_sendmsg: %p[%p,%p,%p;%d]:%d/%d" + "__sock_recvmsg: %p[%p,%p,%p;%d]:%d/%d" + + + + +debug_limit: + + n 2^n "vx_acc_cres[%5d,%s,%2d]: %5d%s" + "vx_cres_avail[%5d,%s,%2d]: %5ld > %5d + %5d" + + m 2^m "vx_acc_page[%5d,%s,%2d]: %5d%s" + "vx_acc_pages[%5d,%s,%2d]: %5d += %5d" + "vx_pages_avail[%5d,%s,%2d]: %5ld > %5d + %5d" + + diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/drivers/acpi/osl.c linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/acpi/osl.c --- linux-2.6.11.7-vs2.0-pre2/drivers/acpi/osl.c 2005-03-09 12:57:51.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/acpi/osl.c 2005-04-29 19:01:30.000000000 +0200 @@ -938,7 +938,7 @@ acpi_os_wait_semaphore( // TODO: A better timeout algorithm? { int i = 0; - static const int quantum_ms = 1000/HZ; + static const int quantum_ms = (HZ>1000)?1:(1000/HZ); ret = down_trylock(sem); for (i = timeout; (i > 0 && ret < 0); i -= quantum_ms) { diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/drivers/block/floppy.c linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/block/floppy.c --- linux-2.6.11.7-vs2.0-pre2/drivers/block/floppy.c 2005-03-09 12:57:52.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/block/floppy.c 2005-04-29 19:01:30.000000000 +0200 @@ -4084,7 +4084,7 @@ static void __init daring(int *ints, int FD_SILENT_DCL_CLEAR; } else { default_drive_params[i].params.select_delay = - 2 * HZ / 100; + SEL_DLY; default_drive_params[i].params.flags &= ~FD_SILENT_DCL_CLEAR; } diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/drivers/char/cyclades.c linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/char/cyclades.c --- linux-2.6.11.7-vs2.0-pre2/drivers/char/cyclades.c 2005-03-09 12:57:52.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/char/cyclades.c 2005-04-29 19:01:30.000000000 +0200 @@ -4054,7 +4054,7 @@ cy_ioctl(struct tty_struct *tty, struct break; #endif /* CONFIG_CYZ_INTR */ case CYSETWAIT: - info->closing_wait = (unsigned short)arg * HZ/100; + info->closing_wait = (unsigned int)arg * HZ/100; ret_val = 0; break; case CYGETWAIT: diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/drivers/char/dtlk.c linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/char/dtlk.c --- linux-2.6.11.7-vs2.0-pre2/drivers/char/dtlk.c 2004-12-24 22:34:32.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/char/dtlk.c 2005-04-29 19:01:30.000000000 +0200 @@ -198,7 +198,7 @@ static ssize_t dtlk_write(struct file *f up to 250 usec for the RDY bit to go nonzero. */ for (retries = 0; - retries < loops_per_jiffy / (4000/HZ); + retries < HZ*(loops_per_jiffy >> 3)/500; retries++) if (inb_p(dtlk_port_tts) & TTS_WRITABLE) @@ -445,7 +445,7 @@ for (i = 0; i < 10; i++) \ LOOK dtlk_write_bytes("\0012I\r", 4); buffer[b++] = 0; - __delay(50 * loops_per_jiffy / (1000/HZ)); + __delay(50 * (loops_per_jiffy >> 3) * HZ / 125); outb_p(0xff, dtlk_port_lpc); buffer[b++] = 0; LOOK diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/drivers/char/isicom.c linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/char/isicom.c --- linux-2.6.11.7-vs2.0-pre2/drivers/char/isicom.c 2005-03-09 12:57:53.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/char/isicom.c 2005-04-29 19:01:30.000000000 +0200 @@ -197,7 +197,7 @@ struct isi_port { int close_delay; unsigned short channel; unsigned short status; - unsigned short closing_wait; + unsigned int closing_wait; struct isi_board * card; struct tty_struct * tty; wait_queue_head_t close_wait; diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/drivers/char/moxa.c linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/char/moxa.c --- linux-2.6.11.7-vs2.0-pre2/drivers/char/moxa.c 2004-12-24 22:35:28.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/char/moxa.c 2005-04-29 19:01:30.000000000 +0200 @@ -148,7 +148,7 @@ struct moxa_str { int type; int port; int close_delay; - unsigned short closing_wait; + unsigned int closing_wait; int count; int blocked_open; long event; /* long req'd for set_bit --RR */ diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/drivers/char/mxser.c linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/char/mxser.c --- linux-2.6.11.7-vs2.0-pre2/drivers/char/mxser.c 2005-03-09 12:57:53.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/char/mxser.c 2005-04-29 19:01:30.000000000 +0200 @@ -316,7 +316,7 @@ struct mxser_struct { int custom_divisor; int x_char; /* xon/xoff character */ int close_delay; - unsigned short closing_wait; + unsigned int closing_wait; int IER; /* Interrupt Enable Register */ int MCR; /* Modem control register */ unsigned long event; diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/drivers/char/pcmcia/synclink_cs.c linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/char/pcmcia/synclink_cs.c --- linux-2.6.11.7-vs2.0-pre2/drivers/char/pcmcia/synclink_cs.c 2005-03-09 12:57:53.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/char/pcmcia/synclink_cs.c 2005-04-29 19:01:30.000000000 +0200 @@ -146,8 +146,8 @@ typedef struct _mgslpc_info { int flags; int count; /* count of opens */ int line; - unsigned short close_delay; - unsigned short closing_wait; /* time to wait before closing */ + unsigned int close_delay; + unsigned int closing_wait; /* time to wait before closing */ struct mgsl_icount icount; diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/drivers/char/riscom8.h linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/char/riscom8.h --- linux-2.6.11.7-vs2.0-pre2/drivers/char/riscom8.h 2004-12-24 22:35:49.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/char/riscom8.h 2005-04-29 19:01:30.000000000 +0200 @@ -85,7 +85,7 @@ struct riscom_port { struct work_struct tqueue_hangup; short wakeup_chars; short break_length; - unsigned short closing_wait; + unsigned int closing_wait; unsigned char mark_mask; unsigned char IER; unsigned char MSVR; diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/drivers/char/specialix_io8.h linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/char/specialix_io8.h --- linux-2.6.11.7-vs2.0-pre2/drivers/char/specialix_io8.h 2004-12-24 22:33:48.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/char/specialix_io8.h 2005-04-29 19:01:30.000000000 +0200 @@ -124,7 +124,7 @@ struct specialix_port { struct work_struct tqueue_hangup; short wakeup_chars; short break_length; - unsigned short closing_wait; + unsigned int closing_wait; unsigned char mark_mask; unsigned char IER; unsigned char MSVR; diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/drivers/char/synclink.c linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/char/synclink.c --- linux-2.6.11.7-vs2.0-pre2/drivers/char/synclink.c 2005-03-09 12:57:53.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/char/synclink.c 2005-04-29 19:01:30.000000000 +0200 @@ -189,8 +189,8 @@ struct mgsl_struct { int count; /* count of opens */ int line; int hw_version; - unsigned short close_delay; - unsigned short closing_wait; /* time to wait before closing */ + unsigned int close_delay; + unsigned int closing_wait; /* time to wait before closing */ struct mgsl_icount icount; diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/drivers/char/synclinkmp.c linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/char/synclinkmp.c --- linux-2.6.11.7-vs2.0-pre2/drivers/char/synclinkmp.c 2005-03-09 12:57:53.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/char/synclinkmp.c 2005-04-29 19:01:30.000000000 +0200 @@ -157,8 +157,8 @@ typedef struct _synclinkmp_info { int flags; int count; /* count of opens */ int line; - unsigned short close_delay; - unsigned short closing_wait; /* time to wait before closing */ + unsigned int close_delay; + unsigned int closing_wait; /* time to wait before closing */ struct mgsl_icount icount; diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/drivers/macintosh/macserial.h linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/macintosh/macserial.h --- linux-2.6.11.7-vs2.0-pre2/drivers/macintosh/macserial.h 2004-12-24 22:35:50.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/macintosh/macserial.h 2005-04-29 19:01:30.000000000 +0200 @@ -22,11 +22,11 @@ struct serial_struct { int xmit_fifo_size; int custom_divisor; int baud_base; - unsigned short close_delay; + unsigned int close_delay; char reserved_char[2]; int hub6; - unsigned short closing_wait; /* time to wait before closing */ - unsigned short closing_wait2; /* no longer used... */ + unsigned int closing_wait; /* time to wait before closing */ + unsigned int closing_wait2; /* no longer used... */ int reserved[4]; }; @@ -149,8 +149,8 @@ struct mac_serial { int custom_divisor; int x_char; /* xon/xoff character */ int close_delay; - unsigned short closing_wait; - unsigned short closing_wait2; + unsigned int closing_wait; + unsigned int closing_wait2; unsigned long event; unsigned long last_active; int line; diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/drivers/net/wan/z85230.h linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/net/wan/z85230.h --- linux-2.6.11.7-vs2.0-pre2/drivers/net/wan/z85230.h 2004-12-24 22:35:23.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/net/wan/z85230.h 2005-04-29 19:01:30.000000000 +0200 @@ -348,7 +348,7 @@ struct z8530_channel int xmit_fifo_size; /* Transmit FIFO info */ int close_delay; /* Do we wait for drain on close ? */ - unsigned short closing_wait; + unsigned int closing_wait; /* We need to know the current clock divisor * to read the bps rate the chip has currently diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/drivers/sbus/char/aurora.h linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/sbus/char/aurora.h --- linux-2.6.11.7-vs2.0-pre2/drivers/sbus/char/aurora.h 2004-12-24 22:35:24.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/sbus/char/aurora.h 2005-04-29 19:01:30.000000000 +0200 @@ -258,7 +258,7 @@ struct Aurora_port { struct tq_struct tqueue_hangup; short wakeup_chars; short break_length; - unsigned short closing_wait; + unsigned int closing_wait; unsigned char mark_mask; unsigned char SRER; unsigned char MSVR; diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/drivers/serial/68328serial.h linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/serial/68328serial.h --- linux-2.6.11.7-vs2.0-pre2/drivers/serial/68328serial.h 2004-12-24 22:35:28.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/serial/68328serial.h 2005-04-29 19:01:30.000000000 +0200 @@ -22,11 +22,11 @@ struct serial_struct { int xmit_fifo_size; int custom_divisor; int baud_base; - unsigned short close_delay; + unsigned int close_delay; char reserved_char[2]; int hub6; /* FIXME: We don't have AT&T Hub6 boards! */ - unsigned short closing_wait; /* time to wait before closing */ - unsigned short closing_wait2; /* no longer used... */ + unsigned int closing_wait; /* time to wait before closing */ + unsigned int closing_wait2; /* no longer used... */ int reserved[4]; }; @@ -148,8 +148,8 @@ struct m68k_serial { int custom_divisor; int x_char; /* xon/xoff character */ int close_delay; - unsigned short closing_wait; - unsigned short closing_wait2; + unsigned int closing_wait; + unsigned int closing_wait2; unsigned long event; unsigned long last_active; int line; diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/drivers/serial/68360serial.c linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/serial/68360serial.c --- linux-2.6.11.7-vs2.0-pre2/drivers/serial/68360serial.c 2004-12-24 22:35:39.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/serial/68360serial.c 2005-04-29 19:01:30.000000000 +0200 @@ -159,8 +159,8 @@ struct serial_state { int count; u8 *iomem_base; u16 iomem_reg_shift; - unsigned short close_delay; - unsigned short closing_wait; /* time to wait before closing */ + unsigned int close_delay; + unsigned int closing_wait; /* time to wait before closing */ struct async_icount_24 icount; int io_type; struct async_struct *info; @@ -244,8 +244,8 @@ typedef struct serial_info { int line; int x_char; /* xon/xoff character */ int close_delay; - unsigned short closing_wait; - unsigned short closing_wait2; + unsigned int closing_wait; + unsigned int closing_wait2; unsigned long event; unsigned long last_active; int blocked_open; /* # of blocked opens */ diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/drivers/serial/crisv10.h linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/serial/crisv10.h --- linux-2.6.11.7-vs2.0-pre2/drivers/serial/crisv10.h 2004-12-24 22:35:28.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/serial/crisv10.h 2005-04-29 19:01:30.000000000 +0200 @@ -78,8 +78,8 @@ struct e100_serial { int ignore_status_mask; int x_char; /* xon/xoff character */ int close_delay; - unsigned short closing_wait; - unsigned short closing_wait2; + unsigned int closing_wait; + unsigned int closing_wait2; unsigned long event; unsigned long last_active; int line; diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/drivers/serial/mcfserial.h linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/serial/mcfserial.h --- linux-2.6.11.7-vs2.0-pre2/drivers/serial/mcfserial.h 2004-12-24 22:33:52.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/serial/mcfserial.h 2005-04-29 19:01:30.000000000 +0200 @@ -52,8 +52,8 @@ struct mcf_serial { int x_char; /* xon/xoff character */ int baud_base; int close_delay; - unsigned short closing_wait; - unsigned short closing_wait2; + unsigned int closing_wait; + unsigned int closing_wait2; unsigned long event; int line; int count; /* # of fd on device */ diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/drivers/tc/zs.h linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/tc/zs.h --- linux-2.6.11.7-vs2.0-pre2/drivers/tc/zs.h 2005-03-09 12:58:01.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/drivers/tc/zs.h 2005-04-29 19:01:30.000000000 +0200 @@ -24,11 +24,11 @@ struct serial_struct { int xmit_fifo_size; int custom_divisor; int baud_base; - unsigned short close_delay; + unsigned int close_delay; char reserved_char[2]; int hub6; - unsigned short closing_wait; /* time to wait before closing */ - unsigned short closing_wait2; /* no longer used... */ + unsigned int closing_wait; /* time to wait before closing */ + unsigned int closing_wait2; /* no longer used... */ int reserved[4]; }; @@ -128,8 +128,8 @@ struct dec_serial { int custom_divisor; int x_char; /* XON/XOFF character. */ int close_delay; - unsigned short closing_wait; - unsigned short closing_wait2; + unsigned int closing_wait; + unsigned int closing_wait2; unsigned long event; unsigned long last_active; int line; diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/fs/inode.c linux-2.6.11.7-vs2.0-pre3-allno_fix/fs/inode.c --- linux-2.6.11.7-vs2.0-pre2/fs/inode.c 2005-04-23 02:25:23.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/fs/inode.c 2005-04-29 19:01:30.000000000 +0200 @@ -236,6 +236,8 @@ void __iget(struct inode * inode) inodes_stat.nr_unused--; } +EXPORT_SYMBOL_GPL(__iget); + /** * clear_inode - clear an inode * @inode: inode to clear diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/fs/proc/base.c linux-2.6.11.7-vs2.0-pre3-allno_fix/fs/proc/base.c --- linux-2.6.11.7-vs2.0-pre2/fs/proc/base.c 2005-04-23 02:25:23.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/fs/proc/base.c 2005-04-29 19:01:30.000000000 +0200 @@ -1702,6 +1702,20 @@ void proc_pid_flush(struct dentry *proc_ } } +#define VXF_FAKE_INIT (VXF_INFO_INIT|VXF_STATE_INIT) + +static inline int proc_pid_visible(struct task_struct *task, int pid) +{ + if ((pid == 1) && + !vx_flags(VXF_FAKE_INIT, VXF_FAKE_INIT)) + goto visible; + if (vx_check(vx_task_xid(task), VX_WATCH|VX_IDENT)) + goto visible; + return 0; +visible: + return 1; +} + /* SMP-safe */ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd) { @@ -1738,7 +1752,8 @@ struct dentry *proc_pid_lookup(struct in if (!task) goto out; - if (!vx_check(vx_task_xid(task), VX_WATCH|VX_IDENT)) + /* check for context visibility */ + if (!proc_pid_visible(task, tgid)) goto out_drop_task; inode = proc_pid_make_inode(dir->i_sb, task, PROC_TGID_INO); @@ -1799,7 +1814,8 @@ static struct dentry *proc_task_lookup(s if (leader->tgid != task->tgid) goto out_drop_task; - if (!vx_check(vx_task_xid(task), VX_WATCH|VX_IDENT)) + /* check for context visibility */ + if (!proc_pid_visible(task, tid)) goto out_drop_task; inode = proc_pid_make_inode(dir->i_sb, task, PROC_TID_INO); @@ -1856,7 +1872,8 @@ static int get_tgid_list(int index, unsi if (!pid_alive(p)) continue; - if (!vx_check(vx_task_xid(p), VX_WATCH|VX_IDENT)) + /* check for context visibility */ + if (!proc_pid_visible(p, tgid)) continue; if (--index >= 0) continue; @@ -1890,7 +1907,8 @@ static int get_tid_list(int index, unsig if (pid_alive(task)) do { int tid = task->pid; - if (!vx_check(vx_task_xid(task), VX_WATCH|VX_IDENT)) + /* check for context visibility */ + if (!proc_pid_visible(task, tid)) continue; if (--index >= 0) continue; diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/fs/quota.c linux-2.6.11.7-vs2.0-pre3-allno_fix/fs/quota.c --- linux-2.6.11.7-vs2.0-pre2/fs/quota.c 2005-04-23 02:25:23.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/fs/quota.c 2005-04-29 19:01:30.000000000 +0200 @@ -330,10 +330,6 @@ asmlinkage long sys_quotactl(unsigned in if (IS_ERR(bdev)) return PTR_ERR(bdev); #ifdef CONFIG_BLK_DEV_VROOT - printk(KERN_INFO "bdev=%p, gendisk=%p inode=%p[%d,%d]\n", - bdev, bdev?bdev->bd_disk:0, bdev->bd_inode, - imajor(bdev->bd_inode), iminor(bdev->bd_inode)); - if (bdev && bdev->bd_inode && imajor(bdev->bd_inode) == VROOT_MAJOR) { struct block_device *bdnew = diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/include/asm-i386/param.h linux-2.6.11.7-vs2.0-pre3-allno_fix/include/asm-i386/param.h --- linux-2.6.11.7-vs2.0-pre2/include/asm-i386/param.h 2004-12-24 22:34:01.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/include/asm-i386/param.h 2005-04-29 19:01:31.000000000 +0200 @@ -1,8 +1,14 @@ #ifndef _ASMi386_PARAM_H #define _ASMi386_PARAM_H +#include + #ifdef __KERNEL__ -# define HZ 1000 /* Internal kernel timer frequency */ +# ifdef CONFIG_KERNEL_HZ +# define HZ CONFIG_KERNEL_HZ +# else +# define HZ 1000 /* Internal kernel timer frequency */ +# endif # define USER_HZ 100 /* .. some user interfaces are in "ticks" */ # define CLOCKS_PER_SEC (USER_HZ) /* like times() */ #endif diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/include/linux/cyclades.h linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/cyclades.h --- linux-2.6.11.7-vs2.0-pre2/include/linux/cyclades.h 2004-12-24 22:35:40.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/cyclades.h 2005-04-29 19:01:31.000000000 +0200 @@ -585,7 +585,7 @@ struct cyclades_port { int custom_divisor; int x_char; /* to be pushed out ASAP */ int close_delay; - unsigned short closing_wait; + unsigned int closing_wait; unsigned long event; unsigned long last_active; int count; /* # of fd on device */ diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/include/linux/dtlk.h linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/dtlk.h --- linux-2.6.11.7-vs2.0-pre2/include/linux/dtlk.h 2004-12-24 22:35:27.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/dtlk.h 2005-04-29 19:01:31.000000000 +0200 @@ -27,7 +27,7 @@ #define DTLK_CLEAR 0x18 /* stops speech */ -#define DTLK_MAX_RETRIES (loops_per_jiffy/(10000/HZ)) +#define DTLK_MAX_RETRIES (HZ*(loops_per_jiffy >> 3)/1250) /* TTS Port Status Flags */ #define TTS_READABLE 0x80 /* mask for bit which is nonzero if a diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/include/linux/generic_serial.h linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/generic_serial.h --- linux-2.6.11.7-vs2.0-pre2/include/linux/generic_serial.h 2005-03-09 12:58:10.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/generic_serial.h 2005-04-29 19:01:31.000000000 +0200 @@ -42,7 +42,7 @@ struct gs_port { int blocked_open; struct tty_struct *tty; unsigned long event; - unsigned short closing_wait; + unsigned int closing_wait; int close_delay; struct real_driver *rd; int wakeup_chars; diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/include/linux/hayesesp.h linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/hayesesp.h --- linux-2.6.11.7-vs2.0-pre2/include/linux/hayesesp.h 2004-12-24 22:35:24.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/hayesesp.h 2005-04-29 19:01:31.000000000 +0200 @@ -87,8 +87,8 @@ struct esp_struct { int stat_flags; int custom_divisor; int close_delay; - unsigned short closing_wait; - unsigned short closing_wait2; + unsigned int closing_wait; + unsigned int closing_wait2; int IER; /* Interrupt Enable Register */ int MCR; /* Modem control register */ unsigned long event; diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/include/linux/jiffies.h linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/jiffies.h --- linux-2.6.11.7-vs2.0-pre2/include/linux/jiffies.h 2005-03-09 12:58:10.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/jiffies.h 2005-04-29 19:01:31.000000000 +0200 @@ -38,6 +38,14 @@ # define SHIFT_HZ 9 #elif HZ >= 768 && HZ < 1536 # define SHIFT_HZ 10 +#elif HZ >= 1536 && HZ < 3072 +# define SHIFT_HZ 11 +#elif HZ >= 3072 && HZ < 6144 +# define SHIFT_HZ 12 +#elif HZ >= 6144 && HZ < 12288 +# define SHIFT_HZ 13 +#elif HZ >= 12288 && HZ < 24576 +# define SHIFT_HZ 14 #else # error You lose. #endif diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/include/linux/serial.h linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/serial.h --- linux-2.6.11.7-vs2.0-pre2/include/linux/serial.h 2004-12-24 22:34:26.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/serial.h 2005-04-29 19:01:31.000000000 +0200 @@ -39,12 +39,12 @@ struct serial_struct { int xmit_fifo_size; int custom_divisor; int baud_base; - unsigned short close_delay; + unsigned int close_delay; char io_type; char reserved_char[1]; int hub6; - unsigned short closing_wait; /* time to wait before closing */ - unsigned short closing_wait2; /* no longer used... */ + unsigned int closing_wait; /* time to wait before closing */ + unsigned int closing_wait2; /* no longer used... */ unsigned char *iomem_base; unsigned short iomem_reg_shift; unsigned int port_high; diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/include/linux/serialP.h linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/serialP.h --- linux-2.6.11.7-vs2.0-pre2/include/linux/serialP.h 2004-12-24 22:33:52.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/serialP.h 2005-04-29 19:01:31.000000000 +0200 @@ -42,8 +42,8 @@ struct serial_state { int count; u8 *iomem_base; u16 iomem_reg_shift; - unsigned short close_delay; - unsigned short closing_wait; /* time to wait before closing */ + unsigned int close_delay; + unsigned int closing_wait; /* time to wait before closing */ struct async_icount icount; int io_type; struct async_struct *info; @@ -64,8 +64,8 @@ struct async_struct { int quot; int x_char; /* xon/xoff character */ int close_delay; - unsigned short closing_wait; - unsigned short closing_wait2; /* obsolete */ + unsigned int closing_wait; + unsigned int closing_wait2; /* obsolete */ int IER; /* Interrupt Enable Register */ int MCR; /* Modem control register */ int LCR; /* Line control register */ diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/include/linux/vs_context.h linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/vs_context.h --- linux-2.6.11.7-vs2.0-pre2/include/linux/vs_context.h 2005-04-23 02:25:23.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/vs_context.h 2005-04-29 19:01:31.000000000 +0200 @@ -160,6 +160,12 @@ static __inline__ struct vx_info *__task } +static inline void __wakeup_vx_info(struct vx_info *vxi) +{ + if (waitqueue_active(&vxi->vx_wait)) + wake_up_interruptible(&vxi->vx_wait); +} + #else #warning duplicate inclusion #endif diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/include/linux/vserver/context.h linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/vserver/context.h --- linux-2.6.11.7-vs2.0-pre2/include/linux/vserver/context.h 2005-04-23 02:25:23.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/vserver/context.h 2005-04-29 19:01:31.000000000 +0200 @@ -52,6 +52,7 @@ #define VXC_SET_RLIMIT 0x00000002 #define VXC_RAW_ICMP 0x00000100 +#define VXC_SYSLOG 0x00001000 #define VXC_SECURE_MOUNT 0x00010000 #define VXC_SECURE_REMOUNT 0x00020000 @@ -60,10 +61,12 @@ #define VXC_QUOTA_CTL 0x00100000 -/* vshelper sync commands */ +/* context state changes */ -#define VS_CONTEXT_CREATED 1 -#define VS_CONTEXT_DESTROY 2 +enum { + VSC_STARTUP = 1, + VSC_SHUTDOWN, +}; #ifdef __KERNEL__ @@ -94,7 +97,7 @@ struct vx_info { pid_t vx_initpid; /* PID of fake init process */ spinlock_t vx_lock; - wait_queue_head_t vx_exit; /* context exit waitqueue */ + wait_queue_head_t vx_wait; /* context exit waitqueue */ struct _vx_limit limit; /* vserver limits */ struct _vx_sched sched; /* vserver scheduler */ @@ -145,7 +148,7 @@ extern int xid_is_hashed(xid_t); extern int vx_migrate_task(struct task_struct *, struct vx_info *); -extern long vs_context_state(struct vx_info *, unsigned int); +extern long vs_state_change(struct vx_info *, unsigned int); extern void free_vx_info(struct vx_info *); diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/include/linux/vserver/dlimit_cmd.h linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/vserver/dlimit_cmd.h --- linux-2.6.11.7-vs2.0-pre2/include/linux/vserver/dlimit_cmd.h 2005-04-23 02:25:23.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/vserver/dlimit_cmd.h 2005-04-29 19:01:31.000000000 +0200 @@ -27,13 +27,15 @@ struct vcmd_ctx_dlimit_v0 { #ifdef __KERNEL__ +#ifdef CONFIG_COMPAT + struct vcmd_ctx_dlimit_base_v0_x32 { - uint32_t __user name_ptr; + compat_uptr_t name_ptr; uint32_t flags; }; struct vcmd_ctx_dlimit_v0_x32 { - uint32_t __user name_ptr; + compat_uptr_t name_ptr; uint32_t space_used; /* used space in kbytes */ uint32_t space_total; /* maximum space in kbytes */ uint32_t inodes_used; /* used inodes */ @@ -42,6 +44,8 @@ struct vcmd_ctx_dlimit_v0_x32 { uint32_t flags; }; +#endif /* CONFIG_COMPAT */ + #include extern int vc_add_dlimit(uint32_t, void __user *); @@ -50,5 +54,15 @@ extern int vc_rem_dlimit(uint32_t, void extern int vc_set_dlimit(uint32_t, void __user *); extern int vc_get_dlimit(uint32_t, void __user *); +#ifdef CONFIG_COMPAT + +extern int vc_add_dlimit_x32(uint32_t, void __user *); +extern int vc_rem_dlimit_x32(uint32_t, void __user *); + +extern int vc_set_dlimit_x32(uint32_t, void __user *); +extern int vc_get_dlimit_x32(uint32_t, void __user *); + +#endif /* CONFIG_COMPAT */ + #endif /* __KERNEL__ */ #endif /* _VX_DLIMIT_CMD_H */ diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/include/linux/vserver/dlimit.h linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/vserver/dlimit.h --- linux-2.6.11.7-vs2.0-pre2/include/linux/vserver/dlimit.h 2005-04-23 02:25:23.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/vserver/dlimit.h 2005-04-29 19:01:31.000000000 +0200 @@ -2,7 +2,6 @@ #define _VX_DLIMIT_H #include "switch.h" -#include #define CDLIM_UNSET (0ULL) #define CDLIM_INFINITY (~0ULL) @@ -11,6 +10,8 @@ #ifdef __KERNEL__ +#include + struct super_block; struct dl_info { diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/include/linux/vserver/inode_cmd.h linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/vserver/inode_cmd.h --- linux-2.6.11.7-vs2.0-pre2/include/linux/vserver/inode_cmd.h 2005-04-23 02:25:23.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/vserver/inode_cmd.h 2005-04-29 19:01:31.000000000 +0200 @@ -27,13 +27,17 @@ struct vcmd_ctx_iattr_v1 { #ifdef __KERNEL__ +#ifdef CONFIG_COMPAT + struct vcmd_ctx_iattr_v1_x32 { - uint32_t __user name; + compat_uptr_t name_ptr; uint32_t xid; uint32_t flags; uint32_t mask; }; +#endif /* CONFIG_COMPAT */ + #include extern int vc_get_iattr_v0(uint32_t, void __user *); @@ -42,5 +46,12 @@ extern int vc_set_iattr_v0(uint32_t, voi extern int vc_get_iattr(uint32_t, void __user *); extern int vc_set_iattr(uint32_t, void __user *); +#ifdef CONFIG_COMPAT + +extern int vc_get_iattr_x32(uint32_t, void __user *); +extern int vc_set_iattr_x32(uint32_t, void __user *); + +#endif /* CONFIG_COMPAT */ + #endif /* __KERNEL__ */ #endif /* _VX_INODE_CMD_H */ diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/include/linux/vserver/legacy.h linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/vserver/legacy.h --- linux-2.6.11.7-vs2.0-pre2/include/linux/vserver/legacy.h 2005-04-23 02:25:23.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/vserver/legacy.h 2005-04-29 19:01:31.000000000 +0200 @@ -40,11 +40,6 @@ struct vcmd_set_ipv4root_v3 { #define VX_INFO_NAMESPACE 128 /* save private namespace */ -#define NB_S_CONTEXT 16 - -#define NB_IPV4ROOT 16 - - #ifdef __KERNEL__ extern int vc_new_s_context(uint32_t, void __user *); extern int vc_set_ipv4root(uint32_t, void __user *); diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/include/linux/vserver/signal_cmd.h linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/vserver/signal_cmd.h --- linux-2.6.11.7-vs2.0-pre2/include/linux/vserver/signal_cmd.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/vserver/signal_cmd.h 2005-04-29 19:01:31.000000000 +0200 @@ -0,0 +1,25 @@ +#ifndef _VX_SIGNAL_CMD_H +#define _VX_SIGNAL_CMD_H + +/* signalling vserver commands */ + +#define VCMD_ctx_kill VC_CMD(PROCTRL, 1, 0) +#define VCMD_wait_exit VC_CMD(EVENT, 99, 0) + +struct vcmd_ctx_kill_v0 { + int32_t pid; + int32_t sig; +}; + +struct vcmd_wait_exit_v0 { + int32_t a; + int32_t b; +}; + +#ifdef __KERNEL__ + +extern int vc_ctx_kill(uint32_t, void __user *); +extern int vc_wait_exit(uint32_t, void __user *); + +#endif /* __KERNEL__ */ +#endif /* _VX_SIGNAL_CMD_H */ diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/include/linux/vserver/signal.h linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/vserver/signal.h --- linux-2.6.11.7-vs2.0-pre2/include/linux/vserver/signal.h 2005-04-23 02:25:23.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/include/linux/vserver/signal.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,27 +0,0 @@ -#ifndef _VX_SIGNAL_H -#define _VX_SIGNAL_H - -#include "switch.h" - -/* context signalling */ - -#define VCMD_ctx_kill VC_CMD(PROCTRL, 1, 0) -#define VCMD_wait_exit VC_CMD(EVENT, 99, 0) - -struct vcmd_ctx_kill_v0 { - int32_t pid; - int32_t sig; -}; - -struct vcmd_wait_exit_v0 { - int32_t a; - int32_t b; -}; - -#ifdef __KERNEL__ - -extern int vc_ctx_kill(uint32_t, void __user *); -extern int vc_wait_exit(uint32_t, void __user *); - -#endif /* __KERNEL__ */ -#endif /* _VX_SIGNAL_H */ diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/include/net/irda/ircomm_tty.h linux-2.6.11.7-vs2.0-pre3-allno_fix/include/net/irda/ircomm_tty.h --- linux-2.6.11.7-vs2.0-pre2/include/net/irda/ircomm_tty.h 2005-03-09 12:58:11.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/include/net/irda/ircomm_tty.h 2005-04-29 19:01:31.000000000 +0200 @@ -102,8 +102,8 @@ struct ircomm_tty_cb { struct timer_list watchdog_timer; struct work_struct tqueue; - unsigned short close_delay; - unsigned short closing_wait; /* time to wait before closing */ + unsigned int close_delay; + unsigned int closing_wait; /* time to wait before closing */ int open_count; int blocked_open; /* # of blocked opens */ diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/include/net/route.h linux-2.6.11.7-vs2.0-pre3-allno_fix/include/net/route.h --- linux-2.6.11.7-vs2.0-pre2/include/net/route.h 2005-04-23 02:25:24.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/include/net/route.h 2005-04-29 19:01:31.000000000 +0200 @@ -33,7 +33,6 @@ #include #include #include -#include #include #ifndef __KERNEL__ diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/include/net/tcp.h linux-2.6.11.7-vs2.0-pre3-allno_fix/include/net/tcp.h --- linux-2.6.11.7-vs2.0-pre2/include/net/tcp.h 2005-04-23 02:25:24.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/include/net/tcp.h 2005-04-29 19:01:31.000000000 +0200 @@ -489,8 +489,8 @@ static __inline__ int tcp_sk_listen_hash so that we select tick to get range about 4 seconds. */ -#if HZ <= 16 || HZ > 4096 -# error Unsupported: HZ <= 16 or HZ > 4096 +#if HZ <= 16 || HZ > 32768 +# error Unsupported: HZ <= 16 or HZ > 32768 #elif HZ <= 32 # define TCP_TW_RECYCLE_TICK (5+2-TCP_TW_RECYCLE_SLOTS_LOG) #elif HZ <= 64 @@ -505,8 +505,14 @@ static __inline__ int tcp_sk_listen_hash # define TCP_TW_RECYCLE_TICK (10+2-TCP_TW_RECYCLE_SLOTS_LOG) #elif HZ <= 2048 # define TCP_TW_RECYCLE_TICK (11+2-TCP_TW_RECYCLE_SLOTS_LOG) -#else +#elif HZ <= 4096 # define TCP_TW_RECYCLE_TICK (12+2-TCP_TW_RECYCLE_SLOTS_LOG) +#elif HZ <= 8192 +# define TCP_TW_RECYCLE_TICK (13+2-TCP_TW_RECYCLE_SLOTS_LOG) +#elif HZ <= 16384 +# define TCP_TW_RECYCLE_TICK (14+2-TCP_TW_RECYCLE_SLOTS_LOG) +#else +# define TCP_TW_RECYCLE_TICK (15+2-TCP_TW_RECYCLE_SLOTS_LOG) #endif #define BICTCP_BETA_SCALE 1024 /* Scale factor beta calculation diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/init/calibrate.c linux-2.6.11.7-vs2.0-pre3-allno_fix/init/calibrate.c --- linux-2.6.11.7-vs2.0-pre2/init/calibrate.c 2005-03-09 12:58:11.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/init/calibrate.c 2005-04-29 19:01:31.000000000 +0200 @@ -33,8 +33,8 @@ void __devinit calibrate_delay(void) loops_per_jiffy = preset_lpj; printk("Calibrating delay loop (skipped)... " "%lu.%02lu BogoMIPS preset\n", - loops_per_jiffy/(500000/HZ), - (loops_per_jiffy/(5000/HZ)) % 100); + HZ*(loops_per_jiffy >> 3)/62500, + (HZ*(loops_per_jiffy >> 3)/625) % 100); } else { loops_per_jiffy = (1<<12); @@ -71,8 +71,8 @@ void __devinit calibrate_delay(void) /* Round the value and print it */ printk("%lu.%02lu BogoMIPS (lpj=%lu)\n", - loops_per_jiffy/(500000/HZ), - (loops_per_jiffy/(5000/HZ)) % 100, + HZ*(loops_per_jiffy >> 3)/62500, + (HZ*(loops_per_jiffy >> 3)/625) % 100, loops_per_jiffy); } diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/kernel/timer.c linux-2.6.11.7-vs2.0-pre3-allno_fix/kernel/timer.c --- linux-2.6.11.7-vs2.0-pre2/kernel/timer.c 2005-04-23 02:25:24.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/kernel/timer.c 2005-04-29 19:01:31.000000000 +0200 @@ -686,7 +686,11 @@ static void second_overflow(void) if (ltemp > (MAXPHASE / MINSEC) << SHIFT_UPDATE) ltemp = (MAXPHASE / MINSEC) << SHIFT_UPDATE; time_offset += ltemp; + #if SHIFT_SCALE - SHIFT_HZ - SHIFT_UPDATE > 0 time_adj = -ltemp << (SHIFT_SCALE - SHIFT_HZ - SHIFT_UPDATE); + #else + time_adj = -ltemp >> (SHIFT_HZ + SHIFT_UPDATE - SHIFT_SCALE); + #endif } else { ltemp = time_offset; if (!(time_status & STA_FLL)) @@ -694,7 +698,11 @@ static void second_overflow(void) if (ltemp > (MAXPHASE / MINSEC) << SHIFT_UPDATE) ltemp = (MAXPHASE / MINSEC) << SHIFT_UPDATE; time_offset -= ltemp; + #if SHIFT_SCALE - SHIFT_HZ - SHIFT_UPDATE > 0 time_adj = ltemp << (SHIFT_SCALE - SHIFT_HZ - SHIFT_UPDATE); + #else + time_adj = ltemp >> (SHIFT_HZ + SHIFT_UPDATE - SHIFT_SCALE); + #endif } /* diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/kernel/vserver/context.c linux-2.6.11.7-vs2.0-pre3-allno_fix/kernel/vserver/context.c --- linux-2.6.11.7-vs2.0-pre2/kernel/vserver/context.c 2005-04-23 02:25:24.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/kernel/vserver/context.c 2005-04-29 19:01:31.000000000 +0200 @@ -66,7 +66,7 @@ static struct vx_info *__alloc_vx_info(x new->vx_parent = NULL; new->vx_state = 0; new->vx_lock = SPIN_LOCK_UNLOCKED; - init_waitqueue_head(&new->vx_exit); + init_waitqueue_head(&new->vx_wait); /* rest of init goes here */ vx_info_init_limit(&new->limit); @@ -114,7 +114,8 @@ void __shutdown_vx_info(struct vx_info * might_sleep(); - vs_context_state(vxi, VS_CONTEXT_DESTROY); + vxi->vx_state |= VXS_SHUTDOWN; + vs_state_change(vxi, VSC_SHUTDOWN); namespace = xchg(&vxi->vx_namespace, NULL); if (namespace) @@ -178,7 +179,6 @@ static inline void __hash_vx_info(struct /* context must not be hashed */ BUG_ON(vxi->vx_state & VXS_HASHED); - get_vx_info(vxi); vxi->vx_state |= VXS_HASHED; head = &vx_info_hash[__hashval(vxi->vx_id)]; hlist_add_head(&vxi->vx_hlist, head); @@ -202,7 +202,6 @@ static inline void __unhash_vx_info(stru vxi->vx_state &= ~VXS_HASHED; hlist_del(&vxi->vx_hlist); - put_vx_info(vxi); } @@ -391,6 +390,7 @@ void unhash_vx_info(struct vx_info *vxi) spin_lock(&vx_info_hash_lock); __unhash_vx_info(vxi); spin_unlock(&vx_info_hash_lock); + __wakeup_vx_info(vxi); } @@ -668,7 +668,7 @@ int vc_ctx_create(uint32_t xid, void __u if (IS_ERR(new_vxi)) return PTR_ERR(new_vxi); - vs_context_state(new_vxi, VS_CONTEXT_CREATED); + vs_state_change(new_vxi, VSC_STARTUP); ret = new_vxi->vx_id; vx_migrate_task(current, new_vxi); /* if this fails, we might end up with a hashed vx_info */ diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/kernel/vserver/dlimit.c linux-2.6.11.7-vs2.0-pre3-allno_fix/kernel/vserver/dlimit.c --- linux-2.6.11.7-vs2.0-pre2/kernel/vserver/dlimit.c 2005-04-23 02:25:24.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/kernel/vserver/dlimit.c 2005-04-29 19:01:31.000000000 +0200 @@ -6,6 +6,7 @@ * Copyright (C) 2004-2005 Herbert Pötzl * * V0.01 initial version + * V0.02 compat32 splitup * */ @@ -14,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -179,18 +181,13 @@ void rcu_free_dl_info(struct rcu_head *h -int vc_add_dlimit(uint32_t id, void __user *data) +int do_addrem_dlimit(uint32_t id, const char __user *name, + uint32_t flags, int add) { struct nameidata nd; - struct vcmd_ctx_dlimit_base_v0 vc_data; int ret; - if (!vx_check(0, VX_ADMIN)) - return -ENOSYS; - if (copy_from_user (&vc_data, data, sizeof(vc_data))) - return -EFAULT; - - ret = user_path_walk_link(vc_data.name, &nd); + ret = user_path_walk_link(name, &nd); if (!ret) { struct super_block *sb; struct dl_info *dli; @@ -201,19 +198,28 @@ int vc_add_dlimit(uint32_t id, void __us if (!(sb = nd.dentry->d_inode->i_sb)) goto out_release; - dli = __alloc_dl_info(sb, id); - spin_lock(&dl_info_hash_lock); + if (add) { + dli = __alloc_dl_info(sb, id); + spin_lock(&dl_info_hash_lock); - ret = -EEXIST; - if (__lookup_dl_info(sb, id)) - goto out_unlock; - __hash_dl_info(dli); - dli = NULL; - ret = 0; + ret = -EEXIST; + if (__lookup_dl_info(sb, id)) + goto out_unlock; + __hash_dl_info(dli); + dli = NULL; + } else { + spin_lock(&dl_info_hash_lock); + dli = __lookup_dl_info(sb, id); + ret = -ESRCH; + if (!dli) + goto out_unlock; + __unhash_dl_info(dli); + } + ret = 0; out_unlock: spin_unlock(&dl_info_hash_lock); - if (dli) + if (add && dli) __dealloc_dl_info(dli); out_release: path_release(&nd); @@ -221,60 +227,71 @@ int vc_add_dlimit(uint32_t id, void __us return ret; } +int vc_add_dlimit(uint32_t id, void __user *data) +{ + struct vcmd_ctx_dlimit_base_v0 vc_data; + + if (!vx_check(0, VX_ADMIN)) + return -ENOSYS; + if (copy_from_user (&vc_data, data, sizeof(vc_data))) + return -EFAULT; + + return do_addrem_dlimit(id, vc_data.name, vc_data.flags, 1); +} int vc_rem_dlimit(uint32_t id, void __user *data) { - struct nameidata nd; struct vcmd_ctx_dlimit_base_v0 vc_data; - int ret; if (!vx_check(0, VX_ADMIN)) return -ENOSYS; if (copy_from_user (&vc_data, data, sizeof(vc_data))) return -EFAULT; - ret = user_path_walk_link(vc_data.name, &nd); - if (!ret) { - struct super_block *sb; - struct dl_info *dli; - - ret = -EINVAL; - if (!nd.dentry->d_inode) - goto out_release; - if (!(sb = nd.dentry->d_inode->i_sb)) - goto out_release; + return do_addrem_dlimit(id, vc_data.name, vc_data.flags, 0); +} - spin_lock(&dl_info_hash_lock); - dli = __lookup_dl_info(sb, id); +#ifdef CONFIG_COMPAT - ret = -ESRCH; - if (!dli) - goto out_unlock; +int vc_add_dlimit_x32(uint32_t id, void __user *data) +{ + struct vcmd_ctx_dlimit_base_v0_x32 vc_data; - __unhash_dl_info(dli); - ret = 0; + if (!vx_check(0, VX_ADMIN)) + return -ENOSYS; + if (copy_from_user (&vc_data, data, sizeof(vc_data))) + return -EFAULT; - out_unlock: - spin_unlock(&dl_info_hash_lock); - out_release: - path_release(&nd); - } - return ret; + return do_addrem_dlimit(id, + compat_ptr(vc_data.name_ptr), vc_data.flags, 1); } - -int vc_set_dlimit(uint32_t id, void __user *data) +int vc_rem_dlimit_x32(uint32_t id, void __user *data) { - struct nameidata nd; - struct vcmd_ctx_dlimit_v0 vc_data; - int ret; + struct vcmd_ctx_dlimit_base_v0_x32 vc_data; if (!vx_check(0, VX_ADMIN)) return -ENOSYS; if (copy_from_user (&vc_data, data, sizeof(vc_data))) return -EFAULT; - ret = user_path_walk_link(vc_data.name, &nd); + return do_addrem_dlimit(id, + compat_ptr(vc_data.name_ptr), vc_data.flags, 0); +} + +#endif /* CONFIG_COMPAT */ + + +static inline +int do_set_dlimit(uint32_t id, const char __user *name, + uint32_t space_used, uint32_t space_total, + uint32_t inodes_used, uint32_t inodes_total, + uint32_t reserved, uint32_t flags) +{ + struct nameidata nd; + int ret; + + ret = user_path_walk_link(name, &nd); if (!ret) { struct super_block *sb; struct dl_info *dli; @@ -284,12 +301,12 @@ int vc_set_dlimit(uint32_t id, void __us goto out_release; if (!(sb = nd.dentry->d_inode->i_sb)) goto out_release; - if ((vc_data.reserved != (uint32_t)CDLIM_KEEP && - vc_data.reserved > 100) || - (vc_data.inodes_used != (uint32_t)CDLIM_KEEP && - vc_data.inodes_used > vc_data.inodes_total) || - (vc_data.space_used != (uint32_t)CDLIM_KEEP && - vc_data.space_used > vc_data.space_total)) + if ((reserved != (uint32_t)CDLIM_KEEP && + reserved > 100) || + (inodes_used != (uint32_t)CDLIM_KEEP && + inodes_used > inodes_total) || + (space_used != (uint32_t)CDLIM_KEEP && + space_used > space_total)) goto out_release; ret = -ESRCH; @@ -299,22 +316,22 @@ int vc_set_dlimit(uint32_t id, void __us spin_lock(&dli->dl_lock); - if (vc_data.inodes_used != (uint32_t)CDLIM_KEEP) - dli->dl_inodes_used = vc_data.inodes_used; - if (vc_data.inodes_total != (uint32_t)CDLIM_KEEP) - dli->dl_inodes_total = vc_data.inodes_total; - if (vc_data.space_used != (uint32_t)CDLIM_KEEP) { - dli->dl_space_used = vc_data.space_used; + if (inodes_used != (uint32_t)CDLIM_KEEP) + dli->dl_inodes_used = inodes_used; + if (inodes_total != (uint32_t)CDLIM_KEEP) + dli->dl_inodes_total = inodes_total; + if (space_used != (uint32_t)CDLIM_KEEP) { + dli->dl_space_used = space_used; dli->dl_space_used <<= 10; } - if (vc_data.space_total == (uint32_t)CDLIM_INFINITY) + if (space_total == (uint32_t)CDLIM_INFINITY) dli->dl_space_total = (uint64_t)CDLIM_INFINITY; - else if (vc_data.space_total != (uint32_t)CDLIM_KEEP) { - dli->dl_space_total = vc_data.space_total; + else if (space_total != (uint32_t)CDLIM_KEEP) { + dli->dl_space_total = space_total; dli->dl_space_total <<= 10; } - if (vc_data.reserved != (uint32_t)CDLIM_KEEP) - dli->dl_nrlmult = (1 << 10) * (100 - vc_data.reserved) / 100; + if (reserved != (uint32_t)CDLIM_KEEP) + dli->dl_nrlmult = (1 << 10) * (100 - reserved) / 100; spin_unlock(&dli->dl_lock); @@ -327,18 +344,51 @@ int vc_set_dlimit(uint32_t id, void __us return ret; } -int vc_get_dlimit(uint32_t id, void __user *data) +int vc_set_dlimit(uint32_t id, void __user *data) { - struct nameidata nd; struct vcmd_ctx_dlimit_v0 vc_data; - int ret; if (!vx_check(0, VX_ADMIN)) return -ENOSYS; if (copy_from_user (&vc_data, data, sizeof(vc_data))) return -EFAULT; - ret = user_path_walk_link(vc_data.name, &nd); + return do_set_dlimit(id, vc_data.name, + vc_data.space_used, vc_data.space_total, + vc_data.inodes_used, vc_data.inodes_total, + vc_data.reserved, vc_data.flags); +} + +#ifdef CONFIG_COMPAT + +int vc_set_dlimit_x32(uint32_t id, void __user *data) +{ + struct vcmd_ctx_dlimit_v0_x32 vc_data; + + if (!vx_check(0, VX_ADMIN)) + return -ENOSYS; + if (copy_from_user (&vc_data, data, sizeof(vc_data))) + return -EFAULT; + + return do_set_dlimit(id, compat_ptr(vc_data.name_ptr), + vc_data.space_used, vc_data.space_total, + vc_data.inodes_used, vc_data.inodes_total, + vc_data.reserved, vc_data.flags); +} + +#endif /* CONFIG_COMPAT */ + + +static inline +int do_get_dlimit(uint32_t id, const char __user *name, + uint32_t *space_used, uint32_t *space_total, + uint32_t *inodes_used, uint32_t *inodes_total, + uint32_t *reserved, uint32_t *flags) +{ + struct nameidata nd; + int ret; + + ret = user_path_walk_link(name, &nd); if (!ret) { struct super_block *sb; struct dl_info *dli; @@ -348,10 +398,6 @@ int vc_get_dlimit(uint32_t id, void __us goto out_release; if (!(sb = nd.dentry->d_inode->i_sb)) goto out_release; - if (vc_data.reserved > 100 || - vc_data.inodes_used > vc_data.inodes_total || - vc_data.space_used > vc_data.space_total) - goto out_release; ret = -ESRCH; dli = locate_dl_info(sb, id); @@ -359,21 +405,19 @@ int vc_get_dlimit(uint32_t id, void __us goto out_release; spin_lock(&dli->dl_lock); - vc_data.inodes_used = dli->dl_inodes_used; - vc_data.inodes_total = dli->dl_inodes_total; - vc_data.space_used = dli->dl_space_used >> 10; + *inodes_used = dli->dl_inodes_used; + *inodes_total = dli->dl_inodes_total; + *space_used = dli->dl_space_used >> 10; if (dli->dl_space_total == (uint64_t)CDLIM_INFINITY) - vc_data.space_total = (uint32_t)CDLIM_INFINITY; + *space_total = (uint32_t)CDLIM_INFINITY; else - vc_data.space_total = dli->dl_space_total >> 10; + *space_total = dli->dl_space_total >> 10; - vc_data.reserved = 100 - ((dli->dl_nrlmult * 100 + 512) >> 10); + *reserved = 100 - ((dli->dl_nrlmult * 100 + 512) >> 10); spin_unlock(&dli->dl_lock); put_dl_info(dli); ret = -EFAULT; - if (copy_to_user(data, &vc_data, sizeof(vc_data))) - goto out_release; ret = 0; out_release: @@ -383,6 +427,55 @@ int vc_get_dlimit(uint32_t id, void __us } +int vc_get_dlimit(uint32_t id, void __user *data) +{ + struct vcmd_ctx_dlimit_v0 vc_data; + int ret; + + if (!vx_check(0, VX_ADMIN)) + return -ENOSYS; + if (copy_from_user (&vc_data, data, sizeof(vc_data))) + return -EFAULT; + + ret = do_get_dlimit(id, vc_data.name, + &vc_data.space_used, &vc_data.space_total, + &vc_data.inodes_used, &vc_data.inodes_total, + &vc_data.reserved, &vc_data.flags); + if (ret) + return ret; + + if (copy_to_user(data, &vc_data, sizeof(vc_data))) + return -EFAULT; + return 0; +} + +#ifdef CONFIG_COMPAT + +int vc_get_dlimit_x32(uint32_t id, void __user *data) +{ + struct vcmd_ctx_dlimit_v0_x32 vc_data; + int ret; + + if (!vx_check(0, VX_ADMIN)) + return -ENOSYS; + if (copy_from_user (&vc_data, data, sizeof(vc_data))) + return -EFAULT; + + ret = do_get_dlimit(id, compat_ptr(vc_data.name_ptr), + &vc_data.space_used, &vc_data.space_total, + &vc_data.inodes_used, &vc_data.inodes_total, + &vc_data.reserved, &vc_data.flags); + if (ret) + return ret; + + if (copy_to_user(data, &vc_data, sizeof(vc_data))) + return -EFAULT; + return 0; +} + +#endif /* CONFIG_COMPAT */ + + void vx_vsi_statfs(struct super_block *sb, struct kstatfs *buf) { struct dl_info *dli; diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/kernel/vserver/helper.c linux-2.6.11.7-vs2.0-pre3-allno_fix/kernel/vserver/helper.c --- linux-2.6.11.7-vs2.0-pre2/kernel/vserver/helper.c 2005-04-23 02:25:24.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/kernel/vserver/helper.c 2005-04-29 19:01:31.000000000 +0200 @@ -95,9 +95,6 @@ long vs_reboot(unsigned int cmd, void * /* - * invoked by vserver sys_reboot(), with - * the following arguments - * * argv [0] = vshelper_path; * argv [1] = action: "startup", "shutdown" * argv [2] = context identifier @@ -105,7 +102,7 @@ long vs_reboot(unsigned int cmd, void * * envp [*] = type-specific parameters */ -long vs_context_state(struct vx_info *vxi, unsigned int cmd) +long vs_state_change(struct vx_info *vxi, unsigned int cmd) { char id_buf[8], cmd_buf[16]; char *argv[] = {vshelper_path, NULL, id_buf, 0}; @@ -116,10 +113,10 @@ long vs_context_state(struct vx_info *vx snprintf(cmd_buf, sizeof(cmd_buf)-1, "VS_CMD=%08x", cmd); switch (cmd) { - case VS_CONTEXT_CREATED: + case VSC_STARTUP: argv[1] = "startup"; break; - case VS_CONTEXT_DESTROY: + case VSC_SHUTDOWN: argv[1] = "shutdown"; break; default: diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/kernel/vserver/inode.c linux-2.6.11.7-vs2.0-pre3-allno_fix/kernel/vserver/inode.c --- linux-2.6.11.7-vs2.0-pre2/kernel/vserver/inode.c 2005-04-23 02:25:24.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/kernel/vserver/inode.c 2005-04-29 19:01:31.000000000 +0200 @@ -9,7 +9,6 @@ * */ -#include #include #include #include @@ -17,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -87,12 +87,44 @@ int vc_get_iattr(uint32_t id, void __use &vc_data.xid, &vc_data.flags, &vc_data.mask); path_release(&nd); } + if (ret) + return ret; + + if (copy_to_user (data, &vc_data, sizeof(vc_data))) + ret = -EFAULT; + return ret; +} + +#ifdef CONFIG_COMPAT + +int vc_get_iattr_x32(uint32_t id, void __user *data) +{ + struct nameidata nd; + struct vcmd_ctx_iattr_v1_x32 vc_data = { .xid = -1 }; + int ret; + + if (!vx_check(0, VX_ADMIN)) + return -ENOSYS; + if (copy_from_user (&vc_data, data, sizeof(vc_data))) + return -EFAULT; + + ret = user_path_walk_link(compat_ptr(vc_data.name_ptr), &nd); + if (!ret) { + ret = __vc_get_iattr(nd.dentry->d_inode, + &vc_data.xid, &vc_data.flags, &vc_data.mask); + path_release(&nd); + } + if (ret) + return ret; if (copy_to_user (data, &vc_data, sizeof(vc_data))) ret = -EFAULT; return ret; } +#endif /* CONFIG_COMPAT */ + + static int __vc_set_iattr(struct dentry *de, uint32_t *xid, uint32_t *flags, uint32_t *mask) { struct inode *in = de->d_inode; @@ -189,6 +221,32 @@ int vc_set_iattr(uint32_t id, void __use return ret; } +#ifdef CONFIG_COMPAT + +int vc_set_iattr_x32(uint32_t id, void __user *data) +{ + struct nameidata nd; + struct vcmd_ctx_iattr_v1_x32 vc_data; + int ret; + + if (!capable(CAP_SYS_ADMIN) || !capable(CAP_LINUX_IMMUTABLE)) + return -EPERM; + if (copy_from_user (&vc_data, data, sizeof(vc_data))) + return -EFAULT; + + ret = user_path_walk_link(compat_ptr(vc_data.name_ptr), &nd); + if (!ret) { + ret = __vc_set_iattr(nd.dentry, + &vc_data.xid, &vc_data.flags, &vc_data.mask); + path_release(&nd); + } + + if (copy_to_user (data, &vc_data, sizeof(vc_data))) + ret = -EFAULT; + return ret; +} + +#endif /* CONFIG_COMPAT */ #ifdef CONFIG_VSERVER_LEGACY diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/kernel/vserver/Makefile linux-2.6.11.7-vs2.0-pre3-allno_fix/kernel/vserver/Makefile --- linux-2.6.11.7-vs2.0-pre2/kernel/vserver/Makefile 2005-04-23 02:25:24.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/kernel/vserver/Makefile 2005-04-29 19:15:55.000000000 +0200 @@ -6,8 +6,9 @@ obj-y += vserver.o vserver-y := switch.o context.o namespace.o sched.o network.o inode.o \ - limit.o cvirt.o signal.o proc.o helper.o init.o dlimit.o + limit.o cvirt.o signal.o helper.o init.o dlimit.o +vserver-$(CONFIG_PROC_FS) += proc.o vserver-$(CONFIG_VSERVER_DEBUG) += sysctl.o vserver-$(CONFIG_VSERVER_LEGACY) += legacy.o vserver-$(CONFIG_VSERVER_LEGACYNET) += legacynet.o diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/kernel/vserver/proc.c linux-2.6.11.7-vs2.0-pre3-allno_fix/kernel/vserver/proc.c --- linux-2.6.11.7-vs2.0-pre2/kernel/vserver/proc.c 2005-04-23 02:25:24.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/kernel/vserver/proc.c 2005-04-29 19:01:31.000000000 +0200 @@ -833,9 +833,10 @@ void proc_vx_init(void) /* per pid info */ -char *task_vx_info(struct task_struct *p, char *buffer) +int proc_pid_vx_info(struct task_struct *p, char *buffer) { struct vx_info *vxi; + char * orig = buffer; buffer += sprintf (buffer,"XID:\t%d\n", vx_task_xid(p)); vxi = task_get_vx_info(p); @@ -850,20 +851,14 @@ char *task_vx_info(struct task_struct *p ,vxi->vx_initpid); } put_vx_info(vxi); - return buffer; -} - -int proc_pid_vx_info(struct task_struct *p, char *buffer) -{ - char * orig = buffer; - - buffer = task_vx_info(p, buffer); return buffer - orig; } -char *task_nx_info(struct task_struct *p, char *buffer) + +int proc_pid_nx_info(struct task_struct *p, char *buffer) { struct nx_info *nxi; + char * orig = buffer; buffer += sprintf (buffer,"NID:\t%d\n", nx_task_nid(p)); nxi = task_get_nx_info(p); @@ -881,14 +876,6 @@ char *task_nx_info(struct task_struct *p ,NIPQUAD(nxi->v4_bcast)); } put_nx_info(nxi); - return buffer; -} - -int proc_pid_nx_info(struct task_struct *p, char *buffer) -{ - char * orig = buffer; - - buffer = task_nx_info(p, buffer); return buffer - orig; } diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/kernel/vserver/signal.c linux-2.6.11.7-vs2.0-pre3-allno_fix/kernel/vserver/signal.c --- linux-2.6.11.7-vs2.0-pre2/kernel/vserver/signal.c 2005-04-23 02:25:24.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/kernel/vserver/signal.c 2005-04-29 19:01:31.000000000 +0200 @@ -16,7 +16,7 @@ #include #include -#include +#include int vc_ctx_kill(uint32_t id, void __user *data) @@ -95,11 +95,11 @@ static int __wait_exit(struct vx_info *v DECLARE_WAITQUEUE(wait, current); int ret = 0; - add_wait_queue(&vxi->vx_exit, &wait); + add_wait_queue(&vxi->vx_wait, &wait); set_current_state(TASK_INTERRUPTIBLE); wait: - if (vx_info_state(vxi, VXS_DEFUNCT)) + if (vx_info_state(vxi, VXS_SHUTDOWN|VXS_HASHED) == VXS_SHUTDOWN) goto out; if (signal_pending(current)) { ret = -ERESTARTSYS; @@ -110,7 +110,7 @@ wait: out: set_current_state(TASK_RUNNING); - remove_wait_queue(&vxi->vx_exit, &wait); + remove_wait_queue(&vxi->vx_wait, &wait); return ret; } diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/kernel/vserver/switch.c linux-2.6.11.7-vs2.0-pre3-allno_fix/kernel/vserver/switch.c --- linux-2.6.11.7-vs2.0-pre2/kernel/vserver/switch.c 2005-04-23 02:25:24.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/kernel/vserver/switch.c 2005-04-29 19:01:31.000000000 +0200 @@ -10,12 +10,14 @@ * V0.03 added rlimit functions * V0.04 added iattr, task/xid functions * V0.05 added debug/history stuff + * V0.06 added compat32 layer * */ #include #include #include +#include #include #include @@ -23,8 +25,8 @@ #include -static inline int -vc_get_version(uint32_t id) +static inline +int vc_get_version(uint32_t id) { return VCI_VERSION; } @@ -37,16 +39,25 @@ vc_get_version(uint32_t id) #include #include #include +#include #include #include #include -#include #include -extern asmlinkage long -sys_vserver(uint32_t cmd, uint32_t id, void __user *data) +#ifdef CONFIG_COMPAT +#define __COMPAT(name, id, data, compat) \ + (compat) ? name ## _x32 (id, data) : name (id, data) +#else +#define __COMPAT(name, id, data, compat) \ + name (id, data) +#endif + + +static inline +long do_vserver(uint32_t cmd, uint32_t id, void __user *data, int compat) { vxdprintk(VXD_CBIT(switch, 0), "vc: VCMD_%02d_%d[%d], %d", @@ -153,13 +164,13 @@ sys_vserver(uint32_t cmd, uint32_t id, v return vc_set_sched(id, data); case VCMD_add_dlimit: - return vc_add_dlimit(id, data); + return __COMPAT(vc_add_dlimit, id, data, compat); case VCMD_rem_dlimit: - return vc_rem_dlimit(id, data); + return __COMPAT(vc_rem_dlimit, id, data, compat); case VCMD_set_dlimit: - return vc_set_dlimit(id, data); + return __COMPAT(vc_set_dlimit, id, data, compat); case VCMD_get_dlimit: - return vc_get_dlimit(id, data); + return __COMPAT(vc_get_dlimit, id, data, compat); } /* below here only with VX_ADMIN */ @@ -181,9 +192,9 @@ sys_vserver(uint32_t cmd, uint32_t id, v #endif case VCMD_get_iattr: - return vc_get_iattr(id, data); + return __COMPAT(vc_get_iattr, id, data, compat); case VCMD_set_iattr: - return vc_set_iattr(id, data); + return __COMPAT(vc_set_iattr, id, data, compat); case VCMD_enter_namespace: return vc_enter_namespace(id, data); @@ -208,3 +219,18 @@ sys_vserver(uint32_t cmd, uint32_t id, v return -ENOSYS; } +extern asmlinkage long +sys_vserver(uint32_t cmd, uint32_t id, void __user *data) +{ + return do_vserver(cmd, id, data, 0); +} + +#ifdef CONFIG_COMPAT + +extern asmlinkage long +sys32_vserver(uint32_t cmd, uint32_t id, void __user *data) +{ + return do_vserver(cmd, id, data, 1); +} + +#endif /* CONFIG_COMPAT */ diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/Makefile linux-2.6.11.7-vs2.0-pre3-allno_fix/Makefile --- linux-2.6.11.7-vs2.0-pre2/Makefile 2005-04-23 02:25:22.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/Makefile 2005-04-29 19:01:29.000000000 +0200 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 11 -EXTRAVERSION = .7-vs2.0-pre2 +EXTRAVERSION = .7-vs2.0-pre3 NAME=Woozy Numbat # *DOCUMENTATION* diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/net/core/sock.c linux-2.6.11.7-vs2.0-pre3-allno_fix/net/core/sock.c --- linux-2.6.11.7-vs2.0-pre2/net/core/sock.c 2005-04-23 02:25:24.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/net/core/sock.c 2005-04-29 19:01:31.000000000 +0200 @@ -124,6 +124,7 @@ #include #include #include +#include #ifdef CONFIG_INET #include diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/net/ipv4/netfilter/ip_conntrack_proto_sctp.c linux-2.6.11.7-vs2.0-pre3-allno_fix/net/ipv4/netfilter/ip_conntrack_proto_sctp.c --- linux-2.6.11.7-vs2.0-pre2/net/ipv4/netfilter/ip_conntrack_proto_sctp.c 2005-03-09 12:58:12.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/net/ipv4/netfilter/ip_conntrack_proto_sctp.c 2005-04-29 19:01:31.000000000 +0200 @@ -61,7 +61,7 @@ static const char *sctp_conntrack_names[ static unsigned long ip_ct_sctp_timeout_closed = 10 SECS; static unsigned long ip_ct_sctp_timeout_cookie_wait = 3 SECS; static unsigned long ip_ct_sctp_timeout_cookie_echoed = 3 SECS; -static unsigned long ip_ct_sctp_timeout_established = 5 DAYS; +static unsigned long ip_ct_sctp_timeout_established = 2 DAYS; static unsigned long ip_ct_sctp_timeout_shutdown_sent = 300 SECS / 1000; static unsigned long ip_ct_sctp_timeout_shutdown_recd = 300 SECS / 1000; static unsigned long ip_ct_sctp_timeout_shutdown_ack_sent = 3 SECS; diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/net/ipv4/netfilter/ip_conntrack_proto_tcp.c linux-2.6.11.7-vs2.0-pre3-allno_fix/net/ipv4/netfilter/ip_conntrack_proto_tcp.c --- linux-2.6.11.7-vs2.0-pre2/net/ipv4/netfilter/ip_conntrack_proto_tcp.c 2005-03-09 12:58:12.000000000 +0100 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/net/ipv4/netfilter/ip_conntrack_proto_tcp.c 2005-04-29 19:01:31.000000000 +0200 @@ -88,7 +88,7 @@ static const char *tcp_conntrack_names[] unsigned long ip_ct_tcp_timeout_syn_sent = 2 MINS; unsigned long ip_ct_tcp_timeout_syn_recv = 60 SECS; -unsigned long ip_ct_tcp_timeout_established = 5 DAYS; +unsigned long ip_ct_tcp_timeout_established = 2 DAYS; unsigned long ip_ct_tcp_timeout_fin_wait = 2 MINS; unsigned long ip_ct_tcp_timeout_close_wait = 60 SECS; unsigned long ip_ct_tcp_timeout_last_ack = 30 SECS; diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/net/ipv4/tcp_minisocks.c linux-2.6.11.7-vs2.0-pre3-allno_fix/net/ipv4/tcp_minisocks.c --- linux-2.6.11.7-vs2.0-pre2/net/ipv4/tcp_minisocks.c 2005-04-23 02:25:24.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/net/ipv4/tcp_minisocks.c 2005-04-29 19:01:31.000000000 +0200 @@ -31,6 +31,7 @@ #include #include +#include #ifdef CONFIG_SYSCTL #define SYNC_INIT 0 /* let the user enable it */ diff -NurpP --minimal linux-2.6.11.7-vs2.0-pre2/security/commoncap.c linux-2.6.11.7-vs2.0-pre3-allno_fix/security/commoncap.c --- linux-2.6.11.7-vs2.0-pre2/security/commoncap.c 2005-04-23 02:25:24.000000000 +0200 +++ linux-2.6.11.7-vs2.0-pre3-allno_fix/security/commoncap.c 2005-04-29 19:01:31.000000000 +0200 @@ -311,7 +311,8 @@ void cap_task_reparent_to_init (struct t int cap_syslog (int type) { - if ((type != 3 && type != 10) && !capable(CAP_SYS_ADMIN)) + if ((type != 3 && type != 10) && + !capable(CAP_SYS_ADMIN) && !vx_ccaps(VXC_SYSLOG)) return -EPERM; return 0; }