All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@kernel.org>
To: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Cc: "Pali Rohár" <pali@kernel.org>,
	"Chuck Lever" <chuck.lever@oracle.com>,
	linux-nfs@vger.kernel.org
Subject: [PATCH] nfs: add dummy definition for nfsd_file
Date: Wed, 26 Mar 2025 11:09:00 -0400	[thread overview]
Message-ID: <Z-QYjLJk8_ttf-kW@kernel.org> (raw)
In-Reply-To: <e2ec5e8d-a004-42b7-81ad-05edb1365224@oss.qualcomm.com>

Add dummy definition for nfsd_file in both nfslocalio.c and localio.c
so older gcc (e.g. EL8's 8.5.0) can be used.  Older gcc causes RCU
code (rcu_dereference and rcu_access_pointer) to dereference what
should just be an opaque pointer with its use of typeof.

So without the dummy definition compiling with older gcc fails.

Link: https://lore.kernel.org/all/Zsyhco1OrOI_uSbd@kernel.org/
Fixes: 55a9742d02eff ("nfs: cache all open LOCALIO nfsd_file(s) in client")
Signed-off-by: Mike Snitzer <snitzer@hammerspace.com>
---
 fs/nfs/localio.c           | 8 ++++++++
 fs/nfs_common/nfslocalio.c | 8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/fs/nfs/localio.c b/fs/nfs/localio.c
index 5c21caeae075..830078e5866b 100644
--- a/fs/nfs/localio.c
+++ b/fs/nfs/localio.c
@@ -46,6 +46,14 @@ struct nfs_local_fsync_ctx {
 	struct completion	*done;
 };
 
+/*
+ * nfsd_file structure is purposely kept opaque to NFS client.
+ * This is a dummy definition to make RCU compilation happy.
+ */
+struct nfsd_file {
+	int undefined__;
+};
+
 static bool localio_enabled __read_mostly = true;
 module_param(localio_enabled, bool, 0644);
 
diff --git a/fs/nfs_common/nfslocalio.c b/fs/nfs_common/nfslocalio.c
index 6a0bdea6d644..f3274a70ce5e 100644
--- a/fs/nfs_common/nfslocalio.c
+++ b/fs/nfs_common/nfslocalio.c
@@ -271,6 +271,14 @@ struct nfsd_file *nfs_open_local_fh(nfs_uuid_t *uuid,
 }
 EXPORT_SYMBOL_GPL(nfs_open_local_fh);
 
+/*
+ * nfsd_file structure is purposely kept opaque to NFS client.
+ * This is a dummy definition to make RCU compilation happy.
+ */
+struct nfsd_file {
+	int undefined__;
+};
+
 void nfs_close_local_fh(struct nfs_file_localio *nfl)
 {
 	struct nfsd_file *ro_nf = NULL;
-- 
2.44.0


  reply	other threads:[~2025-03-26 15:09 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-15 12:00 nfs compile error nfslocalio.o and localio.o since v6.14-rc1 Pali Rohár
2025-02-15 16:29 ` Chuck Lever
2025-02-15 16:38   ` Pali Rohár
2025-02-15 16:41     ` Chuck Lever
2025-02-15 16:51       ` Pali Rohár
2025-02-23 18:27         ` Pali Rohár
2025-03-18 19:05           ` Pali Rohár
2025-03-25 18:25             ` Jeff Johnson
2025-03-26 15:09               ` Mike Snitzer [this message]
2025-03-26 15:33                 ` [PATCH] nfs: add dummy definition for nfsd_file Jeff Johnson
2025-03-26 20:59                   ` Pali Rohár
2025-03-27  2:00                     ` Mike Snitzer
2025-03-27  8:28                       ` Pali Rohár
2025-03-27 20:17                         ` Mike Snitzer
2025-04-09 12:17                 ` [PATCH] " Vincent Mailhol
2025-04-10  2:09                   ` [PATCH v2] " Mike Snitzer
2025-04-16  2:41                     ` Vincent Mailhol
2025-04-16 13:31                       ` Chuck Lever
2025-04-18 21:34                         ` Mike Snitzer
2025-04-19 17:52                           ` Chuck Lever
2025-04-20 16:12                             ` Mike Snitzer
2025-04-22 20:16                               ` Pali Rohár
2025-04-22 21:54                                 ` NeilBrown
2025-04-22 22:02                                   ` Pali Rohár
2025-04-23  0:32                                     ` NeilBrown
2025-04-23  6:47                                       ` Vincent Mailhol
2025-04-23  8:45                                       ` Vincent Mailhol
2025-04-23  9:09                                         ` NeilBrown
2025-04-23 10:03                                           ` Vincent Mailhol
2025-04-24 16:04                                           ` Mike Snitzer
2025-05-04  9:07                                     ` Pali Rohár
2025-05-07  2:29                                       ` NeilBrown
2025-04-23 14:59                                   ` Chuck Lever
2025-04-21 11:52                     ` Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z-QYjLJk8_ttf-kW@kernel.org \
    --to=snitzer@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=jeff.johnson@oss.qualcomm.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=pali@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.