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

Container Bind Mounts: Snaphots: Too many levels of symbolic links #9479

Closed
spacerunner5 opened this issue Oct 18, 2019 · 3 comments
Closed
Labels
Bot: Not Stale Override for the stale bot Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@spacerunner5
Copy link

spacerunner5 commented Oct 18, 2019

System information

Type Version/Name
Distribution Name gentoo
Distribution Version
Linux Kernel 5.3.6
Architecture x84_64
ZFS Version 0.8 177c79d @ master
SPL Version 0.8 177c79d @ master

Describe the problem you're observing

The content of snapshot-Directories in bind-mounted datasets within LXC containers can not be accessed. Within a container:

container1 /zfsmountds/.zfs/snapshot # cd autosnap_2019-10-18_11:01:23_daily
-bash: cd: autosnap_2019-10-18_11:01:23_daily: Too many levels of symbolic links

While this might not affect all zfs users, it can be a dealbreaker for some use cases. For example, using Samba for windows shadow copies relies on accessible snapshots. However, they cannot be provided within a linux container. Both LXC and DOCKER should be affected, as seen in comment for #4514

Describe how to reproduce the problem

Bind-mount a zfs dataset to a container. Within LXC for example at the container config file using

lxc.mount.entry=/storage/zfsds1 /storage/container1/rootfs/zfsmountds1 zfs bind 0 0

  • launch the container
  • cd into the .zfs/snapshot directory
  • try to cd into a snapshot directory.

What happens:

  1. As soon as trying to enter the actual snapshot directory, a mount is issued on the container host:

tank/zfsds1@autosnap_2019-10-18_11:01:23_daily on /storage/zfsds1/.zfs/snapshot/autosnap_2019-10-18_11:01:23_daily type zfs (ro,relatime,xattr,noacl)

  1. The snapshot directory cannot be accessed within the container. The Error Too many levels of symbolic links is thrown.

additional Notes

I cannot verify if the problem is LXC (container) or ZFS related, or a mixture of both. It would be great to have some hints on the topic, so at least some documentation can be added.

@allaboutmikey
Copy link

allaboutmikey commented Nov 15, 2019

I have also observed this using debian/ubuntu LXC containers on a proxmox host. Same error as OP.
Interestingly, if you issue an "ls" on the directory in question on the host machine, you can then access it on the container. Seems there are two levels of mounting and one isn't triggering the other? Does ZFS have some sort of automount going on that only brings the snapshot online when actually viewed?
We are using a scheduled "find" command on the host to keep the snapshots available for samba Windows shadow copies (as OP mentioned above) on the container.

@jibel
Copy link
Contributor

jibel commented Feb 6, 2020

I added a simple test case to #9958 which excludes containers.

@behlendorf behlendorf added the Type: Defect Incorrect behavior (e.g. crash, hang) label Dec 16, 2020
@stale
Copy link

stale bot commented Dec 17, 2021

This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale No recent activity for issue label Dec 17, 2021
@stale stale bot closed this as completed Mar 17, 2022
@behlendorf behlendorf added Bot: Not Stale Override for the stale bot and removed Status: Stale No recent activity for issue labels Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bot: Not Stale Override for the stale bot Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

No branches or pull requests

4 participants