Repository navigation
Description
Summary
Implement the four extended-attribute operations — GetXattr, SetXattr, ListXattr,
RemoveXattr — on the capability layer built for Setattr (#165).
Background
All four are declared in internal/filesystem/interface.go and implemented only by a test
mock. Neither FUSE build wires them up.
This matters more than it might appear on a research-computing filesystem: macOS stores
Finder metadata in xattrs, Linux tooling uses user.* attributes, and rsync -X, tar --xattrs, and SELinux labeling all depend on them. Without xattrs those tools either fail or
silently drop metadata.
Storage follows #165: object annotations where available (mutable in place, up to 1000 per
object, 1 MiB each — a good fit for xattrs), x-amz-meta- keys otherwise. The metadata
fallback is considerably more constrained, which shapes the acceptance criteria below.
Implementation
Reuse the #165 capability layer rather than re-detecting. Namespace stored keys so xattrs
cannot collide with the POSIX attribute keys (objectfs-mode, objectfs-uid, …) or with
objectfs-sha256.
Constraints that must be handled explicitly rather than discovered in production:
- Total metadata size limit. All S3 user metadata for an object must fit within 2 KB.
Exceeding it fails the PUT. ReturnENOSPC(orE2BIG) rather than a generic error. - Header-safe encoding. xattr values are arbitrary bytes; metadata values are HTTP header
values. Base64-encode on the metadata path. - Case insensitivity. S3 metadata keys are case-insensitive and normalized to lowercase,
souser.Fooanduser.foocollide on the fallback path but not on annotations. Encode the
original case in the stored key. - Rewrite cost. On the metadata path, every
SetXattris aCopyObjectonto itself. This
is why annotations are the preferred path.
Return ENOATTR for a missing attribute — not ENOENT, which callers interpret as a missing
file.
Acceptance Criteria
-
setfattr -n user.test -v hello fthengetfattr -n user.test freturnshello -
getfattr -d flists all attributes -
setfattr -x user.test fremoves one - Attributes survive an unmount/remount cycle
- A missing attribute returns
ENOATTR, notENOENT - Binary values round-trip byte-for-byte
-
user.Fooanduser.fooremain distinct on both storage paths - Exceeding the metadata size limit returns a size error, not a generic failure
- xattr keys cannot collide with
objectfs-*internal metadata keys - Verified on both paths: real AWS (annotations) and a non-AWS S3-compatible endpoint (metadata)
-
go test -race ./internal/fuse/... ./internal/storage/s3/...passes -
AWS_PROFILE=aws AWS_REGION=us-west-2 go test -race -tags=integration ./internal/fuse/...passes
Dependencies
Blocked on #165 — builds directly on its annotation-vs-metadata capability layer.
Activity
scttfrdmn commentedon Jul 30, 2026
Correction: annotations require an SDK bump this repo has not taken
The annotations-as-accelerator design depends on API operations that do not exist in the pinned SDK. This is a hard prerequisite, not a detail.
Version gate.
go.mod:10pinsgithub.com/aws/aws-sdk-go-v2/service/s3 v1.88.4. Listing that module directory for annotation operations returns nothing. The operations first appear in v1.104.0:So the annotations path cannot be written at all until
service/s3moves from v1.88.4 to >= v1.104.0, which pulls the coreaws-sdk-go-v2andsmithy-goforward with it.MVS compatibility risk. CargoShip v0.13.0 pins
service/s3 v1.82.0andaws-sdk-go-v2 v1.41.0([email protected]/go.mod). Minimal version selection will resolve to our higher version, so it should build — but CargoShip is compiled against the olders3.Clientsurface, and this needs an actualgo build ./...plus the CargoShip-path tests to confirm, not an assumption. Verify before committing to the annotations design.Semantic defect in the conditional-write plan. The issue proposes
x-amz-object-if-matchfor safe concurrent attribute updates. Per the SDK:It matches the parent object's ETag, not the annotation's. Two concurrent
chmods against an unmodified object therefore both present the same valid ETag and both succeed — last writer wins, silently. Annotations give no compare-and-swap on the annotation value itself. If atomic attribute updates are a requirement, annotations alone cannot provide them; that needs a separate mechanism and should be designed explicitly rather than assumed.Payload constraint. Annotation values must be valid UTF-8; non-UTF-8 bytes are rejected with HTTP 415. This matters for #167 (xattrs) in particular, where
setfattrvalues are arbitrary binary. Base64-encode xattr values on the annotations path, or the metadata fallback will be the only correct path for binary xattrs.Suggested adjustment
service/s3-> >= v1.104.0, core -> v1.42.x, smithy-go -> v1.27.x) with a CargoShip build/test check as its acceptance criterion, and make this issue depend on it.scttfrdmn commentedon Aug 9, 2026
Scoping notes before implementation — two premises in this issue do not match the tree.
1. The storage design says annotations; the code already decided against them. This issue says "object annotations where available ...
x-amz-meta-keys otherwise", and #165's closing comment lists the annotation capability layer as "Not started". Butinternal/vfs/attr.go:170records the opposite decision, deliberately:Nothing in the repo implements annotations — grep for "annotation" outside
internal/awsratesreturns only that comment. So xattrs are being implemented over object metadata, consistent with howobjectfs-mode/objectfs-uid/objectfs-gid/objectfs-mtimeare already persisted, and no annotation path or probe for one is being built.2. The cited declaration site is a dead design sketch. This issue says the four methods are "declared in
internal/filesystem/interface.goand implemented only by a test mock". That is accurate but misleading as a place to implement: the package's own doc comment says it has no importers anywhere in the tree, that its only implementation is its own test mock, and — verbatim — "Do not infer support from this file." It also records that this interface advertising Symlink and Link with nothing behind them "is precisely what went wrong in v0.10.0." The live path isinternal/fuse→internal/vfs→pkg/types.Backend, so that is where the work goes.3. An existing test asserts these operations fail, and it has to change with them.
internal/fuse/unimplemented_test.godrives go-fuse's raw bridge directly and pins setxattr/removexattr at ENOATTR. Its header explains why that matters: the README errno table documented a dependency's defaults and a guess about one of them (rename → ENOSYS vs the actual ENOTSUP) was wrong in a way no build or lint could catch. That file, the README operations table, and the implementation move together — "a row asserting an operation fails is as wrong as a row asserting the wrong errno once the operation works."Also being handled explicitly rather than discovered later: the 2 KB total user-metadata budget is shared with the POSIX attribute keys already stored, so the xattr budget is 2 KB minus those; S3 lower-cases metadata keys in transit, so
user.Foo/user.foocollide unless the original case is encoded; and a user settinguser.objectfs-modemust not be able to reach the file's real POSIX mode.fix(fuse): answer both-xattr-flags per platform, and clamp the size cast
test: ratchet internal/fuse's coverage floor to CI's measurement, 67 …
feat(vfs,fuse): extended attributes, stored in S3 user metadata (#167) (
fix(docs): the Not-implemented table and its refusals cite open issue…