mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-05 00:07:48 -04:00
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 commit60382993a2("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: rostedt@goodmis.org Cc: david.laight.linux@gmail.com Link: https://lore.kernel.org/linux-xfs/20260323172204.work.979-kees@kernel.org/ Cc: stable@vger.kernel.org # v6.11 Fixes:19ebc8f84e("xfs: fix file_path handling in tracepoints") Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
committed by
Carlos Maiolino
parent
70685c291e
commit
e31c53a806
@@ -972,20 +972,12 @@ TRACE_EVENT(xfile_create,
|
||||
TP_STRUCT__entry(
|
||||
__field(dev_t, dev)
|
||||
__field(unsigned long, ino)
|
||||
__array(char, pathname, MAXNAMELEN)
|
||||
),
|
||||
TP_fast_assign(
|
||||
char *path;
|
||||
|
||||
__entry->ino = file_inode(xf->file)->i_ino;
|
||||
path = file_path(xf->file, __entry->pathname, MAXNAMELEN);
|
||||
if (IS_ERR(path))
|
||||
strncpy(__entry->pathname, "(unknown)",
|
||||
sizeof(__entry->pathname));
|
||||
),
|
||||
TP_printk("xfino 0x%lx path '%s'",
|
||||
__entry->ino,
|
||||
__entry->pathname)
|
||||
TP_printk("xfino 0x%lx",
|
||||
__entry->ino)
|
||||
);
|
||||
|
||||
TRACE_EVENT(xfile_destroy,
|
||||
|
||||
@@ -5119,23 +5119,16 @@ TRACE_EVENT(xmbuf_create,
|
||||
TP_STRUCT__entry(
|
||||
__field(dev_t, dev)
|
||||
__field(unsigned long, ino)
|
||||
__array(char, pathname, MAXNAMELEN)
|
||||
),
|
||||
TP_fast_assign(
|
||||
char *path;
|
||||
struct file *file = btp->bt_file;
|
||||
|
||||
__entry->dev = btp->bt_mount->m_super->s_dev;
|
||||
__entry->ino = file_inode(file)->i_ino;
|
||||
path = file_path(file, __entry->pathname, MAXNAMELEN);
|
||||
if (IS_ERR(path))
|
||||
strncpy(__entry->pathname, "(unknown)",
|
||||
sizeof(__entry->pathname));
|
||||
),
|
||||
TP_printk("dev %d:%d xmino 0x%lx path '%s'",
|
||||
TP_printk("dev %d:%d xmino 0x%lx",
|
||||
MAJOR(__entry->dev), MINOR(__entry->dev),
|
||||
__entry->ino,
|
||||
__entry->pathname)
|
||||
__entry->ino)
|
||||
);
|
||||
|
||||
TRACE_EVENT(xmbuf_free,
|
||||
|
||||
Reference in New Issue
Block a user