Skip to content

Conversation

@Ioa1
Copy link
Contributor

@Ioa1 Ioa1 commented Sep 5, 2025

Resolved "upper fs does not support file handles, falling back to index=off" and " fs on 'tmp' does not support file handles, falling back to xino=off"

@ezrizhu
Copy link
Member

ezrizhu commented Sep 6, 2025

       index={on|off}
           Inode index. If this feature is disabled and a file with
           multiple hard links is copied up, then this will "break" the
           link. Changes will not be propagated to other names referring
           to the same inode.
       xino={on|off|auto}
           The "xino" feature composes a unique object identifier from
           the real object st_ino and an underlying fsid index. The
           "xino" feature uses the high inode number bits for fsid,
           because the underlying filesystems rarely use the high inode
           number bits. In case the underlying inode number does overflow
           into the high xino bits, overlay filesystem will fall back to
           the non xino behavior for that inode.

           For a detailed description of the effect of this option please
           refer to https://docs.kernel.org/filesystems/overlayfs.html

looking at the docs for xino, I am curious to see what would now break when it's set to off. However, from the looks of it, both seems quite useful(?) I am not sure if we should disable them.

Copy link
Contributor

@mgree mgree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can turn index off, but we need to dig a little more for xino.

try Outdated
lowerdirs="$2"
overlay_mountpoint="$3"
mount -t overlay overlay -o userxattr -o "lowerdir=$lowerdirs,upperdir=$sandbox_dir/upperdir/$overlay_mountpoint,workdir=$sandbox_dir/workdir/$overlay_mountpoint" "$sandbox_dir/temproot/$overlay_mountpoint"
mount -t overlay overlay -o userxattr -o "lowerdir=$lowerdirs,upperdir=$sandbox_dir/upperdir/$overlay_mountpoint,workdir=$sandbox_dir/workdir/$overlay_mountpoint,index=off,xino=off" "$sandbox_dir/temproot/$overlay_mountpoint"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

index is being disabled automatically for our upper, so it's safe to turn that off. xino should only be turned off when we know pre-emptively that it's going to fail... can we identify the fs types that's true for, and only disable it for those overlays?

Copy link
Contributor

@mgree mgree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a bad start!

  1. Would be good to have a more thorough enumeration of which fs types work without a merger.
  2. The fs_fail_flag logic doesn't seem right to me.

try
mountpoint="$1"
fstype=$(stat -f -c %T "$mountpoint")
if [[ "$fstype" = "msdos" || "$fstype" = "exfat" || "$fstype" = "hfs" || "$fstype" = "hfs+" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[[ ... ]] is a bashism. but also, if COND; then return 1; fi return 0 is really just ! COND. To save on processes, we probably want:

Suggested change
if [[ "$fstype" = "msdos" || "$fstype" = "exfat" || "$fstype" = "hfs" || "$fstype" = "hfs+" ]]; then
case "$fstype" in
(msdos|exfat|hfs|hfs+) returrn 1;;
(*) return 0;;
esac

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an exhaustive list? Can we not do it for ext3/4?

try
mount -t overlay overlay -o userxattr -o "lowerdir=$lowerdirs,upperdir=$sandbox_dir/upperdir/$overlay_mountpoint,workdir=$sandbox_dir/workdir/$overlay_mountpoint,index=off" "$sandbox_dir/temproot/$overlay_mountpoint"
}
check_fstype() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
check_fstype() {
mountable_without_mergerfs() {

try
fs_fail_flag=0
if check_fstype "$pure_mountpoint"; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if check_fstype "$pure_mountpoint"; then
if ! mountable_without_mergerfs "$pure_mountpoint"
then
needs_mergerfs=1
fi

And then... we ought to break out early. If any mount requires a mergerfs, we should give up early and just use mergerfs. Right?

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

Successfully merging this pull request may close these issues.

3 participants