summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorGael Blivet <gael.blivet@gmail.com>2026-07-10 08:38:14 +0900
committerNamjae Jeon <linkinjeon@kernel.org>2026-08-17 15:00:41 +0900
commit9dfb2813839d3c7458cf954f76f6a9cbe18007ce (patch)
treea5c9e64a6d05b91c1958e86425c4b0c7a559f82d /tools/perf/scripts/python/stackcollapse.py
parenteaff8e924f6094bb53291982dc4131e9ccca2232 (diff)
ksmbd: send inline FinderInfo in FIND responses when READDIR_ATTR negotiated
Without READDIR_ATTR, macOS Finder resolves type/creator/icon for every file in a directory listing by opening its AFP_AfpInfo stream individually -- one extra CREATE+QUERY_INFO+CLOSE round trip per file, which is the dominant cost of browsing a large directory over SMB from a Mac. When the client negotiates READDIR_ATTR (conn->aapl_readdir_attr, set during CREATE's AAPL context exchange), inline the same information directly into each FILEID_BOTH_DIRECTORY_INFORMATION FIND entry: EaSize = max_access, expanded specific rights (GENERIC_ALL_FLAGS), not the raw FILE_GENERIC_ALL_LE "generic" meta-bit -- that bit has none of the specific FILE_* rights macOS's smbfs.kext checks bit-by-bit, so reporting it directly would fail every access check and show Finder's "no entry" badge on every file/folder. ShortNameLength = 24 (fixed; the spec says 0 when there's no short name; kept for wire parity with reference server, see below) ShortName[0..7] = resource fork size (0 -- no resource forks) ShortName[8..23] = compressed FinderInfo (all zero: type/creator unset, client falls back to extension-based icon/type detection, consistent with the AFP_AfpInfo synthesis this mirrors) Reserved2 = Unix mode bits Reparse-point status is still carried via ExtFileAttributes rather than EaSize once READDIR_ATTR is active, since EaSize is repurposed for max_access. Reverse-engineered from macOS smbfs.kext network behavior and cross-checked against reference implementation marshalling (reference implementation behavior). Also confirmed against AAPL's published public client behavior (public client behavior reference) -- every field here matches exactly, except ShortNameLength=24: real V1 clients read but never examine that field, so it's kept for wire parity with reference server, not because macOS requires it. Assisted-by: Claude:claude-sonnet-5 Signed-off-by: Gael Blivet <gael.blivet@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions