Thanks Serge for the patch.
This patch has overcome the problem of doing 'mount -t proc ..' while
running the container tests.

Regards, Veerendra C
________________________________________________________
Linux Technology Center, India Software Labs, Bangalore, Ph: 080-4177 6428


                                                                           
             "Serge E. Hallyn"                                             
             <[EMAIL PROTECTED]                                             
             >                                                          To 
                                       LTP list                            
             10/04/2008 02:28          <[email protected]>    
             AM                                                         cc 
                                       Veerendra                           
                                       Chandrappa/India/[EMAIL PROTECTED], 
Sukadev 
                                       Bhattiprolu <[EMAIL PROTECTED]>    
                                                                   Subject 
                                       Pid namespaces: unshare mounts      
                                       namespace                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




If we unshare pidns without unsharing mounts namespace, and then do
a mount -t proc none /proc, then the new proc sits over the original
proc for the whole system.

Since pidns03 wasn't using CLONE_NEWNS, when it exited /proc showed
zero tasks.  This can be fixed by doing 'umount -l /proc', but
'umount /proc' is insufficient.  More to the point, pidns03 wasn't
trying to clean up /proc at all.  So make it use CLONE_NEWNS so
its private procfs will be automatically cleaned up.

Signed-off-by: Serge E. Hallyn <[EMAIL PROTECTED]>
---
 pidns03.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -Nrup ltp-full-20080930/testcases/kernel/containers/pidns/pidns03.c
ltp-full-20080930.patched/testcases/kernel/containers/pidns/pidns03.c
--- ltp-full-20080930/testcases/kernel/containers/pidns/pidns03.c
2008-09-30 07:36:38.000000000 -0500
+++ ltp-full-20080930.patched/testcases/kernel/containers/pidns/pidns03.c
       2008-10-03 15:52:37.000000000 -0500
@@ -80,7 +80,7 @@ char **argv;
             ppid = getpid();

             /* Create a Container and execute to test the functionality */
-            ret = do_clone_unshare_test(T_CLONE, CLONE_NEWPID, child_fn,
ppid);
+            ret = do_clone_unshare_test(T_CLONE, CLONE_NEWPID|CLONE_NEWNS,
child_fn, ppid);

             /* check return code */
             if (ret == -1) {



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to