Skip to content

storage/file: treat EOPNOTSUPP as absent xattr on Linux#95

Merged
jpugliesi merged 1 commit into
mainfrom
claude/ecs-overlayfs-xattr-fix-5b0k99
Jun 10, 2026
Merged

storage/file: treat EOPNOTSUPP as absent xattr on Linux#95
jpugliesi merged 1 commit into
mainfrom
claude/ecs-overlayfs-xattr-fix-5b0k99

Conversation

@jpugliesi

Copy link
Copy Markdown
Contributor

Problem

The file backend stores object metadata (cache-control, content-type, content-encoding, etag, and the JSON metadata blob) in POSIX extended attributes. readObjectInfo reads those xattrs on HeadObject, GetObject, CopyObject, etc.

On Linux, filesystems that do not support extended attributes at all — overlayfs layers, some tmpfs configurations, and various container/network filesystems — return EOPNOTSUPP for every xattr read rather than ENODATA.

isErrAttrNotExist only recognized ENODATA, so on those filesystems any read that touched readObjectInfo failed outright instead of falling back to the stat-derived size/mtime. The result is that perfectly readable objects appear to error.

Fix

Treat EOPNOTSUPP the same as a missing attribute. When the filesystem reports xattrs are unsupported, there are simply no xattrs to read, so the metadata is reconstructed from stat and the operation succeeds.

func isErrAttrNotExist(err error) bool {
    return errors.Is(err, unix.ENODATA) || errors.Is(err, unix.EOPNOTSUPP)
}

This is Linux-only; the Darwin path (ENOATTR) is unchanged.

Test

Adds a table test for isErrAttrNotExist covering ENODATA, EOPNOTSUPP (including a wrapped error), ENOENT (not attr-not-exist), and nil.

https://claude.ai/code/session_01NsxHZETwk4uc88QWZNdeX1


Generated by Claude Code

readObjectInfo reads object metadata from extended attributes. On
filesystems that do not support xattrs at all — overlayfs layers, some
tmpfs configurations, and various container/network filesystems — the
kernel returns EOPNOTSUPP for every xattr read instead of ENODATA.

Previously isErrAttrNotExist only recognized ENODATA, so on those
filesystems HeadObject/GetObject failed outright instead of falling back
to stat-derived metadata. Treat EOPNOTSUPP the same as a missing
attribute so reads succeed with metadata reconstructed from stat.

Add a table test covering ENODATA, EOPNOTSUPP (including wrapped),
ENOENT, and nil.
@jpugliesi jpugliesi merged commit df2cdf5 into main Jun 10, 2026
3 checks passed
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