Skip to content

Commit f801850

Browse files
dhowellsbrauner
authored andcommitted
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: c38f4e9 ("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]>
1 parent 28e8c5c commit f801850

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/trace/events/netfs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,8 @@ TRACE_EVENT(netfs_folio,
448448
),
449449

450450
TP_fast_assign(
451-
__entry->ino = folio->mapping->host->i_ino;
451+
struct address_space *__m = READ_ONCE(folio->mapping);
452+
__entry->ino = __m ? __m->host->i_ino : 0;
452453
__entry->why = why;
453454
__entry->index = folio_index(folio);
454455
__entry->nr = folio_nr_pages(folio);

0 commit comments

Comments
 (0)