[Vserver] [PATCH] vserver, quota and vroot fix
Hi, The following hunk got lost sometime between 2.6.16 and 2.6.18, as Network Failure System hit me again, I just _had_ to find out why quota did not work with latest vserver patches ;) The patch is so long because quotactl_block() has to be after vroot_get_real_bdev declaration, the real meat is between #if defined(CONFIG_BLK_DEV_VROOT) || defined(CONFIG_BLK_DEV_VROOT_MODULE) #endif This is against vserver 2.3 patched kernel: --- linux-2.6.19/fs/quota.c~2007-03-01 19:45:40.694648408 +0100 +++ linux-2.6.19/fs/quota.c 2007-03-02 00:27:24.196276620 +0100 @@ -415,34 +415,6 @@ return 0; } -/* - * look up a superblock on which quota ops will be performed - * - use the name of a block device to find the superblock thereon - */ -static inline struct super_block *quotactl_block(const char __user *special) -{ -#ifdef CONFIG_BLOCK - struct block_device *bdev; - struct super_block *sb; - char *tmp = getname(special); - - if (IS_ERR(tmp)) - return ERR_PTR(PTR_ERR(tmp)); - bdev = lookup_bdev(tmp); - putname(tmp); - if (IS_ERR(bdev)) - return ERR_PTR(PTR_ERR(bdev)); - sb = get_super(bdev); - bdput(bdev); - if (!sb) - return ERR_PTR(-ENODEV); - - return sb; -#else - return ERR_PTR(-ENODEV); -#endif -} - #if defined(CONFIG_BLK_DEV_VROOT) || defined(CONFIG_BLK_DEV_VROOT_MODULE) #include linux/vroot.h @@ -481,6 +453,50 @@ #endif /* + * look up a superblock on which quota ops will be performed + * - use the name of a block device to find the superblock thereon + */ +static inline struct super_block *quotactl_block(const char __user *special) +{ +#ifdef CONFIG_BLOCK + struct block_device *bdev; + struct super_block *sb; + char *tmp = getname(special); + + if (IS_ERR(tmp)) + return ERR_PTR(PTR_ERR(tmp)); + bdev = lookup_bdev(tmp); + putname(tmp); + if (IS_ERR(bdev)) + return ERR_PTR(PTR_ERR(bdev)); +#if defined(CONFIG_BLK_DEV_VROOT) || defined(CONFIG_BLK_DEV_VROOT_MODULE) + if (bdev bdev-bd_inode + imajor(bdev-bd_inode) == VROOT_MAJOR) { + struct block_device *bdnew = (void *)-EINVAL; + + if (vroot_get_real_bdev) + bdnew = vroot_get_real_bdev(bdev); + else + vxdprintk(VXD_CBIT(misc, 0), + vroot_get_real_bdev not set); + bdput(bdev); + if (IS_ERR(bdnew)) + return ERR_PTR(PTR_ERR(bdnew)); + bdev = bdnew; + } +#endif + sb = get_super(bdev); + bdput(bdev); + if (!sb) + return ERR_PTR(-ENODEV); + + return sb; +#else + return ERR_PTR(-ENODEV); +#endif +} + +/* * This is the system call interface. This communicates with * the user-level programs. Currently this only supports diskquota * calls. Maybe we need to add the process quotas etc. in the future, HTH, HAND, Jan -- Jan Rekorajski| ALL SUSPECTS ARE GUILTY. PERIOD! bagginsatmimuw.edu.pl | OTHERWISE THEY WOULDN'T BE SUSPECTS, WOULD THEY? BOFH, MANIAC | -- TROOPS by Kevin Rubio ___ Vserver mailing list Vserver@list.linux-vserver.org http://list.linux-vserver.org/mailman/listinfo/vserver
[Vserver] Kernel BUG at kernel/exit.c:676
Hi, I have serious problem with vserver 2.1.1-rc on SMP systems. I don't have UP system to check if it's an SMP-only. Kernel is 2.6.16.11, vserver patch 2.1.1-rc17, I can't run gdb. The following test case will give results as shown below: gdb /bin/ls r and then you will see this: From the x86-64 machine (4xDC Opteron): Kernel BUG at kernel/exit.c:676 invalid opcode: [1] SMP CPU 4 Modules linked in: vroot nfsd lockd nfs_acl sunrpc ipv6 tg3 ext3 jbd mbcache dm_mod 8021q Pid: 21617[#100], comm: gdb Not tainted 2.6.16.11 #1 RIP: 0010:[80132cb5] 80132cb5{forget_original_parent+437} RSP: 0018:8105fa8c5eb8 EFLAGS: 00010002 RAX: RBX: 8105cf1a50e8 RCX: 0078 RDX: RSI: 8105fa8c5ef8 RDI: 8105cf1a5770 RBP: 81020708d040 R08: R09: 8105fa8c5ea8 R10: 0001 R11: 0246 R12: 8105cf1a5040 R13: 8105cf1a50e8 R14: 0001 R15: 8105cf1a5160 FS: 2b03caddebe0() GS:81040709dcc0() knlGS:f7d656c0 CS: 0010 DS: 002b ES: 002b CR0: 8005003b CR2: 0829b574 CR3: 00101000 CR4: 06e0 Process gdb (pid: 21617[#100], threadinfo 8105fa8c4000, task 8105cf1a5040) Stack: 8105fa8c5ef8 8101ffad2b80 8105cf1a5040 8105fa8c5ef8 0001 80132e06 8105fa8c5ef8 8105fa8c5ef8 Call Trace: 80132e06{exit_notify+246} 801333ff{do_exit+1023} 8013358c{do_group_exit+220} 8011e084{cstar_do_call+27} Code: 0f 0b 68 91 58 36 80 c2 a4 02 90 48 39 ef 74 0a 48 83 bd e0 RIP 80132cb5{forget_original_parent+437} RSP 8105fa8c5eb8 1Fixing recursive fault but reboot is needed! From the 2xPentiumMMX: kernel BUG at kernel/exit.c:676! invalid opcode: [#1] SMP CPU:0 EIP is at forget_original_parent+0x121/0x200 eax: ebx: ca8a8b20 ecx: edx: ca8a8ab0 esi: ca8a8098 edi: c12b9ab0 ebp: ca8a8098 esp: c5465f48 ds: 007b es: 007b ss: 0068 Process gdb (pid: 6053[#100], threadinfo=c5464000 task=ca8a8030) Stack: 0ca8a80dc c5465f6c ca8a8030 ca8a8030 c5465f6c c0121c62 ca8a8030 c5465f6c c5465f6c c5465f6c ca8a8030 c9d1c4c0 c9d1c4c0 c012215e ca8a8030 ca8a8030 0001 cbb8fe60 c5464000 c5464000 c012237d Call Trace: [c0121c62] exit_notify+0x32/0x2e0 [c012215e] do_exit+0x24e/0x400 [c012237d] do_group_exit+0x2d/0x90 [c0102b99] syscall_call+0x7/0xb Code: 00 89 eb 6a 01 8b 44 24 20 50 52 e8 5a fd ff ff 8b 6d 00 83 c4 0c 39 f3 75 c3 59 5b 5b 5e 5f 5d c3 0f 0b 27 02 08 3c 2f c0 eb d0 0f 0b a4 02 08 3c 2f c0 eb b9 83 be 84 00 00 00 10 75 83 83 be Jan -- Jan Rękorajski| ALL SUSPECTS ARE GUILTY. PERIOD! bagginsatmimuw.edu.pl | OTHERWISE THEY WOULDN'T BE SUSPECTS, WOULD THEY? BOFH, MANIAC | -- TROOPS by Kevin Rubio ___ Vserver mailing list Vserver@list.linux-vserver.org http://list.linux-vserver.org/mailman/listinfo/vserver
Re: [Vserver] [OPoll] BME inclusion into next stable release
OPINION POLL please check (X) all points which apply ... (according to your opinion) [ ] I had no idea about this issue/deficiency [X] I did already know about it [X] I'm already using BME (or similar) patches [ ] I will start using BME patches now [ ] I do not need/use this 'feature' at all [X] I think this SHOULD get into the next stable Linux-VServer release because ... [X] I am using it/want to use it [X] It's more a bugfix than a feature [X] I like the idea of ro --bind mounts [ ] I think this should NOT be included into the next stable release because ... [ ] it is not thoroughly tested [ ] it is not mature enough [ ] it adds unnecessary code [ ] it should better be fixed in the mainline Linux Kernel Jan -- Jan Rękorajski| ALL SUSPECTS ARE GUILTY. PERIOD! bagginsatmimuw.edu.pl | OTHERWISE THEY WOULDN'T BE SUSPECTS, WOULD THEY? BOFH, MANIAC | -- TROOPS by Kevin Rubio ___ Vserver mailing list Vserver@list.linux-vserver.org http://list.linux-vserver.org/mailman/listinfo/vserver
Re: [Vserver] CPUSET support for util-vserver
On Sun, 27 Nov 2005, Herbert Poetzl wrote: On Fri, Nov 25, 2005 at 05:48:34PM +0100, Jan Rekorajski wrote: Hi, I made CPUSET support for util-vserver, please take a look at it. I tested it, and it behaves as expected. Atteched is a patch for util-vserver .209 and a snippet for The Great Flower Page :) thanks! One more thing, I made a typo, so please s/virtualized/virtualize/ in both files. Jan -- Jan Rękorajski| ALL SUSPECTS ARE GUILTY. PERIOD! bagginsatmimuw.edu.pl | OTHERWISE THEY WOULDN'T BE SUSPECTS, WOULD THEY? BOFH, MANIAC | -- TROOPS by Kevin Rubio ___ Vserver mailing list Vserver@list.linux-vserver.org http://list.linux-vserver.org/mailman/listinfo/vserver
[Vserver] CPUSET support for util-vserver
Hi, I made CPUSET support for util-vserver, please take a look at it. I tested it, and it behaves as expected. Atteched is a patch for util-vserver .209 and a snippet for The Great Flower Page :) Jan -- Jan Rękorajski| ALL SUSPECTS ARE GUILTY. PERIOD! bagginsatmimuw.edu.pl | OTHERWISE THEY WOULDN'T BE SUSPECTS, WOULD THEY? BOFH, MANIAC | -- TROOPS by Kevin Rubio diff -ur util-vserver-0.30.209/scripts/vserver-setup.functions util-vserver-0.30.209.cpuset/scripts/vserver-setup.functions --- util-vserver-0.30.209/scripts/vserver-setup.functions 2005-02-26 00:32:02.0 +0100 +++ util-vserver-0.30.209.cpuset/scripts/vserver-setup.functions 2005-11-25 15:11:30.224131360 +0100 @@ -24,11 +24,15 @@ SETUP_CONFDIR= SETUP_CONTEXT= SETUP_INITSTYLE= +SETUP_CPUSET= +SETUP_CPUSETCPUS= +SETUP_CPUSETMEMS= +SETUP_CPUSETVIRT= declare -a SETUP_INTERFACES=() declare -a SETUP_FLAGS=() -declare -r SETUP_OPTIONS=confdir:,lockfile:,hostname:,netdev:,netmask:,netprefix:,netbcast:,interface:,flags:,context:,initstyle: +declare -r SETUP_OPTIONS=confdir:,lockfile:,hostname:,netdev:,netmask:,netprefix:,netbcast:,interface:,flags:,context:,initstyle:,cpuset:,cpusetcpus:,cpusetmems:,cpusetvirt declare -r SETUP_HELPMSG=$ --context ... the static context of the vserver [default: none; a dynamic context will be assumed] @@ -55,6 +58,19 @@ this becomes a per vserver limit) private: No other process can join this security context. Even root +--cpuset name + ... declares the CPUSET this vserver will run in [default: none] +--cpusetcpus number[-number][:exclusive] + ... sets which cpus belong to the CPUSET, +exclusive is a flag (0|1) prohibiting any other cpuset from +using those cpus +--cpusetmems number[-number][:exclusive] + ... sets which memory pools belong to the CPUSET, +exclusive is a flag (0|1) prohibiting any other cpuset from +using those memory pools +--cpusetvirt + ... virtualize cpuset (guest will see only CPUs defined in cpuset) +Requires kernel patch from http://www.bullopensource.org/cpuset/ --initstyle style ... configures the initstyle (e.g. minit,sysv,plain) @@ -72,6 +85,22 @@ (--netbcast)SETUP_NETBCAST=$2;; (--interface) SETUP_INTERFACES=( [EMAIL PROTECTED] $2 );; (--initstyle) SETUP_INITSTYLE=$2;; + (--cpuset) SETUP_CPUSET=$2;; + (--cpusetcpus) old_IFS=$IFS + IFS=: + set -- $2 + SETUP_CPUSETCPUS=$1 + SETUP_CPUSETCPUSEXCL=$2 + IFS=$old_IFS + ;; + (--cpusetmems) old_IFS=$IFS + IFS=: + set -- $2 + SETUP_CPUSETMEMS=$1 + SETUP_CPUSETMEMSEXCL=$2 + IFS=$old_IFS + ;; + (--cpusetvirt) SETUP_CPUSETVIRT=1;; (--flags) old_IFS=$IFS IFS=, set -- $2 @@ -140,7 +166,7 @@ local cfgdir=${SETUP_CONFDIR:?} local i -mkdir -p $cfgdir/interfaces $cfgdir/apps/init $cfgdir/uts +mkdir -p $cfgdir/interfaces $cfgdir/apps/init $cfgdir/uts $cfgdir/cpuset _setup_writeSingleOption $name$cfgdir/name _setup_writeSingleOption $SETUP_CONTEXT $cfgdir/context @@ -150,6 +176,12 @@ _setup_writeSingleOption $SETUP_NETPREFIX $cfgdir/interfaces/prefix _setup_writeSingleOption $SETUP_NETBCAST $cfgdir/interfaces/bcast _setup_writeSingleOption $SETUP_INITSTYLE $cfgdir/apps/init/style +_setup_writeSingleOption $SETUP_CPUSET$cfgdir/cpuset/name +_setup_writeSingleOption $SETUP_CPUSETCPUS $cfgdir/cpuset/cpus +_setup_writeSingleOption $SETUP_CPUSETCPUSEXCL $cfgdir/cpuset/cpus_exclusive +_setup_writeSingleOption $SETUP_CPUSETMEMS $cfgdir/cpuset/mems +_setup_writeSingleOption $SETUP_CPUSETMEMSEXCL $cfgdir/cpuset/mem_exclusive +_setup_writeSingleOption $SETUP_CPUSETVIRT $cfgdir/cpuset/virtualized local idx=0 for i in [EMAIL PROTECTED]; do diff -ur util-vserver-0.30.209/scripts/vserver.functions util-vserver-0.30.209.cpuset/scripts/vserver.functions --- util-vserver-0.30.209/scripts/vserver.functions 2005-11-25 14:30:27.665999880 +0100 +++ util-vserver-0.30.209.cpuset/scripts/vserver.functions 2005-11-25 15:11:04.593027880 +0100 @@ -687,6 +687,54 @@ fi } +function addtoCPUSET +{ +local vdir=$1 +local cpuset +local f=$vdir/cpuset +local i +local configured=0 + +test -d $f || return 0 +test -e $f/name || return 0 + +read cpuset $f/name +