Files
seaweedfs/weed/mount
Chris LuandGitHub 39e76b8e94 fix(mount): report correct nlink for directories (#9023)
fix(mount): report correct nlink for directories (2 + subdirectory count)

POSIX requires directory nlink = 2 (for . and ..) + number of
subdirectories. Previously SeaweedFS reported nlink=1 for all dirs.

- Set nlink baseline to 2 for directories in setAttrByPbEntry,
  setAttrByFilerEntry, and setRootAttr
- Add applyDirNlink() that counts subdirectories from the local
  metacache and sets nlink = 2 + count
- Call it from GetAttr and Lookup for directory entries

When the metacache has no entries (before readdir), nlink=2 is used
as a safe POSIX-compliant default.
2026-04-10 14:05:27 -07:00
..
2026-02-20 18:42:00 -08:00
2022-08-26 17:04:11 -07:00
2026-02-20 18:42:00 -08:00
2025-12-31 13:04:05 -08:00