public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfsd: fix legacy client tracking initialization
@ 2024-12-10 12:25 Scott Mayhew
  2024-12-10 15:01 ` cel
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Scott Mayhew @ 2024-12-10 12:25 UTC (permalink / raw)
  To: chuck.lever, jlayton; +Cc: jur, linux-nfs

Get rid of the nfsd4_legacy_tracking_ops->init() call in
check_for_legacy_methods().  That will be handled in the caller
(nfsd4_client_tracking_init()).  Otherwise, we'll wind up calling
nfsd4_legacy_tracking_ops->init() twice, and the second time we'll
trigger the BUG_ON() in nfsd4_init_recdir().

Fixes: 74fd48739d04 ("nfsd: new Kconfig option for legacy client tracking")
Reported-by: Jur van der Burg <jur@avtware.com>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=219580
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 fs/nfsd/nfs4recover.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index 4a765555bf84..1c8fcb04b3cd 100644
--- a/fs/nfsd/nfs4recover.c
+++ b/fs/nfsd/nfs4recover.c
@@ -2052,7 +2052,6 @@ static inline int check_for_legacy_methods(int status, struct net *net)
 		path_put(&path);
 		if (status)
 			return -ENOTDIR;
-		status = nn->client_tracking_ops->init(net);
 	}
 	return status;
 }
-- 
2.47.1


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

* Re: [PATCH] nfsd: fix legacy client tracking initialization
  2024-12-10 12:25 [PATCH] nfsd: fix legacy client tracking initialization Scott Mayhew
@ 2024-12-10 15:01 ` cel
  2024-12-10 15:02 ` Jeff Layton
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: cel @ 2024-12-10 15:01 UTC (permalink / raw)
  To: jlayton, Scott Mayhew; +Cc: Chuck Lever, jur, linux-nfs

From: Chuck Lever <chuck.lever@oracle.com>

On Tue, 10 Dec 2024 07:25:54 -0500, Scott Mayhew wrote:
> Get rid of the nfsd4_legacy_tracking_ops->init() call in
> check_for_legacy_methods().  That will be handled in the caller
> (nfsd4_client_tracking_init()).  Otherwise, we'll wind up calling
> nfsd4_legacy_tracking_ops->init() twice, and the second time we'll
> trigger the BUG_ON() in nfsd4_init_recdir().
> 
> 
> [...]

Applied to nfsd-testing for v6.14, thanks!

[1/1] nfsd: fix legacy client tracking initialization
      commit: 0f0f93d93be82021f30c23eeca6aaf8e59a276d0

--
Chuck Lever


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

* Re: [PATCH] nfsd: fix legacy client tracking initialization
  2024-12-10 12:25 [PATCH] nfsd: fix legacy client tracking initialization Scott Mayhew
  2024-12-10 15:01 ` cel
@ 2024-12-10 15:02 ` Jeff Layton
  2024-12-17 14:54 ` cel
  2024-12-28  6:53 ` Salvatore Bonaccorso
  3 siblings, 0 replies; 5+ messages in thread
From: Jeff Layton @ 2024-12-10 15:02 UTC (permalink / raw)
  To: Scott Mayhew, chuck.lever; +Cc: jur, linux-nfs

On Tue, 2024-12-10 at 07:25 -0500, Scott Mayhew wrote:
> Get rid of the nfsd4_legacy_tracking_ops->init() call in
> check_for_legacy_methods().  That will be handled in the caller
> (nfsd4_client_tracking_init()).  Otherwise, we'll wind up calling
> nfsd4_legacy_tracking_ops->init() twice, and the second time we'll
> trigger the BUG_ON() in nfsd4_init_recdir().
> 
> Fixes: 74fd48739d04 ("nfsd: new Kconfig option for legacy client tracking")
> Reported-by: Jur van der Burg <jur@avtware.com>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=219580
> Signed-off-by: Scott Mayhew <smayhew@redhat.com>
> ---
>  fs/nfsd/nfs4recover.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
> index 4a765555bf84..1c8fcb04b3cd 100644
> --- a/fs/nfsd/nfs4recover.c
> +++ b/fs/nfsd/nfs4recover.c
> @@ -2052,7 +2052,6 @@ static inline int check_for_legacy_methods(int status, struct net *net)
>  		path_put(&path);
>  		if (status)
>  			return -ENOTDIR;
> -		status = nn->client_tracking_ops->init(net);
>  	}
>  	return status;
>  }

Reviewed-by: Jeff Layton <jlayton@kernel.org>

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

* Re: [PATCH] nfsd: fix legacy client tracking initialization
  2024-12-10 12:25 [PATCH] nfsd: fix legacy client tracking initialization Scott Mayhew
  2024-12-10 15:01 ` cel
  2024-12-10 15:02 ` Jeff Layton
@ 2024-12-17 14:54 ` cel
  2024-12-28  6:53 ` Salvatore Bonaccorso
  3 siblings, 0 replies; 5+ messages in thread
From: cel @ 2024-12-17 14:54 UTC (permalink / raw)
  To: jlayton, Scott Mayhew; +Cc: Chuck Lever, jur, linux-nfs

From: Chuck Lever <chuck.lever@oracle.com>

On Tue, 10 Dec 2024 07:25:54 -0500, Scott Mayhew wrote:
> Get rid of the nfsd4_legacy_tracking_ops->init() call in
> check_for_legacy_methods().  That will be handled in the caller
> (nfsd4_client_tracking_init()).  Otherwise, we'll wind up calling
> nfsd4_legacy_tracking_ops->init() twice, and the second time we'll
> trigger the BUG_ON() in nfsd4_init_recdir().
> 
> 
> [...]

Applied to nfsd-testing for v6.14, thanks!

[1/1] nfsd: fix legacy client tracking initialization
      (no commit info)

--
Chuck Lever

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

* Re: [PATCH] nfsd: fix legacy client tracking initialization
  2024-12-10 12:25 [PATCH] nfsd: fix legacy client tracking initialization Scott Mayhew
                   ` (2 preceding siblings ...)
  2024-12-17 14:54 ` cel
@ 2024-12-28  6:53 ` Salvatore Bonaccorso
  3 siblings, 0 replies; 5+ messages in thread
From: Salvatore Bonaccorso @ 2024-12-28  6:53 UTC (permalink / raw)
  To: Scott Mayhew; +Cc: chuck.lever, jlayton, jur, linux-nfs

Hi,

On Tue, Dec 10, 2024 at 07:25:54AM -0500, Scott Mayhew wrote:
> Get rid of the nfsd4_legacy_tracking_ops->init() call in
> check_for_legacy_methods().  That will be handled in the caller
> (nfsd4_client_tracking_init()).  Otherwise, we'll wind up calling
> nfsd4_legacy_tracking_ops->init() twice, and the second time we'll
> trigger the BUG_ON() in nfsd4_init_recdir().
> 
> Fixes: 74fd48739d04 ("nfsd: new Kconfig option for legacy client tracking")
> Reported-by: Jur van der Burg <jur@avtware.com>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=219580
> Signed-off-by: Scott Mayhew <smayhew@redhat.com>
> ---
>  fs/nfsd/nfs4recover.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
> index 4a765555bf84..1c8fcb04b3cd 100644
> --- a/fs/nfsd/nfs4recover.c
> +++ b/fs/nfsd/nfs4recover.c
> @@ -2052,7 +2052,6 @@ static inline int check_for_legacy_methods(int status, struct net *net)
>  		path_put(&path);
>  		if (status)
>  			return -ENOTDIR;
> -		status = nn->client_tracking_ops->init(net);
>  	}
>  	return status;

With a kernel with CONFIG_NFSD_LEGACY_CLIENT_TRACKING=y and this
change applied, successfully tested against the issue reported in
https://bugs.debian.org/1087900
https://bugs.debian.org/1091439

Tested-by: Salvatore Bonaccorso <carnil@debian.org>

Regards,
Salvatore

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

end of thread, other threads:[~2024-12-28  6:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-10 12:25 [PATCH] nfsd: fix legacy client tracking initialization Scott Mayhew
2024-12-10 15:01 ` cel
2024-12-10 15:02 ` Jeff Layton
2024-12-17 14:54 ` cel
2024-12-28  6:53 ` Salvatore Bonaccorso

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