Skip to contentSkip to conversation

FAILED: patch "[PATCH] xfs: remove file_path tracepoint data" failed to apply to 6.6-stable tree

PATCH New [email protected] 2 participants 2 messages Mar 30 – Aug 31

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x e31c53a8060e134111ed095783fee0aa0c43b080
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026033027-colonist-hybrid-82a4@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From e31c53a8060e134111ed095783fee0aa0c43b080 Mon Sep 17 00:00:00 2001
From: "Darrick J. Wong" <[email protected]>
Date: Mon, 23 Mar 2026 14:04:33 -0700
Subject: [PATCH] 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 60382993a2e180 ("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.

fs/xfs/scrub/trace.h +2 -10
index 39ea651cbb75..286c5f5e0544 100644
@@ -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,
fs/xfs/xfs_trace.h +2 -9
index 0e994b3f768f..5e8190fe2be9 100644
@@ -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,
#1 lore raw

PATCH 1/1 xfs: remove file_path tracepoint data

From: "Darrick J. Wong" <[email protected]>

[ Upstream commit e31c53a8060e134111ed095783fee0aa0c43b080 ]

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 60382993a2e180 ("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.

[ Karl Mehltretter: Omit the xmbuf_create hunk because that tracepoint
is not in 6.6.y. The xfile_create hunk applies unchanged. This drops dynamically generated descriptions because 60382993a2e1 is not in 6.6.y, but fixes the stale-byte exposure and matches newer stable kernels. ]

Assisted-by LLM

---
The xfile_create hunk applies unchanged. The xmbuf_create hunk is omitted because that tracepoint is not present in 6.6.y.

Tested on Linux 6.6.155 (a4a971135a2f):

- Built and booted arm64 and x86_64 kernels before and after the change.
- QEMU A/B tests reproduced stale trace bytes in xfile_create on both architectures and confirmed that they were gone after the change.
- Ran concurrent file operations and repeated realtime-summary scrubs with all xfs and xfs_scrub trace events enabled. There were no workload errors, XFS/trace warnings, oopses, or unmount problems.
- Built the affected XFS trace objects for 32-bit ARM using bcm2835_defconfig.

 fs/xfs/scrub/trace.h | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
fs/xfs/scrub/trace.h +2 -10
index b1e6879a07310..2634b28e6e616 100644
@@ -784,20 +784,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,
Signature · 1 line
2.39.5 (Apple Git-154)