storage/file: treat EOPNOTSUPP as absent xattr on Linux#95
Merged
Conversation
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.
achille-roussel
approved these changes
Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The file backend stores object metadata (cache-control, content-type, content-encoding, etag, and the JSON metadata blob) in POSIX extended attributes.
readObjectInforeads those xattrs onHeadObject,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
EOPNOTSUPPfor every xattr read rather thanENODATA.isErrAttrNotExistonly recognizedENODATA, so on those filesystems any read that touchedreadObjectInfofailed outright instead of falling back to the stat-derived size/mtime. The result is that perfectly readable objects appear to error.Fix
Treat
EOPNOTSUPPthe same as a missing attribute. When the filesystem reports xattrs are unsupported, there are simply no xattrs to read, so the metadata is reconstructed fromstatand the operation succeeds.This is Linux-only; the Darwin path (
ENOATTR) is unchanged.Test
Adds a table test for
isErrAttrNotExistcoveringENODATA,EOPNOTSUPP(including a wrapped error),ENOENT(not attr-not-exist), andnil.https://claude.ai/code/session_01NsxHZETwk4uc88QWZNdeX1
Generated by Claude Code