From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f68.google.com (mail-oa1-f68.google.com [209.85.160.68]) (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 322913DFC74 for ; Fri, 10 Apr 2026 15:23:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.68 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775834616; cv=none; b=hsIX88vBriMJ+zKcSX+5u1UqeC1ZHqYcILxfrAciSgDRJTDSV3J0uItRkLMhOyuBHVmjstoA2TPuGhAekRycltDZSrNUaZWAQEDztzWxfmuDSujlwyvxDMgGw2p4PPuTIZE/KaNtIf56/qQLvGSPCyHa2SxMrnfKeY4BpxkvYlM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775834616; c=relaxed/simple; bh=CX/afSL3JndHOadfCDz6NirV/Ipq9GJ1Gx/oudX9N1Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=okNVAYdWnbDA391lLcZmilaZbWa5TBMHQEnANBnzesfKAJIu/qPuGqUpfAOL0w0T8aC1R7Ewe4LlDwbJab9FPu07Qo9iQv0TqduMM+AIQ+/Wvsd0zWtaOvOgyfaWf9BUjv68h/3CVI4YN70+xSEd713IijHLdmE4FbUy/hUHi+E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hammerspace.com; spf=pass smtp.mailfrom=hammerspace.com; dkim=pass (2048-bit key) header.d=hammerspace.com header.i=@hammerspace.com header.b=JqpLazwN; arc=none smtp.client-ip=209.85.160.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hammerspace.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hammerspace.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=hammerspace.com header.i=@hammerspace.com header.b="JqpLazwN" Received: by mail-oa1-f68.google.com with SMTP id 586e51a60fabf-40f0e14b9f9so1401810fac.1 for ; Fri, 10 Apr 2026 08:23:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hammerspace.com; s=google; t=1775834614; x=1776439414; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=fIc2HwqWPzjUPuL2nhb2eQ8tXBlv10wG3oq+cPrw4L4=; b=JqpLazwNKIPmEjk150Sn726iocN/UzH2Bqyv/VdIYp6/AKqQ8mKQWpPgQvWVebgAqG ETJ+OR8Fy/Kc6TgdtbE8zvlb5cdyqySq01M9kmSg1SvqVTliGX0tyVd9o6oVIQ2kP6+u BazFIVM+Re/Jotjcq0zwCsmcOXDlnibokzksPDgUNv0j7E69u1TZkxYodaInM+DmTUSA UAbaasFKvuf9aYzFeFfBd7OjS8KXVjnew6FSkjUrBwIFJg22OoJPFR/2TqCAFDPvvidx WlRCbOocn94LrTEEdjJnJnMdHBEmF/Ay7s+O+kOmbjytVk8ACl4J6ob/u1p3vutCWu2T GcDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775834614; x=1776439414; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fIc2HwqWPzjUPuL2nhb2eQ8tXBlv10wG3oq+cPrw4L4=; b=VpAqxTPMc4ndqP1IDfA/apn81aIeeUpWljdOyubStYH8ifgeYWiKRvk0d38UAA0OCP cevJq8KnUZmEc9raadTP7QXfVBr0ghK4jE9vQbfW0IlPTBQAZx3i+IZoT3U1Q7LRh1Zh vOzBMU6vg7bs7chOWLts/gw11/w5NglmlvPBSZ0kgKSB8gNY35rkK1h7ip6z4g97VGZG 3HPPGTV/feIUpB07wjbugpRiwtPWDnt5DRwXCm7MIPMEVMWPhNXHkwQWLKEQYmOYp75n 2ZO0V8Jd4MfUJ5v7i4GplXdmD/xFLdpZdeL0hTSI0GIHflZtifTvpE8KB2KfWR9pT7BA o92Q== X-Forwarded-Encrypted: i=1; AJvYcCXQPiBvcwFIz7ZN5ZKQeAGSLj0LO/Gvot4FYN1pyKMGeu05/tEVYmwbGNI0pv03DfxMJnfXLVgY1tEn11Y=@vger.kernel.org X-Gm-Message-State: AOJu0YzCASZqMFDokmodDL81f0pOxEy7+0HQQOfgYrVyquyJUnWvtSgH 84VoOtotg5ObPp8vLllp6fkZS2Xez6RKIdYmP/GSb+x+iaWuOdwWJeqJW0Fft78gLG4= X-Gm-Gg: AeBDieu8N00UGXtnWelOg4jEloserpwIpaLoGMf7R/M6VgXs4ndAzYycXvu7oulXORt A/+fg7B7/6rzMf+zVOFdcmwX0qJn/Ibf6LQxdPVA/1SGA5BY2o6Es9phn1J9wnjdg8CKfq00Wat lcy8mAvogC6CitMn2Mx8r+hOL1ELVlO3pm4XEiYPDQ/0SKpGJ8sqxGGq7kEef11kMtTqUUoVI8J Hi/Q9YsJeXBHFz1B35DFYYc3z0kiu3caQirKFbj3pTtFu5Udu64XKxf6ssfheKrm47ow27cAA/6 FvYISUjZXZA6TdzO8w6Hynk/dvFAA+f8yeEuYgBPRSliopyOzAd1HOEYPwRRHDQTYUE0t72Es07 rVV2UMKOFTJfXIful4e4w/J+YlQQCdaGLW8/fN25HMSz6kATVTVvv4eQWOlLNgrXtOTe+mMtMEj E7DcXkB4sNKCmh/VqbDmdrhujmKdSHAQ9lMphvuZimlFI= X-Received: by 2002:a05:6870:2417:b0:41c:890d:d776 with SMTP id 586e51a60fabf-423e0e6f333mr1927283fac.7.1775834613958; Fri, 10 Apr 2026 08:23:33 -0700 (PDT) Received: from [192.168.254.51] ([66.97.168.37]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-423ddb23a9asm2398566fac.10.2026.04.10.08.23.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2026 08:23:33 -0700 (PDT) From: Benjamin Coddington X-Google-Original-From: Benjamin Coddington To: Sean Chang Cc: trondmy@kernel.org, anna@kernel.org, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Jeff Layton Subject: Re: [PATCH v1 2/2] NFS: use unsigned long for req field in nfs_page_class Date: Fri, 10 Apr 2026 11:23:31 -0400 X-Mailer: MailMate (2.0r6272) Message-ID: In-Reply-To: <20260408161428.155169-3-seanwascoding@gmail.com> References: <20260408161428.155169-1-seanwascoding@gmail.com> <20260408161428.155169-3-seanwascoding@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Hi Sean, On 8 Apr 2026, at 12:14, Sean Chang wrote: > The nfs_page_class tracepoint used a pointer for the req field. This > caused Sparse to complain about dereferencing a pointer marked as > __private within the trace ring buffer context. > > Change the field type to unsigned long to store the address of the > request without dereferencing it. Update TP_printk to use 0x%lx for > consistent hexadecimal output, allowing for unique identification of > requests across the trace log. Probably we don't want to bypass the %p formatting because some configurations use it to obfuscate kernel pointers. I think in this context the __private annotation is incorrect. We deref the nfs_page pointer only in TP_fast_assign() which runs at the call site, and the TP_printk only outputs the pointer value. cc: Jeff Ben > > Signed-off-by: Sean Chang > --- > fs/nfs/nfstrace.h | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/fs/nfs/nfstrace.h b/fs/nfs/nfstrace.h > index 9f9ce4a565ea..4150bbd99cfa 100644 > --- a/fs/nfs/nfstrace.h > +++ b/fs/nfs/nfstrace.h > @@ -1496,7 +1496,7 @@ DECLARE_EVENT_CLASS(nfs_page_class, > __field(dev_t, dev) > __field(u32, fhandle) > __field(u64, fileid) > - __field(const struct nfs_page *__private, req) > + __field(unsigned long, req) > __field(loff_t, offset) > __field(unsigned int, count) > __field(unsigned long, flags) > @@ -1509,14 +1509,14 @@ DECLARE_EVENT_CLASS(nfs_page_class, > __entry->dev = inode->i_sb->s_dev; > __entry->fileid = nfsi->fileid; > __entry->fhandle = nfs_fhandle_hash(&nfsi->fh); > - __entry->req = req; > + __entry->req = (unsigned long)req; > __entry->offset = req_offset(req); > __entry->count = req->wb_bytes; > __entry->flags = req->wb_flags; > ), > > TP_printk( > - "fileid=%02x:%02x:%llu fhandle=0x%08x req=%p offset=%lld count=%u flags=%s", > + "fileid=%02x:%02x:%llu fhandle=0x%08x req=0x%lx offset=%lld count=%u flags=%s", > MAJOR(__entry->dev), MINOR(__entry->dev), > (unsigned long long)__entry->fileid, __entry->fhandle, > __entry->req, __entry->offset, __entry->count, > -- > 2.34.1