Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zfs mount is not namespace aware #526

Closed
akorn opened this issue Jan 10, 2012 · 5 comments
Closed

zfs mount is not namespace aware #526

akorn opened this issue Jan 10, 2012 · 5 comments

Comments

@akorn
Copy link
Contributor

akorn commented Jan 10, 2012

Hi,

I'm trying to use zfsonlinux with linux-vserver, which makes heavy use of namespaces (mount, ipc etc.).

zfs seems to lack namespace support entirely.

root@jayhawk / # mountpoint /srv
/srv is a mountpoint
root@jayhawk / # vnamespace -i 0 -e 78 -- /bin/zsh
# We're in a different mount namespace now:
root@jayhawk / # mountpoint /srv
/srv is not a mountpoint
root@jayhawk / # zfs mount tank/srv
cannot mount 'tank/srv': filesystem already mounted
root@jayhawk / # grep 'tank/srv /' /proc/mounts
root@jayhawk / #

"zfs mount tank/srv" should have succeeded, because tank/srv is only mounted in the default namespace, but not this one.

Andras

@akorn
Copy link
Contributor Author

akorn commented Jan 10, 2012

The issue goes deeper (which, in retrospect, is kind of obvious): when a namespace is created as a copy of the host namespace, and a zfs dataset is unmounted there, it becomes unmounted in the host namespace too.

@akorn
Copy link
Contributor Author

akorn commented Jan 11, 2012

Actually, this latter problem may have had to do with me using mount --make-shared on the affected tree. I'll try to confirm this later.

@akorn
Copy link
Contributor Author

akorn commented Jan 11, 2012

Yes, the phantom umounting was caused by mount --make-shared. So the only problem with zfsonlinux seems to be that zfs mount(/unmount?) doesn't work correctly inside alternative mount namespaces.

@ryao
Copy link
Contributor

ryao commented Apr 19, 2012

This would require doing #434 first. Then some of the code for making ZFS work in Solaris Zones could probably be used here.

@behlendorf
Copy link
Contributor

This should work in the current code, alternate namespaces are now supported.

@behlendorf behlendorf removed this from the 0.7.0 milestone Oct 6, 2014
behlendorf pushed a commit to behlendorf/zfs that referenced this issue May 21, 2018
Update copy-builtin so it may be run multiple times against
the kernel source tree.  This change makes sed more discriminating
to ensure spl/ only occurs once in core-y.

Signed-off-by: Chip Parker <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#526
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants