Skip to content

feat: add NameLen field to StatFs response and update related tests#335

Open
egalvis27 wants to merge 1 commit intofeat/go-fuse-daemonfrom
fix/rename-operation
Open

feat: add NameLen field to StatFs response and update related tests#335
egalvis27 wants to merge 1 commit intofeat/go-fuse-daemonfrom
fix/rename-operation

Conversation

@egalvis27
Copy link
Copy Markdown

Fix: File name is too long error when renaming files or folders

Problem

Nautilus (and other file managers) were showing "File name is too long" for any
rename attempt — even a single character — inside the Internxt virtual drive.

Root Cause

The StatFs FUSE operation never populated the NameLen / f_namelen field in the
filesystem statistics. This caused the mount to report a maximum filename length of
0 bytes. File managers call statvfs() before validating a rename; with
f_namelen = 0 every name is considered too long.

Fix

Return the standard Linux NAME_MAX value (255) in the nameLen field across
the full stack:

  • statfs.service.ts — added nameLen: NAME_MAX (255) to StatFsResult and
    to the value returned by statfs().
  • responses.go — added NameLen uint32 field to StatFsCallbackData so the
    Go daemon can deserialize the value from Electron.
  • operations.go — set NameLen: response.NameLen in the fuse.StatfsOut
    returned to the kernel.

Tests updated

  • statfs.service.test.ts — expected result now includes nameLen: 255.
  • statfs.controller.test.ts — test fixture updated with nameLen: 255.
  • operations_test.go — mock response includes nameLen and asserts
    stat.Namelen == 255.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 8, 2026

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