I’ve been running a development environment in an Ubuntu 18.04 container, sharing a directory on my host with it. I have noticed that edits on either side aren’t always kept in sync (even for prolonged durations), which of course can create chaotic scenarios. Leaving and restarting the container causes the sync to happen from the looks of it.
My container config is:
shared-dir:
path: /srv/web/my-project
shift: "true"
source: /home/adrian/code/my-project
type: disk
Alas, I need write capability on both sides so a read-only mount is not an option. Has anyone observed similar issues?
There was a VFS cache issue in the kernel code which I believe @brauner has since corrected, this was causing not only issues like you described but also double counting of disk usage on zfs.
@brauner or @sforshee should be able to point to what kernel has the needed fixes.
The commit is in kernel 5.0.0-32.34 in disco-proposed.
Note though that making modifications to the “lower” filesystem while shiftfs is mounted over it is not supported. It might appear to be work sometimes, but you’ll likely run into problems sooner or later. This is the case with all “stacked” filesystems such as overlayfs.