Skip to content

Commit

Permalink
erofs: fix up erofs_lookup tracepoint
Browse files Browse the repository at this point in the history
Fix up a misuse that the filename pointer isn't always valid in
the ring buffer, and we should copy the content instead.

Link: https://lore.kernel.org/r/[email protected]
Fixes: 13f06f4 ("staging: erofs: support tracepoint")
Cc: [email protected] # 4.19+
Reviewed-by: Chao Yu <[email protected]>
Signed-off-by: Gao Xiang <[email protected]>
  • Loading branch information
hsiangkao committed Sep 23, 2021
1 parent e4e737b commit 93368aa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/trace/events/erofs.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@ TRACE_EVENT(erofs_lookup,
TP_STRUCT__entry(
__field(dev_t, dev )
__field(erofs_nid_t, nid )
__field(const char *, name )
__string(name, dentry->d_name.name )
__field(unsigned int, flags )
),

TP_fast_assign(
__entry->dev = dir->i_sb->s_dev;
__entry->nid = EROFS_I(dir)->nid;
__entry->name = dentry->d_name.name;
__assign_str(name, dentry->d_name.name);
__entry->flags = flags;
),

TP_printk("dev = (%d,%d), pnid = %llu, name:%s, flags:%x",
show_dev_nid(__entry),
__entry->name,
__get_str(name),
__entry->flags)
);

Expand Down

0 comments on commit 93368aa

Please sign in to comment.