]> Git Repo - linux.git/commitdiff
netfs: Fix the netfs_folio tracepoint to handle NULL mapping
authorDavid Howells <[email protected]>
Mon, 30 Sep 2024 11:59:16 +0000 (12:59 +0100)
committerChristian Brauner <[email protected]>
Mon, 30 Sep 2024 12:11:05 +0000 (14:11 +0200)
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")
Signed-off-by: David Howells <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
cc: Jeff Layton <[email protected]>
cc: [email protected]
cc: [email protected]
Signed-off-by: Christian Brauner <[email protected]>
include/trace/events/netfs.h

index 76bd42a968155d0ad1fabcc0505319b0ffde5700..1d7c52821e5505e263019b8b8596d9993253d323 100644 (file)
@@ -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);
This page took 0.053563 seconds and 4 git commands to generate.