Skip to contentSkip to conversation

nfsd: fix legacy client tracking initialization

PATCH In review Scott Mayhew 4 participants 5 messages Dec 10, 2024 – Dec 28, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfsd: fix legacy client tracking initialization

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")
---
 fs/nfsd/nfs4recover.c | 1 -
 1 file changed, 1 deletion(-)
fs/nfsd/nfs4recover.c +0 -1
index 4a765555bf84..1c8fcb04b3cd 100644
@@ -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;
 }
Signature · 1 line
2.47.1
#1 lore raw

From: Chuck Lever <[email protected]>

Quoted 8 lines · Scott Mayhew

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

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Scott Mayhew
Quoted 19 lines · Scott Mayhew

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")
---
 fs/nfsd/nfs4recover.c | 1 -
 1 file changed, 1 deletion(-)
fs/nfsd/nfs4recover.c +0 -0
index 4a765555bf84..1c8fcb04b3cd 100644

fs/nfsd/nfs4recover.c static inline int check_for_legacy_methods(int status, struct net *net) · line 2057

Quoted 7 lines
fs/nfsd/nfs4recover.c +0 -1
@@ -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;
 }
#3 lore raw
In reply to Scott Mayhew

From: Chuck Lever <[email protected]>

Quoted 8 lines · Scott Mayhew

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

Tested-by on v1 1/1
#4 lore raw
In reply to Scott Mayhew

Hi,

Quoted 19 lines · Scott Mayhew

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")
---
 fs/nfsd/nfs4recover.c | 1 -
 1 file changed, 1 deletion(-)
fs/nfsd/nfs4recover.c +0 -0
index 4a765555bf84..1c8fcb04b3cd 100644

fs/nfsd/nfs4recover.c static inline int check_for_legacy_methods(int status, struct net *net) · line 2056

Quoted 6 lines
fs/nfsd/nfs4recover.c +0 -1
@@ -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

Regards,
Salvatore