Skip to content

chmod/chown on a directory returns ENOTSUP: persist mode/uid/gid on the marker object #588

Open

Description

@scttfrdmn

Split out of #165 by #567. #165 implemented Setattr and POSIX attribute persistence for files and was closed as completed. The directory half was never done, and README's contract table plus the refusal's own log line went on citing #165 for it.

Current behaviour

chmod/chown on a directory returns ENOTSUP (DirectoryNode.Setattr, internal/fuse/attributes.go). A time-only change is accepted as a no-op, deliberately, so tar -x, cp -a and rsync -a don't error on every directory.

The refusal is the honest answer today. Mkdir writes a zero-byte marker object that could carry mode/uid/gid metadata, but DirectoryNode.Getattr doesn't read it back. Accepting the call would report a mode that the next stat contradicts.

What implementing it would take

  1. Getattr on a directory reads the marker object's metadata when the marker exists.
  2. Setattr writes mode/uid/gid to the marker.
  3. Decide what happens for a prefix-only directory, i.e. one that exists only because objects share a prefix and has no marker. The options are to create a marker on first chmod (a write the user didn't explicitly ask for, but the only way to persist the change) or to keep refusing for those directories only. Either way the behaviour must be visible in stat afterwards. That's the property the current refusal protects, and it must not become "succeeds for some directories, silently ignored for others".
  4. Differential test in internal/difftest: chmod a directory, stat it, and compare against the local filesystem, for both a marker directory and a prefix-only one.

Not urgent

The current ENOTSUP is correct and documented. This is a capability gap, not a defect.

Activity

  1. added
    type: enhancement
    priority: low
    area: fuse
    area: metadata
    effort: medium
    on Oct 6, 2026
  2. scttfrdmn commented on Oct 6, 2026

    @scttfrdmn
    OwnerAuthor

    Directory xattrs (#589) share this issue's marker-object design question and should get the same answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: fusearea: metadataeffort: mediumpriority: lowtype: enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions