Re: [PATCH] x86/alternatives: add missing mutex lock in,alternatives_text_reserved

2016-12-20 Thread Rui Xiang
gt; [ 18.470881] [] mutex_lock_nested+0x71/0x370 > [ 18.474546] [] ? alternatives_text_reserved+0x1b/0x90 > [ 18.478720] [] ? trace_hardirqs_on_caller+0x192/0x1d0 > [ 18.496043] [] ? alternatives_text_reserved+0x1b/0x90 It may seem like a bit complicated to fix this race. And how t

Re: [PATCH] x86/alternatives: add missing mutex lock in,alternatives_text_reserved

2016-12-20 Thread Rui Xiang
mutex_lock_nested+0x71/0x370 > [ 18.474546] [] ? alternatives_text_reserved+0x1b/0x90 > [ 18.478720] [] ? trace_hardirqs_on_caller+0x192/0x1d0 > [ 18.496043] [] ? alternatives_text_reserved+0x1b/0x90 It may seem like a bit complicated to fix this race. And how to fix

[PATCH] x86/alternatives: add missing mutex lock in,alternatives_text_reserved

2016-09-12 Thread Rui Xiang
sta...@vger.kernel.org Signed-off-by: Rui Xiang <rui.xi...@huawei.com> --- arch/x86/kernel/alternative.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 5cb272a..7cec0cc 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x

[PATCH] x86/alternatives: add missing mutex lock in,alternatives_text_reserved

2016-09-12 Thread Rui Xiang
sta...@vger.kernel.org Signed-off-by: Rui Xiang --- arch/x86/kernel/alternative.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 5cb272a..7cec0cc 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -563,6 +56

[Question] A panic when reboot --force the system

2015-10-23 Thread Rui Xiang
Hi,list I encounter a panic about init process. Kernel panic - not syncing: Attempted to kill init! exitcode=0x0007 Pid: 1, comm: init Tainted: G RO 3.4.24.19-0.11-default #1 Call Trace: [] panic+0xc1/0x1e2 [] do_exit+0x7db/0x8d0 [] do_group_exit+0x3a/0xa0 []

[Question] A panic when reboot --force the system

2015-10-23 Thread Rui Xiang
Hi,list I encounter a panic about init process. Kernel panic - not syncing: Attempted to kill init! exitcode=0x0007 Pid: 1, comm: init Tainted: G RO 3.4.24.19-0.11-default #1 Call Trace: [] panic+0xc1/0x1e2 [] do_exit+0x7db/0x8d0 [] do_group_exit+0x3a/0xa0 []

A problem about OX_ID reused by FCoE driver

2015-07-23 Thread Rui Xiang
From: Wu Yanjiang Hi all, On a system that was running 3.0.13-0.27-default, a problem that the OX_ID is reused by FCoE driver occurred. Which can be confirmed is that the problem is occurred at initiator side, but the reason how does it happen is unknown. By the trace captured by JDSU

A problem about OX_ID reused by FCoE driver

2015-07-23 Thread Rui Xiang
From: Wu Yanjiang wuyanji...@huawei.com Hi all, On a system that was running 3.0.13-0.27-default, a problem that the OX_ID is reused by FCoE driver occurred. Which can be confirmed is that the problem is occurred at initiator side, but the reason how does it happen is unknown. By the trace

[BUG] A bug report between init_moudle and kallsyms_lookup_name

2014-12-22 Thread Rui Xiang
Hi List, We encounter a crash in kallsyms_lookup_name in our product, the kernel version is Linux 3.4. It seems a kernel bug. In the scene, some modules were loading in CPU A. But kallsyms_lookup_name was executed to find an symbol name for each modules in CPU B. The reason seems like that,

[BUG] A bug report between init_moudle and kallsyms_lookup_name

2014-12-22 Thread Rui Xiang
Hi List, We encounter a crash in kallsyms_lookup_name in our product, the kernel version is Linux 3.4. It seems a kernel bug. In the scene, some modules were loading in CPU A. But kallsyms_lookup_name was executed to find an symbol name for each modules in CPU B. The reason seems like that,

Re: testing result of loop-aio patchset on ext3

2014-08-06 Thread Rui Xiang
On 2014/7/21 10:34, Rui Xiang wrote: > On 2014/7/18 17:10, Lukáš Czerner wrote: >> On Wed, 16 Jul 2014, Rui Xiang wrote: >> >>> Date: Wed, 16 Jul 2014 17:28:10 +0800 >>> From: Rui Xiang >>> To: Lukáš Czerner >>> Cc: Dave Kleika

Re: testing result of loop-aio patchset on ext3

2014-08-06 Thread Rui Xiang
On 2014/7/21 10:34, Rui Xiang wrote: > On 2014/7/18 17:10, Lukáš Czerner wrote: >> On Wed, 16 Jul 2014, Rui Xiang wrote: >> >>> Date: Wed, 16 Jul 2014 17:28:10 +0800 >>> From: Rui Xiang >>> To: Lukáš Czerner >>> Cc: Dave Kleika

Re: testing result of loop-aio patchset on ext3

2014-08-06 Thread Rui Xiang
On 2014/7/21 10:34, Rui Xiang wrote: On 2014/7/18 17:10, Lukáš Czerner wrote: On Wed, 16 Jul 2014, Rui Xiang wrote: Date: Wed, 16 Jul 2014 17:28:10 +0800 From: Rui Xiang rui.xi...@huawei.com To: Lukáš Czerner lczer...@redhat.com Cc: Dave Kleikamp dave.kleik...@oracle.com, linux-e

Re: testing result of loop-aio patchset on ext3

2014-08-06 Thread Rui Xiang
On 2014/7/21 10:34, Rui Xiang wrote: On 2014/7/18 17:10, Lukáš Czerner wrote: On Wed, 16 Jul 2014, Rui Xiang wrote: Date: Wed, 16 Jul 2014 17:28:10 +0800 From: Rui Xiang rui.xi...@huawei.com To: Lukáš Czerner lczer...@redhat.com Cc: Dave Kleikamp dave.kleik...@oracle.com, linux-e

Re: testing result of loop-aio patchset on ext3

2014-07-20 Thread Rui Xiang
On 2014/7/18 17:10, Lukáš Czerner wrote: > On Wed, 16 Jul 2014, Rui Xiang wrote: > >> Date: Wed, 16 Jul 2014 17:28:10 +0800 >> From: Rui Xiang >> To: Lukáš Czerner >> Cc: Dave Kleikamp , linux-e...@vger.kernel.org, >> linux-fsde...@vger.kernel.org, lin

Re: testing result of loop-aio patchset on ext3

2014-07-20 Thread Rui Xiang
On 2014/7/18 17:10, Lukáš Czerner wrote: On Wed, 16 Jul 2014, Rui Xiang wrote: Date: Wed, 16 Jul 2014 17:28:10 +0800 From: Rui Xiang rui.xi...@huawei.com To: Lukáš Czerner lczer...@redhat.com Cc: Dave Kleikamp dave.kleik...@oracle.com, linux-e...@vger.kernel.org, linux-fsde

Re: testing result of loop-aio patchset on ext3

2014-07-16 Thread Rui Xiang
On 2014/7/16 15:58, Lukáš Czerner wrote: > On Wed, 16 Jul 2014, Rui Xiang wrote: > >> Date: Wed, 16 Jul 2014 11:54:24 +0800 >> From: Rui Xiang >> To: Lukáš Czerner >> Cc: Dave Kleikamp , linux-e...@vger.kernel.org, >> linux-fsde...@vger.kernel.org, lin

Re: testing result of loop-aio patchset on ext3

2014-07-16 Thread Rui Xiang
On 2014/7/16 15:58, Lukáš Czerner wrote: On Wed, 16 Jul 2014, Rui Xiang wrote: Date: Wed, 16 Jul 2014 11:54:24 +0800 From: Rui Xiang rui.xi...@huawei.com To: Lukáš Czerner lczer...@redhat.com Cc: Dave Kleikamp dave.kleik...@oracle.com, linux-e...@vger.kernel.org, linux-fsde

Re: testing result of loop-aio patchset on ext3

2014-07-15 Thread Rui Xiang
On 2014/7/14 17:51, Lukáš Czerner wrote: > On Mon, 14 Jul 2014, Rui Xiang wrote: > >> Date: Mon, 14 Jul 2014 17:34:38 +0800 >> From: Rui Xiang >> To: Dave Kleikamp , linux-e...@vger.kernel.org >> Cc: linux-fsde...@vger.kernel.org, linux-kernel@vger.kernel.or

Re: testing result of loop-aio patchset on ext3

2014-07-15 Thread Rui Xiang
On 2014/7/14 17:51, Lukáš Czerner wrote: On Mon, 14 Jul 2014, Rui Xiang wrote: Date: Mon, 14 Jul 2014 17:34:38 +0800 From: Rui Xiang rui.xi...@huawei.com To: Dave Kleikamp dave.kleik...@oracle.com, linux-e...@vger.kernel.org Cc: linux-fsde...@vger.kernel.org, linux-kernel@vger.kernel.org

testing result of loop-aio patchset on ext3

2014-07-14 Thread Rui Xiang
Hi Dave, We export a container image file as a block device via loop device, but we found it's very easy that the container rootfs gets corrupted due to power loss. Your early version of loop-aio patchset said the patchset can make loop mounted filesystems

testing result of loop-aio patchset on ext3

2014-07-14 Thread Rui Xiang
Hi Dave, We export a container image file as a block device via loop device, but we found it's very easy that the container rootfs gets corrupted due to power loss. Your early version of loop-aio patchset said the patchset can make loop mounted filesystems

Re: [PATCH 2/2] romfs: remove an redundant if condition in romfs_readpage

2013-12-16 Thread Rui Xiang
On 2013/12/16 16:10, Andrew Morton wrote: > On Tue, 26 Nov 2013 16:39:09 +0800 Rui Xiang wrote: > >> Here ret always equals 0, so SetPageUptodate directly. >> >> ... >> >> --- a/fs/romfs/super.c >> +++ b/fs/romfs/super.c >> @@ -129,8 +129,7 @@ sta

Re: [PATCH 2/2] romfs: remove an redundant if condition in romfs_readpage

2013-12-16 Thread Rui Xiang
On 2013/12/16 16:10, Andrew Morton wrote: On Tue, 26 Nov 2013 16:39:09 +0800 Rui Xiang rui.xi...@huawei.com wrote: Here ret always equals 0, so SetPageUptodate directly. ... --- a/fs/romfs/super.c +++ b/fs/romfs/super.c @@ -129,8 +129,7 @@ static int romfs_readpage(struct file *file

Re: [PATCH RESEND 1/2] proc: change return values while get_proc_task err

2013-12-10 Thread Rui Xiang
On 2013/12/11 7:02, Andrew Morton wrote: > On Mon, 9 Dec 2013 20:11:54 +0800 Rui Xiang wrote: > >> While getting proc task error, it shoule return -ESRCH. >> >> ... >> >> --- a/fs/proc/base.c >> +++ b/fs/proc/base.c >> @@ -174,9 +174,10 @@ s

Re: [PATCH RESEND 1/2] proc: change return values while get_proc_task err

2013-12-10 Thread Rui Xiang
On 2013/12/11 7:02, Andrew Morton wrote: On Mon, 9 Dec 2013 20:11:54 +0800 Rui Xiang rui.xi...@huawei.com wrote: While getting proc task error, it shoule return -ESRCH. ... --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -174,9 +174,10 @@ static int get_task_root(struct task_struct *task

[PATCH RESEND 1/2] proc: change return values while get_proc_task err

2013-12-09 Thread Rui Xiang
While getting proc task error, it shoule return -ESRCH. Signed-off-by: Rui Xiang --- fs/proc/base.c | 25 +++-- fs/proc/fd.c | 8 +--- fs/proc/namespaces.c | 12 fs/proc_namespace.c | 2 +- 4 files changed, 29 insertions(+), 18 deletions

[PATCH RESEND 2/2] proc: set attributes of pde by accessor functions

2013-12-09 Thread Rui Xiang
Use existing accessor proc_set_user and proc_set_size to set attributes. Just clean up. Signed-off-by: Rui Xiang --- fs/proc/generic.c | 3 +-- fs/proc/proc_devtree.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/proc/generic.c b/fs/proc/generic.c index

[PATCH RESEND 1/2] proc: change return values while get_proc_task err

2013-12-09 Thread Rui Xiang
While getting proc task error, it shoule return -ESRCH. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- fs/proc/base.c | 25 +++-- fs/proc/fd.c | 8 +--- fs/proc/namespaces.c | 12 fs/proc_namespace.c | 2 +- 4 files changed, 29 insertions

[PATCH RESEND 2/2] proc: set attributes of pde by accessor functions

2013-12-09 Thread Rui Xiang
Use existing accessor proc_set_user and proc_set_size to set attributes. Just clean up. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- fs/proc/generic.c | 3 +-- fs/proc/proc_devtree.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/proc/generic.c b/fs/proc

Re: [PATCH] sysfs: add necessary Null check in sysfs_do_create_link_sd

2013-12-02 Thread Rui Xiang
On 2013/12/3 10:47, Greg Kroah-Hartman wrote: > On Tue, Dec 03, 2013 at 09:38:47AM +0800, Rui Xiang wrote: >> While target_sd or sd are null, it won't need sysfs_put and >> should return -ENOENT directly. Here add null check for >> target_sd and sd. >> >> Signed

[PATCH] sysfs: add necessary Null check in sysfs_do_create_link_sd

2013-12-02 Thread Rui Xiang
While target_sd or sd are null, it won't need sysfs_put and should return -ENOENT directly. Here add null check for target_sd and sd. Signed-off-by: Rui Xiang --- fs/sysfs/symlink.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c

[PATCH] sysfs: add necessary Null check in sysfs_do_create_link_sd

2013-12-02 Thread Rui Xiang
While target_sd or sd are null, it won't need sysfs_put and should return -ENOENT directly. Here add null check for target_sd and sd. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- fs/sysfs/symlink.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/sysfs/symlink.c

Re: [PATCH] sysfs: add necessary Null check in sysfs_do_create_link_sd

2013-12-02 Thread Rui Xiang
On 2013/12/3 10:47, Greg Kroah-Hartman wrote: On Tue, Dec 03, 2013 at 09:38:47AM +0800, Rui Xiang wrote: While target_sd or sd are null, it won't need sysfs_put and should return -ENOENT directly. Here add null check for target_sd and sd. Signed-off-by: Rui Xiang rui.xi...@huawei.com

[PATCH 2/2] romfs: remove an redundant if condition in romfs_readpage

2013-11-26 Thread Rui Xiang
Here ret always equals 0, so SetPageUptodate directly. Signed-off-by: Rui Xiang --- fs/romfs/super.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/romfs/super.c b/fs/romfs/super.c index d841878..b5e4ad4 100644 --- a/fs/romfs/super.c +++ b/fs/romfs/super.c @@ -129,8

[PATCH 1/2] romfs: fix returm err while getting inode in fill_super

2013-11-26 Thread Rui Xiang
Getting an inode by romfs_iget may lead to an err in fill_super, and the err value should be return. And it should return -ENOMEM instead while d_make_root fails, fix it too. Signed-off-by: Rui Xiang --- fs/romfs/super.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git

[PATCH 1/2] romfs: fix returm err while getting inode in fill_super

2013-11-26 Thread Rui Xiang
Getting an inode by romfs_iget may lead to an err in fill_super, and the err value should be return. And it should return -ENOMEM instead while d_make_root fails, fix it too. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- fs/romfs/super.c | 6 ++ 1 file changed, 2 insertions(+), 4

[PATCH 2/2] romfs: remove an redundant if condition in romfs_readpage

2013-11-26 Thread Rui Xiang
Here ret always equals 0, so SetPageUptodate directly. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- fs/romfs/super.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/romfs/super.c b/fs/romfs/super.c index d841878..b5e4ad4 100644 --- a/fs/romfs/super.c +++ b/fs/romfs

[PATCH 2/2] autofs: use IS_ROOT to replace parent == dentry->d_parent

2013-08-30 Thread Rui Xiang
Use the helper macro !IS_ROOT to replace parent != dentry->d_parent. Just clean up. Signed-off-by: Rui Xiang --- fs/autofs4/root.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index 92ef341..2caf36a 100644 --- a/fs/auto

[PATCH 1/2] autofs: fix the return value of autofs4_fill_super

2013-08-30 Thread Rui Xiang
While kzallocing sbi/ino fails, it should return -ENOMEM. And it should return the err value from autofs_prepare_pipe. Signed-off-by: Rui Xiang --- fs/autofs4/inode.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c index

[PATCH 2/2] autofs: use IS_ROOT to replace parent == dentry-d_parent

2013-08-30 Thread Rui Xiang
Use the helper macro !IS_ROOT to replace parent != dentry-d_parent. Just clean up. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- fs/autofs4/root.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index 92ef341..2caf36a 100644

[PATCH 1/2] autofs: fix the return value of autofs4_fill_super

2013-08-30 Thread Rui Xiang
While kzallocing sbi/ino fails, it should return -ENOMEM. And it should return the err value from autofs_prepare_pipe. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- fs/autofs4/inode.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/fs/autofs4/inode.c b/fs

[PATCH 1/2] proc: set attributes of pde by accessor functions

2013-08-26 Thread Rui Xiang
Clean up. Signed-off-by: Rui Xiang --- fs/proc/generic.c | 3 +-- fs/proc/proc_devtree.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 737e156..2097e9e 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -49,8

[PATCH 2/2] proc: change return values while get_proc_task err

2013-08-26 Thread Rui Xiang
While getting proc task fails, it shoule return -ESRCH. Signed-off-by: Rui Xiang --- fs/proc/base.c | 25 +++-- fs/proc/fd.c | 8 +--- fs/proc/namespaces.c | 12 fs/proc_namespace.c | 2 +- 4 files changed, 29 insertions(+), 18 deletions

[PATCH 2/2] proc: change return values while get_proc_task err

2013-08-26 Thread Rui Xiang
While getting proc task fails, it shoule return -ESRCH. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- fs/proc/base.c | 25 +++-- fs/proc/fd.c | 8 +--- fs/proc/namespaces.c | 12 fs/proc_namespace.c | 2 +- 4 files changed, 29 insertions

[PATCH 1/2] proc: set attributes of pde by accessor functions

2013-08-26 Thread Rui Xiang
Clean up. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- fs/proc/generic.c | 3 +-- fs/proc/proc_devtree.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 737e156..2097e9e 100644 --- a/fs/proc/generic.c +++ b/fs/proc

Re: [PATCH 0/2] fs: supply inode uid/gid setting interface

2013-08-23 Thread Rui Xiang
On 2013/8/23 12:10, Greg KH wrote: > On Fri, Aug 23, 2013 at 10:48:36AM +0800, Rui Xiang wrote: >> This patchset implements an accessor functions to set uid/gid >> in inode struct. Just finish code clean up. > > Why? > It can introduce a new function to reduce som

Re: [PATCH 0/2] fs: supply inode uid/gid setting interface

2013-08-23 Thread Rui Xiang
On 2013/8/23 12:10, Greg KH wrote: On Fri, Aug 23, 2013 at 10:48:36AM +0800, Rui Xiang wrote: This patchset implements an accessor functions to set uid/gid in inode struct. Just finish code clean up. Why? It can introduce a new function to reduce some codes. Just clean up. Thanks

[PATCH 2/2] fs: use inode_set_user to set uid/gid of inode

2013-08-22 Thread Rui Xiang
Use the new interface to set i_uid/i_gid in inode struct. Signed-off-by: Rui Xiang --- arch/ia64/kernel/perfmon.c| 3 +-- arch/powerpc/platforms/cell/spufs/inode.c | 3 +-- arch/s390/hypfs/inode.c | 3 +-- drivers/infiniband/hw/qib/qib_fs.c| 3

[PATCH 1/2] fs: implement inode uid/gid setting function

2013-08-22 Thread Rui Xiang
Supply a interface inode_set_user to set uid/gid of inode structs. Signed-off-by: Rui Xiang --- fs/inode.c | 7 +++ include/linux/fs.h | 1 + 2 files changed, 8 insertions(+) diff --git a/fs/inode.c b/fs/inode.c index e315c0a..3f90499 100644 --- a/fs/inode.c +++ b/fs/inode.c

[PATCH 0/2] fs: supply inode uid/gid setting interface

2013-08-22 Thread Rui Xiang
This patchset implements an accessor functions to set uid/gid in inode struct. Just finish code clean up. Rui Xiang (2): fs: implement inode uid/gid setting function fs: use inode_set_user to set uid/gid of inode arch/ia64/kernel/perfmon.c| 3 +-- arch/powerpc/platforms

[PATCH 0/2] fs: supply inode uid/gid setting interface

2013-08-22 Thread Rui Xiang
This patchset implements an accessor functions to set uid/gid in inode struct. Just finish code clean up. Rui Xiang (2): fs: implement inode uid/gid setting function fs: use inode_set_user to set uid/gid of inode arch/ia64/kernel/perfmon.c| 3 +-- arch/powerpc/platforms

[PATCH 1/2] fs: implement inode uid/gid setting function

2013-08-22 Thread Rui Xiang
Supply a interface inode_set_user to set uid/gid of inode structs. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- fs/inode.c | 7 +++ include/linux/fs.h | 1 + 2 files changed, 8 insertions(+) diff --git a/fs/inode.c b/fs/inode.c index e315c0a..3f90499 100644 --- a/fs/inode.c

[PATCH 2/2] fs: use inode_set_user to set uid/gid of inode

2013-08-22 Thread Rui Xiang
Use the new interface to set i_uid/i_gid in inode struct. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- arch/ia64/kernel/perfmon.c| 3 +-- arch/powerpc/platforms/cell/spufs/inode.c | 3 +-- arch/s390/hypfs/inode.c | 3 +-- drivers/infiniband/hw/qib

Re: [PATCH] userns: initialize the depth of user_namespace chain

2013-08-14 Thread Rui Xiang
On 2013/8/15 2:43, Oleg Nesterov wrote: > On 08/14, Rui Xiang wrote: >> >> On 2013/8/14 13:06, Andy Lutomirski wrote: >>> On Tue, Aug 13, 2013 at 10:04 PM, Rui Xiang wrote: >>>> The level of init_user_ns shoule be 1. >>> >>> What's wrong

Re: [PATCH] userns: initialize the depth of user_namespace chain

2013-08-14 Thread Rui Xiang
On 2013/8/14 13:06, Andy Lutomirski wrote: > On Tue, Aug 13, 2013 at 10:04 PM, Rui Xiang wrote: >> The level of init_user_ns shoule be 1. > > What's wrong with zero? > No problem. It is just consistent with commit 8742f229b63, IMHO. but the initialization of level should be n

Re: [PATCH] userns: initialize the depth of user_namespace chain

2013-08-14 Thread Rui Xiang
On 2013/8/14 13:06, Andy Lutomirski wrote: On Tue, Aug 13, 2013 at 10:04 PM, Rui Xiang rui.xi...@huawei.com wrote: The level of init_user_ns shoule be 1. What's wrong with zero? No problem. It is just consistent with commit 8742f229b63, IMHO. but the initialization of level should

Re: [PATCH] userns: initialize the depth of user_namespace chain

2013-08-14 Thread Rui Xiang
On 2013/8/15 2:43, Oleg Nesterov wrote: On 08/14, Rui Xiang wrote: On 2013/8/14 13:06, Andy Lutomirski wrote: On Tue, Aug 13, 2013 at 10:04 PM, Rui Xiang rui.xi...@huawei.com wrote: The level of init_user_ns shoule be 1. What's wrong with zero? No problem. It is just consistent

[PATCH] userns: initialize the depth of user_namespace chain

2013-08-13 Thread Rui Xiang
The level of init_user_ns shoule be 1. Signed-off-by: Rui Xiang --- kernel/user.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/user.c b/kernel/user.c index 69b4c3d..32da187 100644 --- a/kernel/user.c +++ b/kernel/user.c @@ -48,6 +48,7 @@ struct user_namespace init_user_ns

[PATCH] userns: initialize the depth of user_namespace chain

2013-08-13 Thread Rui Xiang
The level of init_user_ns shoule be 1. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- kernel/user.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/user.c b/kernel/user.c index 69b4c3d..32da187 100644 --- a/kernel/user.c +++ b/kernel/user.c @@ -48,6 +48,7 @@ struct user_namespace

Re: [PATCH v3 00/11] Add namespace support for syslog

2013-08-08 Thread Rui Xiang
r space tools in container may use this interface > to read/generate syslog. > > But I don't know how important/urgent this containerizing syslog work is, > Rui Xiang, can you find an important/popular user space tool which uses this > interfaces to generate kernel syslog? > Th

Re: [PATCH v3 00/11] Add namespace support for syslog

2013-08-08 Thread Rui Xiang
this containerizing syslog work is, Rui Xiang, can you find an important/popular user space tool which uses this interfaces to generate kernel syslog? There are some other cases. Some warnings (bad mount options for tmpfs, bad uid owner for many of them, etc) emerged in the container should

[PATCH v3 02/11] syslog_ns: add syslog_ns into user_namespace

2013-08-07 Thread Rui Xiang
Add a syslog_ns pointer to user_namespace, and make syslog_ns per user_namespace, not global. Since syslog_ns is assigned to user_ns, we can have full capabilities in new user_ns to create a new syslog_ns. Signed-off-by: Rui Xiang --- include/linux/syslog.h | 5 + include/linux

[PATCH v3 07/11] syslog_ns: implement function for creating syslog ns

2013-08-07 Thread Rui Xiang
) of __NR_syslog system call. Through that command, we can create a new syslog ns in user space. Signed-off-by: Rui Xiang --- include/linux/syslog.h | 4 kernel/printk.c| 52 ++ 2 files changed, 56 insertions(+) diff --git a/include/linux

[PATCH v3 01/11] syslog_ns: add syslog_namespace and put/get_syslog_ns

2013-08-07 Thread Rui Xiang
Add a struct syslog_namespace which contains the necessary members for hanlding syslog and realize get_syslog_ns and put_syslog_ns API. Signed-off-by: Rui Xiang --- include/linux/syslog.h | 68 ++ kernel/printk.c| 7 -- 2 files

[PATCH v3 03/11] syslog_ns: add init syslog_ns for global syslog

2013-08-07 Thread Rui Xiang
Add init_syslog_ns to manage host log buffer, and initilize its fileds as the global variables. Printk by default in kernel will continue to be targeted at init_syslog_ns. So the buf of init ns is just the same as the original global buf. Signed-off-by: Rui Xiang --- include/linux/syslog.h

[PATCH v3 09/11] syslog_ns: implement ns_printk_emit for specific syslog_ns

2013-08-07 Thread Rui Xiang
-off-by: Rui Xiang --- include/linux/printk.h | 6 ++ kernel/printk.c| 20 +++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/include/linux/printk.h b/include/linux/printk.h index bf83ad9..4c7e2be 100644 --- a/include/linux/printk.h +++ b/include/linux

[PATCH v3 10/11] syslog_ns: implement ns_console_unlock for specific syslog_ns

2013-08-07 Thread Rui Xiang
from current syslog namespace on cosoles, not just init_ syslog_ns. Signed-off-by: Rui Xiang --- include/linux/console.h | 1 + kernel/printk.c | 116 +++- 2 files changed, 116 insertions(+), 1 deletion(-) diff --git a/include/linux/console.h

[PATCH v3 11/11] netfilter: use ns_printk in iptable context

2013-08-07 Thread Rui Xiang
To containerise iptables log, use ns_printk to report individual logs to container as getting syslog_ns from net->user_ns. Signed-off-by: Rui Xiang --- include/net/netfilter/xt_log.h | 6 +- net/netfilter/xt_LOG.c | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) d

[PATCH v3 04/11] syslog_ns: make syslog handling per namespace

2013-08-07 Thread Rui Xiang
zed for container users. Signed-off-by: Rui Xiang --- fs/proc/kmsg.c | 17 +- include/linux/printk.h | 1 - include/linux/syslog.h | 3 +- kernel/printk.c| 513 + kernel/sysctl.c| 3 +- 5 files changed, 273 insertions(+),

[PATCH v3 05/11] syslog_ns: make permisiion check per user namespace

2013-08-07 Thread Rui Xiang
Use ns_capable to check capability in user ns, instead of capable function. The user ns is the owner of current syslog ns. Signed-off-by: Rui Xiang --- kernel/printk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/printk.c b/kernel/printk.c index e508ab2

[PATCH v3 00/11] Add namespace support for syslog

2013-08-07 Thread Rui Xiang
ce. -- Put user ns while freeing syslog_ns. -- Use net instead of skb->dev->nd_net in sb_close. -- Clean up. Rui Xiang (11): syslog_ns: add syslog_namespace and put/get_syslog_ns syslog_ns: add syslog_ns into user_namespace syslog_ns: add init syslog_ns for global syslog sys

[PATCH v3 06/11] syslog_ns: use init syslog_ns for console action

2013-08-07 Thread Rui Xiang
While flags SYSLOG_ACTION_CONSOLE_ON/OFF/LEVEL of console actin are used in syslog syscall, the related hanlding should be targeted at host by init_syslog_ns. Signed-off-by: Rui Xiang --- kernel/printk.c | 5 + 1 file changed, 5 insertions(+) diff --git a/kernel/printk.c b/kernel/printk.c

[PATCH v3 08/11] syslog_ns: implement ns_printk for specific syslog_ns

2013-08-07 Thread Rui Xiang
Add a new interface named ns_printk, and assign an patamater ns. Log which belong to a container can be printed by ns_printk. Signed-off-by: Rui Xiang --- include/linux/printk.h | 4 kernel/printk.c| 53 ++ 2 files changed, 53

[PATCH v3 08/11] syslog_ns: implement ns_printk for specific syslog_ns

2013-08-07 Thread Rui Xiang
Add a new interface named ns_printk, and assign an patamater ns. Log which belong to a container can be printed by ns_printk. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- include/linux/printk.h | 4 kernel/printk.c| 53 ++ 2

[PATCH v3 05/11] syslog_ns: make permisiion check per user namespace

2013-08-07 Thread Rui Xiang
Use ns_capable to check capability in user ns, instead of capable function. The user ns is the owner of current syslog ns. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- kernel/printk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/printk.c b/kernel/printk.c

[PATCH v3 00/11] Add namespace support for syslog

2013-08-07 Thread Rui Xiang
freeing syslog_ns. -- Use net instead of skb-dev-nd_net in sb_close. -- Clean up. Rui Xiang (11): syslog_ns: add syslog_namespace and put/get_syslog_ns syslog_ns: add syslog_ns into user_namespace syslog_ns: add init syslog_ns for global syslog syslog_ns: make syslog handling per namespace

[PATCH v3 06/11] syslog_ns: use init syslog_ns for console action

2013-08-07 Thread Rui Xiang
While flags SYSLOG_ACTION_CONSOLE_ON/OFF/LEVEL of console actin are used in syslog syscall, the related hanlding should be targeted at host by init_syslog_ns. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- kernel/printk.c | 5 + 1 file changed, 5 insertions(+) diff --git a/kernel

[PATCH v3 11/11] netfilter: use ns_printk in iptable context

2013-08-07 Thread Rui Xiang
To containerise iptables log, use ns_printk to report individual logs to container as getting syslog_ns from net-user_ns. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- include/net/netfilter/xt_log.h | 6 +- net/netfilter/xt_LOG.c | 4 ++-- 2 files changed, 7 insertions(+), 3

[PATCH v3 04/11] syslog_ns: make syslog handling per namespace

2013-08-07 Thread Rui Xiang
users. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- fs/proc/kmsg.c | 17 +- include/linux/printk.h | 1 - include/linux/syslog.h | 3 +- kernel/printk.c| 513 + kernel/sysctl.c| 3 +- 5 files changed, 273

[PATCH v3 10/11] syslog_ns: implement ns_console_unlock for specific syslog_ns

2013-08-07 Thread Rui Xiang
from current syslog namespace on cosoles, not just init_ syslog_ns. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- include/linux/console.h | 1 + kernel/printk.c | 116 +++- 2 files changed, 116 insertions(+), 1 deletion(-) diff --git

[PATCH v3 03/11] syslog_ns: add init syslog_ns for global syslog

2013-08-07 Thread Rui Xiang
Add init_syslog_ns to manage host log buffer, and initilize its fileds as the global variables. Printk by default in kernel will continue to be targeted at init_syslog_ns. So the buf of init ns is just the same as the original global buf. Signed-off-by: Rui Xiang rui.xi...@huawei.com

[PATCH v3 09/11] syslog_ns: implement ns_printk_emit for specific syslog_ns

2013-08-07 Thread Rui Xiang
-off-by: Rui Xiang rui.xi...@huawei.com --- include/linux/printk.h | 6 ++ kernel/printk.c| 20 +++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/include/linux/printk.h b/include/linux/printk.h index bf83ad9..4c7e2be 100644 --- a/include/linux/printk.h

[PATCH v3 07/11] syslog_ns: implement function for creating syslog ns

2013-08-07 Thread Rui Xiang
) of __NR_syslog system call. Through that command, we can create a new syslog ns in user space. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- include/linux/syslog.h | 4 kernel/printk.c| 52 ++ 2 files changed, 56 insertions(+) diff

[PATCH v3 01/11] syslog_ns: add syslog_namespace and put/get_syslog_ns

2013-08-07 Thread Rui Xiang
Add a struct syslog_namespace which contains the necessary members for hanlding syslog and realize get_syslog_ns and put_syslog_ns API. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- include/linux/syslog.h | 68 ++ kernel/printk.c| 7

[PATCH v3 02/11] syslog_ns: add syslog_ns into user_namespace

2013-08-07 Thread Rui Xiang
Add a syslog_ns pointer to user_namespace, and make syslog_ns per user_namespace, not global. Since syslog_ns is assigned to user_ns, we can have full capabilities in new user_ns to create a new syslog_ns. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- include/linux/syslog.h | 5

Re: [PATCH 4/9] syslog_ns: make syslog handling per namespace

2013-08-01 Thread Rui Xiang
On 2013/8/1 13:38, Gao feng wrote: > On 08/01/2013 11:10 AM, Rui Xiang wrote: >> On 2013/8/1 9:36, Gao feng wrote: >>> On 07/29/2013 10:31 AM, Rui Xiang wrote: >>>> This patch makes syslog buf and other fields per >>>> namespace. >>>&

Re: [PATCH 4/9] syslog_ns: make syslog handling per namespace

2013-08-01 Thread Rui Xiang
On 2013/8/1 13:38, Gao feng wrote: On 08/01/2013 11:10 AM, Rui Xiang wrote: On 2013/8/1 9:36, Gao feng wrote: On 07/29/2013 10:31 AM, Rui Xiang wrote: This patch makes syslog buf and other fields per namespace. Here use ns-log_buf(log_buf_len, logbuf_lock, log_first_seq, logbuf_lock

Re: [PATCH 4/9] syslog_ns: make syslog handling per namespace

2013-07-31 Thread Rui Xiang
On 2013/8/1 9:36, Gao feng wrote: > On 07/29/2013 10:31 AM, Rui Xiang wrote: >> This patch makes syslog buf and other fields per >> namespace. >> >> Here use ns->log_buf(log_buf_len, logbuf_lock, >> log_first_seq, logbuf_lock, and so on) fields >&g

Re: [PATCH 4/9] syslog_ns: make syslog handling per namespace

2013-07-31 Thread Rui Xiang
On 2013/8/1 9:36, Gao feng wrote: On 07/29/2013 10:31 AM, Rui Xiang wrote: This patch makes syslog buf and other fields per namespace. Here use ns-log_buf(log_buf_len, logbuf_lock, log_first_seq, logbuf_lock, and so on) fields instead of global ones to handle syslog. Syslog interfaces

Re: [PATCH 7/9] syslog_ns: implement function for creating syslog ns

2013-07-29 Thread Rui Xiang
On 2013/7/29 18:25, Gu Zheng wrote: > Hi Rui, > > On 07/29/2013 10:31 AM, Rui Xiang wrote: > >> Add create_syslog_ns function to create a new ns. We >> must create a user_ns before create a new syslog ns. >> And then tie the new syslog_ns to current user_ns >>

Re: [PATCH 0/9] Add namespace support for syslog v2

2013-07-29 Thread Rui Xiang
Hi Eric, Thanks for your attention. On 2013/7/30 2:58, Eric W. Biederman wrote: > Rui Xiang writes: > >> This patchset introduces a system log namespace. > > The largest outstanding question is not answered. Can't we just fix > iptables to log somehwere better

Re: [PATCH 9/9] netfilter: use ns_printk in iptable context

2013-07-29 Thread Rui Xiang
On 2013/7/29 17:48, Gao feng wrote: > On 07/29/2013 10:31 AM, Rui Xiang wrote: >> To containerise iptables log, use ns_printk >> to report individual logs to container as >> getting syslog_ns from skb->dev->nd_net->user_ns. >> >> Signed-off-by: Rui Xiang

Re: [PATCH 8/9] syslog_ns: implement ns_printk for specific syslog_ns

2013-07-29 Thread Rui Xiang
On 2013/7/29 18:37, Gu Zheng wrote: > Hi Rui, > > On 07/29/2013 10:31 AM, Rui Xiang wrote: > >> Add a new interface named ns_printk, and assign an >> patamater ns. Log which belong to a container can >> be printed by ns_printk. > > One question, with the

Re: [PATCH 1/9] syslog_ns: add syslog_namespace and put/get_syslog_ns

2013-07-29 Thread Rui Xiang
On 2013/7/29 17:40, Gu Zheng wrote: > Hi Rui, > Refer to inline:). > Hi Gu, Thanks for your attention. > On 07/29/2013 10:31 AM, Rui Xiang wrote: > >> Add a struct syslog_namespace which contains the necessary >> members for hanlding syslog and realize get_sys

Re: [PATCH 1/9] syslog_ns: add syslog_namespace and put/get_syslog_ns

2013-07-29 Thread Rui Xiang
On 2013/7/29 17:40, Gu Zheng wrote: Hi Rui, Refer to inline:). Hi Gu, Thanks for your attention. On 07/29/2013 10:31 AM, Rui Xiang wrote: Add a struct syslog_namespace which contains the necessary members for hanlding syslog and realize get_syslog_ns and put_syslog_ns API

Re: [PATCH 8/9] syslog_ns: implement ns_printk for specific syslog_ns

2013-07-29 Thread Rui Xiang
On 2013/7/29 18:37, Gu Zheng wrote: Hi Rui, On 07/29/2013 10:31 AM, Rui Xiang wrote: Add a new interface named ns_printk, and assign an patamater ns. Log which belong to a container can be printed by ns_printk. One question, with the syslog_ns used, do the log we print by *printk

Re: [PATCH 9/9] netfilter: use ns_printk in iptable context

2013-07-29 Thread Rui Xiang
On 2013/7/29 17:48, Gao feng wrote: On 07/29/2013 10:31 AM, Rui Xiang wrote: To containerise iptables log, use ns_printk to report individual logs to container as getting syslog_ns from skb-dev-nd_net-user_ns. Signed-off-by: Rui Xiang rui.xi...@huawei.com --- include/net/netfilter

Re: [PATCH 0/9] Add namespace support for syslog v2

2013-07-29 Thread Rui Xiang
Hi Eric, Thanks for your attention. On 2013/7/30 2:58, Eric W. Biederman wrote: Rui Xiang rui.xi...@huawei.com writes: This patchset introduces a system log namespace. The largest outstanding question is not answered. Can't we just fix iptables to log somehwere better than dmesg

Re: [PATCH 7/9] syslog_ns: implement function for creating syslog ns

2013-07-29 Thread Rui Xiang
On 2013/7/29 18:25, Gu Zheng wrote: Hi Rui, On 07/29/2013 10:31 AM, Rui Xiang wrote: Add create_syslog_ns function to create a new ns. We must create a user_ns before create a new syslog ns. And then tie the new syslog_ns to current user_ns instead of original syslog_ns which comes from

  1   2   >