summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/bin/stackcollapse-report
diff options
context:
space:
mode:
authorOscar Ou <oscarou@synology.com>2026-07-03 14:38:56 +0800
committerChuck Lever <cel@kernel.org>2026-08-10 09:54:35 -0400
commit737e9ac7faa46ba4cc1ccd294780d84b03beff95 (patch)
tree847b7416477184b3035293e93ec604b203ec47cf /tools/perf/scripts/python/bin/stackcollapse-report
parente1d6e968ee26eee9654e35cd8141e38cefe307a4 (diff)
lockd: preserve multiple NLM_SHARE grants from the same owner
When an NFSv3/NLM client issues multiple NLM_SHARE calls from a single host for the same (file, owner) tuple, the current implementation overwrites the recorded access and deny modes with the latest pair. A subsequent NLM_UNSHARE then drops the entire entry, even if other grants were implicitly subsumed by the most recent SHARE. This is particularly visible to Windows-style clients that map each open of a file to a distinct NLM_SHARE, all carrying the same NLM owner handle. For example: 1. SHARE(access=RW, deny=W) -> entry [RW, deny W] 2. SHARE(access=R, deny=N) -> entry [R, deny N] (RW/W overwritten) 3. UNSHARE(access=R, deny=N) -> entry freed 4. UNSHARE(access=RW, deny=W) -> nothing to release NLM has no duplicate reply cache, so both SHARE and UNSHARE handlers must be idempotent under UDP retransmit. Track each (access, deny) pair with a single bit in a u16 bitmap. fsh_access and fsh_mode are each in {0..3}, so there are 16 possible pairs; index = (access << 2) | deny. SHARE sets the bit, UNSHARE clears it, both via idempotent bit operations. s_access and s_mode are recomputed as the union of the (access, deny) values whose bit is set, and the entry is freed once s_access_deny_bmap reaches zero. NLM_UNSHARE gains the access and deny modes as arguments so the correct bit can be cleared. The two callers in svcproc.c and svc4proc.c are updated to forward the decoded values. Signed-off-by: Oscar Ou <oscarou@synology.com> Link: https://patch.msgid.link/20260703063856.2423734-1-oscarou@synology.com Signed-off-by: Chuck Lever <cel@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-report')
0 files changed, 0 insertions, 0 deletions