Skip to content

Commit

Permalink
netfs: Fix the netfs_folio tracepoint to handle NULL mapping
Browse files Browse the repository at this point in the history
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 <dhowells@redhat.com>
Link: https://lore.kernel.org/r/2917423.1727697556@warthog.procyon.org.uk
cc: Jeff Layton <jlayton@kernel.org>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
  • Loading branch information
David Howells authored and Christian Brauner committed Sep 30, 2024
1 parent 28e8c5c commit f801850
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/trace/events/netfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f801850

Please sign in to comment.