]> www.infradead.org Git - users/jedix/linux-maple.git/commit
nfs: pass explicit offset/count to trace events
authorChristoph Hellwig <hch@lst.de>
Thu, 11 Jul 2024 07:17:02 +0000 (09:17 +0200)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 17 Jul 2024 17:15:35 +0000 (13:15 -0400)
commitfada32ed6dbc748f447c8d050a961b75d946055a
tree14c49571a5db26af0fb4ad12e9648868578360c4
parent39c910a430370fd25d5b5e4b2f4b24581a705499
nfs: pass explicit offset/count to trace events

nfs_folio_length is unsafe to use without having the folio locked and a
check for a NULL ->f_mapping that protects against truncations and can
lead to kernel crashes.  E.g. when running xfstests generic/065 with
all nfs trace points enabled.

Follow the model of the XFS trace points and pass in an explŃ–cit offset
and length.  This has the additional benefit that these values can
be more accurate as some of the users touch partial folio ranges.

Fixes: eb5654b3b89d ("NFS: Enable tracing of nfs_invalidate_folio() and nfs_launder_folio()")
Reported-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/file.c
fs/nfs/nfstrace.h
fs/nfs/read.c
fs/nfs/write.c