From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1B412D5A01 for ; Sun, 19 Apr 2026 16:31:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776616307; cv=none; b=pdI+FLNudTsIhpm6fGnPsXHNdFVzyFGZoXRfX3ljS/CyOWQHploPB6+Sk6siR41e50ScI2S5zHl0+mRhj1dYh9MuLWQICgi2mcOO2scHFl8FtrM5mkGyGGA0oo/ZL5uHIm1aPQybi0xQbiuGxx6mpfSP2Hep6WBhoqkXZyAmdDw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776616307; c=relaxed/simple; bh=K9aG0GkuRPtI9qykUJU9LEUVRNU2MyLh6kudgjsxmok=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IOOSuXKiEhuT9s8hugVB1Lu0PBVnSCnyZdly6tukeDjsBYX39uue/BH5JPLFVA6yO0D8PfxD6TVbmaE/3ZdmE0xCG+4SR0qz1c9oQFF5fIeQpxMgvvgMHsHkgYqmYpCuReGQazMtHzn2fpLyXbNMse0ufF+xCPHza5w1wmVSlkE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=rIRMvujm; arc=none smtp.client-ip=209.85.216.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rIRMvujm" Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-35fc258aaa4so1305770a91.2 for ; Sun, 19 Apr 2026 09:31:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776616304; x=1777221104; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Dk/Wp1KdQIFnzpWc0d2XsrP6Fi/zl8G2FZCTBjOxsA8=; b=rIRMvujmHtAonjAQnZVSu/4ry12nXIFjIqTMHcodq87AUEEZJqJi2W7fs7l7yNSLh6 7Y7MXit6weT0lQKWNQGAbHePBHNjL/pFk7XUHrrOaM2VN5eWoIyjvpd8aRpMJTNfUkd7 VVkp3GdPa1Nra2dZ7tB/nQzPMw8GDzoUPmCQawl5lZRnoBCDC6uRCrslpBQVFhL1ypwo zs8u6AhpctmRVOGz0fBX5Nl0WFJ/0XuxSsslqvho+TpMTebZUO4UkGDwDdg/Yl+h2tM/ grLnZ9zV7t6WIwuPX3m94lAyFurBbACYT53ctE1RamNaHYBqdsVax7wwdo7IRxHoOBcB l04A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776616304; x=1777221104; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Dk/Wp1KdQIFnzpWc0d2XsrP6Fi/zl8G2FZCTBjOxsA8=; b=LvC3sdOlSOO3blsDBy6NFoAABu1Vl+Jkx8SO5sOjvjk5+18ejtgPeCeDlDWhtJFpsX HfDGr0CLglvMaotU1esGUZuXd3YpfDoHgfJ6+7l+Fo+GZtYxu8F2pYvPAJqICQbwyldq 5Np7nMcECx2Mxu0C/wwgJRsdnqg4JMaOm58hFuxSVyFeUa1Z4019z65X12ymiHF3Upkm Fc7sU7JEfmUU90j5fOBZ5ogmyXiPQhUHEBrocpwDL1cTF0EQp0chTEF51tIkzPPOHFsZ sasWgZZliqgv8fjS6HehQ1pq+oO75BOXppmmpGlLyxqpawmNm+tSorNEZQb2vwPeiOdo 6IHw== X-Forwarded-Encrypted: i=1; AFNElJ+w6JF0wzU27JJUHKqZlYxJuby1h4ycyPgaO1L8rOID0o9q9r+vhEo4SQL/KBwzEyrmlJrENeH00Rxacf4=@vger.kernel.org X-Gm-Message-State: AOJu0YwPBjg33FCum1brn34apLQKnCInm1zKSJldX2BUs0V/zJIrtFLO nXNQwfCt11dnvTh4Oj8/VHVGIwUYiho55bEb6dJcnzaIsG1Uc71W6tuOf2nvCw== X-Gm-Gg: AeBDieualFRKYUO63eSqPyOIILfyc2pk0TwTb/MmJThpnlNZ2lGxNv7ZxqWjwMxnGGj EJqqcCziuSWIJhtxd1YO9XC8gEIMbXR2l8yX3EDZPEJjv6/LCvA2+Prw2eRjq4FRnA35CQ2a7jL bW0rO5yN/JNZVKSo8qg0ULmnCtEaMUIJmVAb9sfUshyH9SYecbPZdB4cK6CebY+lIQrED41aZqh jea6tLXaGdLS+o1Xk5EIFyVtVA3gP8Jw3BCdBYQ99eBI6CJbuo/Bl4W+qCCM6eHl6fDu/wQ30pL 5K3IbFzXWMn4B9NGjetiWprUzBRnZ185JvPB43/MGy0iefP3aphZ4Anz1ccq+XeOudVjNALw5vc gybAIX9S0EXJ8OtF7+ssUp51Vqro028OpyuiAkVb8ObyiSxrk+K48kL0A5dRXOFUSx3fP4UNDvm aQEbzsqqLvkJt7wLK1Mrv9DO7dtTYaAo8eo8p//ohkscwepmDXQs0fSG5FvdzpOedmcgWSPXv2x 0g1NfEuDjL47zVhyfK0LIuVD0ksow== X-Received: by 2002:a17:90a:e7ca:b0:35d:8fdb:4f36 with SMTP id 98e67ed59e1d1-3614048a21bmr10856704a91.18.1776616304105; Sun, 19 Apr 2026 09:31:44 -0700 (PDT) Received: from localhost.localdomain (1-160-233-238.dynamic-ip.hinet.net. [1.160.233.238]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-361417748aesm7814196a91.0.2026.04.19.09.31.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 09:31:43 -0700 (PDT) From: Sean Chang To: Benjamin Coddington Cc: Jeff Layton , trondmy@kernel.org, anna@kernel.org, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Sean Chang Subject: [PATCH v3 0/2] NFS: fix RCU and tracing pointer safety Date: Mon, 20 Apr 2026 00:31:36 +0800 Message-ID: <20260419163138.26963-1-seanwascoding@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. v3: - Patch 2: Removed the redundant XPRT_CONNECTED and pointer existence checks as suggested by Benjamin Coddington. Since the comparison is performed while holding sb_lock, the transport's existence is guaranteed, and its connection state does not affect the server's identity. 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 | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) -- 2.43.0