Skip to contentSkip to conversation

netfs: Fix the netfs_folio tracepoint to handle NULL mapping

PATCH Applied David Howells 2 participants 2 messages Sep 30, 2024

Subsystems (3)
lore
Share & tools
lore

David Howells

author maintainer
#0 lore raw

PATCH 1/1 netfs: Fix the netfs_folio tracepoint to handle NULL mapping

Fix the netfs_folio tracepoint to handle folios that have a NULL mapping pointer. In such a case, just substitute a zero inode number.

Fixes c38f4e96e605 ("netfs: Provide func to copy data to pagecache for buffered write")
cc Jeff Layton <[email protected]>
---
 include/trace/events/netfs.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/trace/events/netfs.h +2 -1
index 76bd42a96815..1d7c52821e55 100644
@@ -448,7 +448,8 @@ TRACE_EVENT(netfs_folio,
 			     ),
 
 	    TP_fast_assign(
-		    __entry->ino = folio->mapping->host->i_ino;
+		    struct address_space *__m = READ_ONCE(folio->mapping);
+		    __entry->ino = __m ? __m->host->i_ino : 0;
 		    __entry->why = why;
 		    __entry->index = folio_index(folio);
 		    __entry->nr = folio_nr_pages(folio);
maintainer Applied
#1 lore raw
Quoted 4 lines · David Howells

Fix the netfs_folio tracepoint to handle folios that have a NULL mapping pointer. In such a case, just substitute a zero inode number.

Applied to the vfs.fixes branch of the vfs/vfs.git tree. Patches in the vfs.fixes branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes

[1/1] netfs: Fix the netfs_folio tracepoint to handle NULL mapping

      https://git.kernel.org/vfs/vfs/c/f801850bc263