[PATCH v3 0/2] ocfs2: stabilize dentry names in file-operation trace events
From: Cen Zhang
Date: Mon Oct 19 2026 - 23:44:48 EST
All six users of ocfs2__file_ops pass a dentry name to its shared
__string field. A file reference keeps the dentry alive while rename
can still change the name being recorded.
Use name snapshots at all six call sites, as Joseph requested. The
first patch handles the five callers that take no inode spinlock
around their trace call. The second handles file release separately
to preserve its locked open-count sample while taking and releasing
the snapshot outside that critical section.
The patches are independent and leave the event class and trace format
unchanged.
Cen Zhang (2):
ocfs2: snapshot dentry names in file-operation traces
ocfs2: snapshot the dentry name while tracing file release
fs/ocfs2/file.c | 97 ++++++++++++++++++++++++++++++++++---------------
1 file changed, 68 insertions(+), 29 deletions(-)
---
Changes in v3:
- Cover all six ocfs2__file_ops call sites with two patches, grouping open,
fsync, read, write and splice-read and handling release separately.
- For release, keep the trace and open-count sample under oi->ip_lock while
taking and releasing the snapshot outside that lock; cache the
event-enabled check.
Changes in v2:
- Replace d_lock around the tracepoint with a dentry name snapshot so trace
callbacks run without the caller holding the dentry lock.
- Pass both the name and its length from the snapshot; keep the event
enabled check and release the snapshot after the trace call.
Link to v1: https://lore.kernel.org/r/pm-ocfs2-objects-candidate-0088-v3-d628f98bfcb6784a0bfb@xxxxxxxxx
Link to v2: https://lore.kernel.org/r/pm-ocfs2-objects-candidate-0088-v4-a9a0df898afb4fc65fa0@xxxxxxxxx