Skip to content

fix(fs): return correct Stat Name for .by/<col>/ and .filter/<col>/#50

Merged
mfreed merged 1 commit into
mainfrom
fix/by-capability-stat-name
May 28, 2026
Merged

fix(fs): return correct Stat Name for .by/<col>/ and .filter/<col>/#50
mfreed merged 1 commit into
mainfrom
fix/by-capability-stat-name

Conversation

@mfreed
Copy link
Copy Markdown
Member

@mfreed mfreed commented May 28, 2026

Stat on .log/.by/user_id/ (and any other .{by,filter,order}// path) returned Entry.Name = the capability dir (e.g. "by") instead of the leaf segment. macOS NFS validates that GETATTR/LOOKUP response names match the request path's leaf and rejects mismatches as SYSTEM_ERR, which the kernel surfaces as "fts_read: RPC struct is bad" (EBADRPC). On Linux FUSE the name field isn't validated against the request, so the bug was invisible there.

The PathTable case in statWithParsed already had this basename correction, with a comment explaining the NFS requirement. The PathCapability case below it didn't. Mirror the correction so PathCapability also returns the leaf name when CapabilityArg is set.

Tests cover the previously-broken paths (.by//, .filter//), the regression case (.by/ root with empty CapabilityArg, where the capability dir name IS the leaf and must still be returned), and the specific empty-readdir scenario flagged on macOS NFS (an all-NULL column, since GetDistinctValues filters NULL, the listing is empty which must succeed cleanly rather than error).

Stat on .log/.by/user_id/ (and any other .{by,filter,order}/<col>/
path) returned Entry.Name = the capability dir (e.g. "by") instead of
the leaf segment. macOS NFS validates that GETATTR/LOOKUP response
names match the request path's leaf and rejects mismatches as
SYSTEM_ERR, which the kernel surfaces as "fts_read: RPC struct is bad"
(EBADRPC). On Linux FUSE the name field isn't validated against the
request, so the bug was invisible there.

The PathTable case in statWithParsed already had this basename
correction, with a comment explaining the NFS requirement. The
PathCapability case below it didn't. Mirror the correction so
PathCapability also returns the leaf name when CapabilityArg is set.

Tests cover the previously-broken paths (.by/<col>/, .filter/<col>/),
the regression case (.by/ root with empty CapabilityArg, where the
capability dir name IS the leaf and must still be returned), and the
specific empty-readdir scenario flagged on macOS NFS (an all-NULL
column, since GetDistinctValues filters NULL, the listing is empty
which must succeed cleanly rather than error).
@mfreed mfreed merged commit d5fa43f into main May 28, 2026
3 checks passed
@mfreed mfreed deleted the fix/by-capability-stat-name branch May 28, 2026 14:11
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.

1 participant