public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] NFS: fix RCU and tracing pointer safety
@ 2026-04-19 10:01 Sean Chang
  2026-04-19 10:01 ` [PATCH v2 1/2] NFS: remove redundant __private attribute from nfs_page_class Sean Chang
  2026-04-19 10:01 ` [PATCH v2 2/2] NFS: Fix RCU dereference of cl_xprt in nfs_compare_super_address Sean Chang
  0 siblings, 2 replies; 6+ messages in thread
From: Sean Chang @ 2026-04-19 10:01 UTC (permalink / raw)
  To: Benjamin Coddington
  Cc: Jeff Layton, trondmy, anna, linux-nfs, linux-kernel, Sean Chang

This series addresses two Sparse static analysis warnings in the NFS
client related to RCU safety and pointer attributes.

The first patch resolves a "dereferencing noderef expression" warning 
within the nfs_page_class tracepoint by removing a redundant __private 
attribute that was causing Sparse to complain during trace-buffer 
assignments.

The second patch fixes an RCU-unsafe dereference in nfs_compare_super_address.
It wraps cl_xprt access with rcu_read_lock() and rcu_dereference(). 
Following reviewer feedback, the RCU critical section is kept minimal, 
covering only the transport and network namespace checks. An additional 
check for XPRT_CONNECTED is included to ensure the transport is logically 
active during the comparison.

v2:
  - Patch 1: Instead of changing the 'req' field type to unsigned long (as in v1),
    simply remove the redundant __private attribute. This resolves the
    Sparse warning while preserving the original pointer type.
  - Patch 2: Reduced RCU read-side critical section scope to cover only
    the necessary transport/net-ns checks, as suggested by reviewers.

Sean Chang (2):
  NFS: remove redundant __private attribute from nfs_page_class
  NFS: Fix RCU dereference of cl_xprt in nfs_compare_super_address

 fs/nfs/nfstrace.h |  2 +-
 fs/nfs/super.c    | 21 ++++++++++++++++++---
 2 files changed, 19 insertions(+), 4 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-04-19 16:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-19 10:01 [PATCH v2 0/2] NFS: fix RCU and tracing pointer safety Sean Chang
2026-04-19 10:01 ` [PATCH v2 1/2] NFS: remove redundant __private attribute from nfs_page_class Sean Chang
2026-04-19 13:42   ` Benjamin Coddington
2026-04-19 10:01 ` [PATCH v2 2/2] NFS: Fix RCU dereference of cl_xprt in nfs_compare_super_address Sean Chang
2026-04-19 13:52   ` Benjamin Coddington
2026-04-19 16:06     ` Sean Chang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox