diff mbox series

[v2] nfs: add dummy definition for nfsd_file

Message ID Z_coQbSdvMWD92IA@kernel.org (mailing list archive)
State Handled Elsewhere
Headers show
Series [v2] nfs: add dummy definition for nfsd_file | expand

Commit Message

Mike Snitzer April 10, 2025, 2:09 a.m. UTC
Add dummy definition for nfsd_file in both nfslocalio.c and localio.c
so various compilers (e.g. gcc 8.5.0 and 9.5.0) can be used. Otherwise
RCU code (rcu_dereference and rcu_access_pointer) will dereference
what should just be an opaque pointer (by using typeof(*ptr)).

Fixes: 86e00412254a ("nfs: cache all open LOCALIO nfsd_file(s) in client")
Cc: stable@vger.kernel.org
Tested-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Tested-by: Pali Rohár <pali@kernel.org>
Tested-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
---
 fs/nfs/localio.c           | 8 ++++++++
 fs/nfs_common/nfslocalio.c | 8 ++++++++
 2 files changed, 16 insertions(+)

v2: fix email used in S-o-B, added 3 Tested-by:s and adjust commit header.

Comments

Vincent Mailhol April 16, 2025, 2:41 a.m. UTC | #1
+CC: Neil Brown
+CC: Olga Kornievskaia
+CC: Dai Ngo
+CC: Tom Talpey
+CC: Trond Myklebust
+CC: Anna Schumaker

(just to make sure that anyone listed in

  ./scripts/get_maintainer.pl fs/nfs_common/nfslocalio.c

get copied).

Here is the link to the full thread:

  https://lore.kernel.org/all/Z_coQbSdvMWD92IA@kernel.org/


On 10/04/2025 at 11:09, Mike Snitzer:
> Add dummy definition for nfsd_file in both nfslocalio.c and localio.c
> so various compilers (e.g. gcc 8.5.0 and 9.5.0) can be used. Otherwise
> RCU code (rcu_dereference and rcu_access_pointer) will dereference
> what should just be an opaque pointer (by using typeof(*ptr)).
> 
> Fixes: 86e00412254a ("nfs: cache all open LOCALIO nfsd_file(s) in client")
> Cc: stable@vger.kernel.org
> Tested-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
> Tested-by: Pali Rohár <pali@kernel.org>
> Tested-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
> Signed-off-by: Mike Snitzer <snitzer@kernel.org>

Hi everyone,

The build has been broken for several weeks already. Does anyone have
intention to pick-up this patch?

(please ignore if someone already picked it up and if it is already on
its way to Linus's tree).

Thank you,


Yours sincerely,
Vincent Mailhol
Chuck Lever April 16, 2025, 1:31 p.m. UTC | #2
On 4/15/25 10:41 PM, Vincent Mailhol wrote:
> +CC: Neil Brown
> +CC: Olga Kornievskaia
> +CC: Dai Ngo
> +CC: Tom Talpey
> +CC: Trond Myklebust
> +CC: Anna Schumaker
> 
> (just to make sure that anyone listed in
> 
>   ./scripts/get_maintainer.pl fs/nfs_common/nfslocalio.c
> 
> get copied).
> 
> Here is the link to the full thread:
> 
>   https://lore.kernel.org/all/Z_coQbSdvMWD92IA@kernel.org/
> 
> 
> On 10/04/2025 at 11:09, Mike Snitzer:
>> Add dummy definition for nfsd_file in both nfslocalio.c and localio.c
>> so various compilers (e.g. gcc 8.5.0 and 9.5.0) can be used. Otherwise
>> RCU code (rcu_dereference and rcu_access_pointer) will dereference
>> what should just be an opaque pointer (by using typeof(*ptr)).
>>
>> Fixes: 86e00412254a ("nfs: cache all open LOCALIO nfsd_file(s) in client")
>> Cc: stable@vger.kernel.org
>> Tested-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
>> Tested-by: Pali Rohár <pali@kernel.org>
>> Tested-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
>> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
> 
> Hi everyone,
> 
> The build has been broken for several weeks already. Does anyone have
> intention to pick-up this patch?
> 
> (please ignore if someone already picked it up and if it is already on
> its way to Linus's tree).

I assumed that, like all LOCALIO-related changes, this fix would go
in through the NFS client tree. Let me know if it needs to go via NFSD.
Mike Snitzer April 18, 2025, 9:34 p.m. UTC | #3
On Wed, Apr 16, 2025 at 09:31:55AM -0400, Chuck Lever wrote:
> On 4/15/25 10:41 PM, Vincent Mailhol wrote:
> > +CC: Neil Brown
> > +CC: Olga Kornievskaia
> > +CC: Dai Ngo
> > +CC: Tom Talpey
> > +CC: Trond Myklebust
> > +CC: Anna Schumaker
> > 
> > (just to make sure that anyone listed in
> > 
> >   ./scripts/get_maintainer.pl fs/nfs_common/nfslocalio.c
> > 
> > get copied).
> > 
> > Here is the link to the full thread:
> > 
> >   https://lore.kernel.org/all/Z_coQbSdvMWD92IA@kernel.org/
> > 
> > 
> > On 10/04/2025 at 11:09, Mike Snitzer:
> >> Add dummy definition for nfsd_file in both nfslocalio.c and localio.c
> >> so various compilers (e.g. gcc 8.5.0 and 9.5.0) can be used. Otherwise
> >> RCU code (rcu_dereference and rcu_access_pointer) will dereference
> >> what should just be an opaque pointer (by using typeof(*ptr)).
> >>
> >> Fixes: 86e00412254a ("nfs: cache all open LOCALIO nfsd_file(s) in client")
> >> Cc: stable@vger.kernel.org
> >> Tested-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
> >> Tested-by: Pali Rohár <pali@kernel.org>
> >> Tested-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
> >> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
> > 
> > Hi everyone,
> > 
> > The build has been broken for several weeks already. Does anyone have
> > intention to pick-up this patch?
> > 
> > (please ignore if someone already picked it up and if it is already on
> > its way to Linus's tree).
> 
> I assumed that, like all LOCALIO-related changes, this fix would go
> in through the NFS client tree. Let me know if it needs to go via NFSD.

Since we haven't heard from Trond or Anna about it, I think you'd be
perfectly fine to pick it up.  It is a compiler fixup associated with
nfd_file being kept opaque to the client -- but given it is "struct
nfsd_file" that gives you full license to grab it (IMO).

I'm also unaware of any conflicting changes in the NFS client tree.
Chuck Lever April 19, 2025, 5:52 p.m. UTC | #4
On 4/18/25 5:34 PM, Mike Snitzer wrote:
> On Wed, Apr 16, 2025 at 09:31:55AM -0400, Chuck Lever wrote:
>> On 4/15/25 10:41 PM, Vincent Mailhol wrote:
>>> +CC: Neil Brown
>>> +CC: Olga Kornievskaia
>>> +CC: Dai Ngo
>>> +CC: Tom Talpey
>>> +CC: Trond Myklebust
>>> +CC: Anna Schumaker
>>>
>>> (just to make sure that anyone listed in
>>>
>>>   ./scripts/get_maintainer.pl fs/nfs_common/nfslocalio.c
>>>
>>> get copied).
>>>
>>> Here is the link to the full thread:
>>>
>>>   https://lore.kernel.org/all/Z_coQbSdvMWD92IA@kernel.org/
>>>
>>>
>>> On 10/04/2025 at 11:09, Mike Snitzer:
>>>> Add dummy definition for nfsd_file in both nfslocalio.c and localio.c
>>>> so various compilers (e.g. gcc 8.5.0 and 9.5.0) can be used. Otherwise
>>>> RCU code (rcu_dereference and rcu_access_pointer) will dereference
>>>> what should just be an opaque pointer (by using typeof(*ptr)).
>>>>
>>>> Fixes: 86e00412254a ("nfs: cache all open LOCALIO nfsd_file(s) in client")
>>>> Cc: stable@vger.kernel.org
>>>> Tested-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
>>>> Tested-by: Pali Rohár <pali@kernel.org>
>>>> Tested-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
>>>> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
>>>
>>> Hi everyone,
>>>
>>> The build has been broken for several weeks already. Does anyone have
>>> intention to pick-up this patch?
>>>
>>> (please ignore if someone already picked it up and if it is already on
>>> its way to Linus's tree).
>>
>> I assumed that, like all LOCALIO-related changes, this fix would go
>> in through the NFS client tree. Let me know if it needs to go via NFSD.
> 
> Since we haven't heard from Trond or Anna about it, I think you'd be
> perfectly fine to pick it up.  It is a compiler fixup associated with
> nfd_file being kept opaque to the client -- but given it is "struct
> nfsd_file" that gives you full license to grab it (IMO).
> 
> I'm also unaware of any conflicting changes in the NFS client tree.

Hi Mike -

I just looked at this one again. The patch's diffstat is:

 fs/nfs/localio.c           | 8 ++++++++
 fs/nfs_common/nfslocalio.c | 8 ++++++++

Although fs/nfs_common/ is part of both trees, fs/nfs/localio.c is
definitely a client file. I'm still happy to pick it up, but technically
I would need an Acked-by: from one of the NFS client maintainers.

My impression is that Trond is managing the NFS client pulls for v6.15.
diff mbox series

Patch

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;