A brief description of the problem. Should include what you were
attempting to do, what you did, what happened and what you expected to
see happen.
Steps to reproduce
Create a ZFS filesystem with nested datasets, e.g.: tank/datastore and tank/datastore/media
Configure permissions appropriately, for a simple test chmod +w /tank/datastore and chown 100000:100000 /tank/datastore/media
Mount the parent dataset in LXD using the disk device:
datastore:
path: /datastore
source: /tank/datastore
type: disk
Check container has (write) access to the /datastore/media directory
Restart the host OS (or otherwise cause a zpool export/import)
Observe that after host restart, the container is no longer able to write inside the nested mount. It is also unable to see any files that were inside it. From the host, all looks normal, nested mount exists correctly. Looks like the container only sees the empty dir that exists in the parent (owned by host UID 0), not the mounted nested dataset.
Going through a zfs umount tank/datastore/media followed by zfs mount tank/datastore/media cycle seems to fix it, until next reboot.
Try setting propagation: rprivate or propagation: rshared in the disk config, which results in the following errors:
lxc foo 20220215174844.422 ERROR utils - utils.c:safe_mount:1218 - Invalid argument - Failed to mount "/var/snap/lxd/common/lxd/devices/foo/disk.datastore.datastore" onto "/var/snap/lxd/common/lxc//datastore"
lxc foo 20220215174844.422 ERROR conf - conf.c:mount_entry:2406 - Invalid argument - Failed to mount "/var/snap/lxd/common/lxd/devices/foo/disk.datastore.datastore" on "/var/snap/lxd/common/lxc//datastore"
lxc foo 20220215174844.422 ERROR conf - conf.c:lxc_setup:4370 - Failed to setup mount entries
lxc foo 20220215174844.422 ERROR start - start.c:do_start:1275 - Failed to setup container "foo"
lxc foo 20220215174844.422 ERROR sync - sync.c:sync_wait:34 - An error occurred in another process (expected sequence number 3)
lxc foo 20220215174844.426 WARN network - network.c:lxc_delete_network_priv:3617 - Failed to rename interface with index 0 from "eth0" to its initial name "veth9f8ba29b"
lxc foo 20220215174844.426 ERROR start - start.c:__lxc_start:2074 - Failed to spawn container "foo"
lxc foo 20220215174844.426 ERROR lxccontainer - lxccontainer.c:wait_on_daemonized_start:877 - Received container state "ABORTING" instead of "RUNNING"
lxc foo 20220215174844.426 WARN start - start.c:lxc_abort:1039 - No such process - Failed to send SIGKILL via pidfd 17 for process 12360
lxc foo 20220215174849.612 WARN conf - conf.c:lxc_map_ids:3588 - newuidmap binary is missing
lxc foo 20220215174849.612 WARN conf - conf.c:lxc_map_ids:3594 - newgidmap binary is missing
lxc 20220215174849.638 ERROR af_unix - af_unix.c:lxc_abstract_unix_recv_fds_iov:218 - Connection reset by peer - Failed to receive response
lxc 20220215174849.639 ERROR commands - commands.c:lxc_cmd_rsp_recv_fds:127 - Failed to receive file descriptors for command "get_state"
Information to attach
[ ] Any relevant kernel output (dmesg)
[x] Container log (lxc info NAME --show-log) shown in STR above
[x] Container configuration (lxc config show NAME --expanded)
Required information
Click to expand
Issue description
A brief description of the problem. Should include what you were attempting to do, what you did, what happened and what you expected to see happen.
Steps to reproduce
tank/datastore
andtank/datastore/media
chmod +w /tank/datastore
andchown 100000:100000 /tank/datastore/media
disk
device:/datastore/media
directoryzfs umount tank/datastore/media
followed byzfs mount tank/datastore/media
cycle seems to fix it, until next reboot.propagation: rprivate
orpropagation: rshared
in the disk config, which results in the following errors:Information to attach
dmesg
)lxc info NAME --show-log
) shown in STR abovelxc config show NAME --expanded
)lxc monitor
while reproducing the issue)