Skip to content

Commit e31c53a

Browse files
Darrick J. Wongcmaiolino
authored andcommitted
xfs: remove file_path tracepoint data
The xfile/xmbuf shmem file descriptions are no longer as detailed as they were when online fsck was first merged, because moving to static strings in commit 6038299 ("xfs: get rid of the xchk_xfile_*_descr calls") removed a memory allocation and hence a source of failure. However this makes encoding the description in the tracepoints sort of a waste of memory. David Laight also points out that file_path doesn't zero the whole buffer which causes exposure of stale trace bytes, and Steven Rostedt wonders why we're not using a dynamic array for the file path. I don't think this is worth fixing, so let's just rip it out. Cc: [email protected] Cc: [email protected] Link: https://lore.kernel.org/linux-xfs/[email protected]/ Cc: [email protected] # v6.11 Fixes: 19ebc8f ("xfs: fix file_path handling in tracepoints") Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Carlos Maiolino <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Carlos Maiolino <[email protected]>
1 parent 70685c2 commit e31c53a

2 files changed

Lines changed: 4 additions & 19 deletions

File tree

fs/xfs/scrub/trace.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -972,20 +972,12 @@ TRACE_EVENT(xfile_create,
972972
TP_STRUCT__entry(
973973
__field(dev_t, dev)
974974
__field(unsigned long, ino)
975-
__array(char, pathname, MAXNAMELEN)
976975
),
977976
TP_fast_assign(
978-
char *path;
979-
980977
__entry->ino = file_inode(xf->file)->i_ino;
981-
path = file_path(xf->file, __entry->pathname, MAXNAMELEN);
982-
if (IS_ERR(path))
983-
strncpy(__entry->pathname, "(unknown)",
984-
sizeof(__entry->pathname));
985978
),
986-
TP_printk("xfino 0x%lx path '%s'",
987-
__entry->ino,
988-
__entry->pathname)
979+
TP_printk("xfino 0x%lx",
980+
__entry->ino)
989981
);
990982

991983
TRACE_EVENT(xfile_destroy,

fs/xfs/xfs_trace.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5119,23 +5119,16 @@ TRACE_EVENT(xmbuf_create,
51195119
TP_STRUCT__entry(
51205120
__field(dev_t, dev)
51215121
__field(unsigned long, ino)
5122-
__array(char, pathname, MAXNAMELEN)
51235122
),
51245123
TP_fast_assign(
5125-
char *path;
51265124
struct file *file = btp->bt_file;
51275125

51285126
__entry->dev = btp->bt_mount->m_super->s_dev;
51295127
__entry->ino = file_inode(file)->i_ino;
5130-
path = file_path(file, __entry->pathname, MAXNAMELEN);
5131-
if (IS_ERR(path))
5132-
strncpy(__entry->pathname, "(unknown)",
5133-
sizeof(__entry->pathname));
51345128
),
5135-
TP_printk("dev %d:%d xmino 0x%lx path '%s'",
5129+
TP_printk("dev %d:%d xmino 0x%lx",
51365130
MAJOR(__entry->dev), MINOR(__entry->dev),
5137-
__entry->ino,
5138-
__entry->pathname)
5131+
__entry->ino)
51395132
);
51405133

51415134
TRACE_EVENT(xmbuf_free,

0 commit comments

Comments
 (0)