binpash / try

Inspect a command's effects before modifying your live system
MIT License
5.18k stars 66 forks source link

Failure in Merging Directories Located Under the Same OverlayFS Mountpoint #123

Open gliargovas opened 11 months ago

gliargovas commented 11 months ago

When attempting to merge two directories residing under the same overlayfs mountpoint within try, the operation fails, rendering the common directory unmountable within try.

Error Reproduction:

$ ./try -D sandbox1 "echo foo > file.txt"
...
$ ./try -L sandbox1 "cat file.txt"
...
try(/tmp/tmp.VwOWiakeQW): Warning: Failed mounting /users as an overlay and mergerfs or unionfs not set and could not be found, see "/tmp/tmp.B3jpnj64oq"
/tmp/tmp.LyCvWjVjEY: 7: cd: can't cd to /users/gliargko/try

Error log displays:

mount: /tmp/tmp.NSMc55yqg2/temproot/users: mount(2) system call failed: Too many levels of symbolic links.

dmesg output:

[ 2107.018994] overlayfs: fs on 'sandbox1/upperdir/users' does not support file handles, falling back to xino=off.
[ 2107.019006] overlayfs: overlapping lowerdir path

Installing mergerfs solves the issue.

ezrizhu commented 11 months ago

Linking in https://github.com/torvalds/linux/blob/401644852d0b2a278811de38081be23f74b5bb04/fs/overlayfs/super.c#L1226