LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 08-22-2016, 02:33 PM   #1
goblinhack
LQ Newbie
 
Registered: Dec 2015
Posts: 3

Rep: Reputation: Disabled
Question Shared mount inode mirroring only works in one direction


I have an LXC and the host kernel and am trying to have a netns
that is created in the LXC appear in the host kernel. It does,
but with a different inode.

In the other direction it works fine. i.e. I create the netns in the
host and the same inode appears in the LXC.

Looking at the comments in attach_recursive_mnt() it looks like
I'm doing the correct thing, the host kernel /var/run/netns on
the host is mounted into the LXC as follows:

if [ ! -d /var/run/netns ];
then
mkdir -p /var/run/netns
mount --rbind /var/run/netns /var/run/netns
mount --make-rshared /var/run/netns
fi

mkdir -p $LXC_PATH/var/run/netns
mount --rbind /var/run/netns $LXC_PATH/var/run/netns

/var/run/netns in the lxc is marked as shared and appears in
the host kernel as shared also e.g. on the host:

findmnt -o TARGET,PROPAGATION | grep netns
| |-/run/netns shared
| | `-/run/netns/hostns shared

here is the example, hostns was created in the host, lxc1 created in the guest LXC. Host output:

[host:/var/run/netns]$ ls -li
4026533261 -r--r--r-- 1 root root 0 Aug 22 19:22 hostns
39414 ---------- 1 root root 0 Aug 22 19:23 lxc1

LXC output:
4026533261 -r--r--r-- 1 root root 0 Aug 22 19:22 hostns
4026533524 -r--r--r-- 1 root root 0 Aug 22 19:23 lxc1

I'm starting to think this is a kernel bug - but not sure where to debug to approach this. Permissions issue perhaps ?

BTW I've also hacked in libvirt to make sure the tree is MS_REC|MS_SHARED for /var/run/netns, didn't help. And tried various combinations of mount --make-rslave. Running out of ideas 8)

BTWBTW normal files work fine. inode mirroring works in both directions, so this seems peculiar to network namespaces... code pointers or anything welcome!


tx

neil
 
  


Reply

Tags
lxc



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Serial Communication Only Works in One Direction - Why? forbin Linux - Hardware 2 09-22-2010 08:17 AM
OpenSwan VPN only works in one direction Thakowbbery Linux - Networking 2 03-27-2008 01:15 PM
rsync works in one direction, but not the other hroit Linux - Desktop 7 08-14-2007 12:20 PM
Switch keyboard layout (works only one direction) krisyok Linux - Newbie 4 05-02-2007 06:12 AM
Samba - works in one direction sdlsatcom Linux - Networking 0 01-25-2004 04:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 02:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration