[PATCH 1/4] nfs_common: Remove unused nfs_ssc_client_ops infrastructure
Chuck Lever <[email protected]> Tue, 21 Jul 2026 12:23:03 -0400
| Newsgroups | org.kernel.vger.linux-nfs |
|---|---|
| Message-ID | <[email protected]> |
Clean up: Commit 75333d48f922 ("NFSD: fix use-after-free in
__nfs42_ssc_open()") addressed a use-after-free bug by removing the
nfsd4_interssc_disconnect() function. Post-copy clean-up was then
delegated to NFSD's laundromat.
Since that commit, the nfs_do_sb_deactive() wrapper function and the
entire nfs_ssc_client_ops infrastructure no longer have any
consumers. This includes nfs_do_sb_deactive(), struct
nfs_ssc_client_ops, nfs_ssc_register(), nfs_ssc_unregister(), and
related registrations in the NFS client.
Cc: Olga Kornievskaia <[email protected]>
Cc: Dai Ngo <[email protected]>
Signed-off-by: Chuck Lever <[email protected]>
---
fs/nfs/super.c | 25 ------------------------
fs/nfs_common/nfs_ssc.c | 42 -----------------------------------------
fs/nfsd/nfs4proc.c | 2 --
include/linux/nfs_ssc.h | 20 --------------------
4 files changed, 89 deletions(-)
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index cb19f1540d98..23292680adbd 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -58,7 +58,6 @@
#include <linux/rcupdate.h>
#include <linux/uaccess.h>
-#include <linux/nfs_ssc.h>
#include <uapi/linux/tls.h>
@@ -92,12 +91,6 @@ const struct super_operations nfs_sops = {
};
EXPORT_SYMBOL_GPL(nfs_sops);
-#ifdef CONFIG_NFS_V4_2
-static const struct nfs_ssc_client_ops nfs_ssc_clnt_ops_tbl = {
- .sco_sb_deactive = nfs_sb_deactive,
-};
-#endif
-
#if IS_ENABLED(CONFIG_NFS_V4)
static int __init register_nfs4_fs(void)
{
@@ -119,18 +112,6 @@ static void unregister_nfs4_fs(void)
}
#endif
-#ifdef CONFIG_NFS_V4_2
-static void nfs_ssc_register_ops(void)
-{
- nfs_ssc_register(&nfs_ssc_clnt_ops_tbl);
-}
-
-static void nfs_ssc_unregister_ops(void)
-{
- nfs_ssc_unregister(&nfs_ssc_clnt_ops_tbl);
-}
-#endif /* CONFIG_NFS_V4_2 */
-
static struct shrinker *acl_shrinker;
/*
@@ -163,9 +144,6 @@ int __init register_nfs_fs(void)
shrinker_register(acl_shrinker);
-#ifdef CONFIG_NFS_V4_2
- nfs_ssc_register_ops();
-#endif
return 0;
error_3:
nfs_unregister_sysctl();
@@ -185,9 +163,6 @@ void __exit unregister_nfs_fs(void)
shrinker_free(acl_shrinker);
nfs_unregister_sysctl();
unregister_nfs4_fs();
-#ifdef CONFIG_NFS_V4_2
- nfs_ssc_unregister_ops();
-#endif
unregister_filesystem(&nfs_fs_type);
}
diff --git a/fs/nfs_common/nfs_ssc.c b/fs/nfs_common/nfs_ssc.c
index 832246b22c51..8d8b7344ab4f 100644
--- a/fs/nfs_common/nfs_ssc.c
+++ b/fs/nfs_common/nfs_ssc.c
@@ -47,45 +47,3 @@ void nfs42_ssc_unregister(const struct nfs4_ssc_client_ops *ops)
}
EXPORT_SYMBOL_GPL(nfs42_ssc_unregister);
#endif /* CONFIG_NFS_V4_2 */
-
-#ifdef CONFIG_NFS_V4_2
-/**
- * nfs_ssc_register - install the NFS_FS client ops in the nfs_ssc_client_tbl
- * @ops: NFS_FS ops to be installed
- *
- * Return values:
- * None
- */
-void nfs_ssc_register(const struct nfs_ssc_client_ops *ops)
-{
- nfs_ssc_client_tbl.ssc_nfs_ops = ops;
-}
-EXPORT_SYMBOL_GPL(nfs_ssc_register);
-
-/**
- * nfs_ssc_unregister - uninstall the NFS_FS client ops from
- * the nfs_ssc_client_tbl
- * @ops: ops to be uninstalled
- *
- * Return values:
- * None
- */
-void nfs_ssc_unregister(const struct nfs_ssc_client_ops *ops)
-{
- if (nfs_ssc_client_tbl.ssc_nfs_ops != ops)
- return;
- nfs_ssc_client_tbl.ssc_nfs_ops = NULL;
-}
-EXPORT_SYMBOL_GPL(nfs_ssc_unregister);
-
-#else
-void nfs_ssc_register(const struct nfs_ssc_client_ops *ops)
-{
-}
-EXPORT_SYMBOL_GPL(nfs_ssc_register);
-
-void nfs_ssc_unregister(const struct nfs_ssc_client_ops *ops)
-{
-}
-EXPORT_SYMBOL_GPL(nfs_ssc_unregister);
-#endif /* CONFIG_NFS_V4_2 */
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index b7d745020fd1..83715ba38b6a 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1697,8 +1697,6 @@ extern struct file *nfs42_ssc_open(struct vfsmount *ss_mnt,
nfs4_stateid *stateid);
extern void nfs42_ssc_close(struct file *filep);
-extern void nfs_sb_deactive(struct super_block *sb);
-
#define NFSD42_INTERSSC_MOUNTOPS "vers=4.2,addr=%s,sec=sys"
/*
diff --git a/include/linux/nfs_ssc.h b/include/linux/nfs_ssc.h
index 22265b1ff080..ba236dba8975 100644
--- a/include/linux/nfs_ssc.h
+++ b/include/linux/nfs_ssc.h
@@ -21,16 +21,8 @@ struct nfs4_ssc_client_ops {
void (*sco_close)(struct file *filep);
};
-/*
- * NFS_FS
- */
-struct nfs_ssc_client_ops {
- void (*sco_sb_deactive)(struct super_block *sb);
-};
-
struct nfs_ssc_client_ops_tbl {
const struct nfs4_ssc_client_ops *ssc_nfs4_ops;
- const struct nfs_ssc_client_ops *ssc_nfs_ops;
};
extern void nfs42_ssc_register_ops(void);
@@ -67,15 +59,3 @@ struct nfsd4_ssc_umount_item {
struct vfsmount *nsui_vfsmount;
char nsui_ipaddr[RPC_MAX_ADDRBUFLEN + 1];
};
-
-/*
- * NFS_FS
- */
-extern void nfs_ssc_register(const struct nfs_ssc_client_ops *ops);
-extern void nfs_ssc_unregister(const struct nfs_ssc_client_ops *ops);
-
-static inline void nfs_do_sb_deactive(struct super_block *sb)
-{
- if (nfs_ssc_client_tbl.ssc_nfs_ops)
- (*nfs_ssc_client_tbl.ssc_nfs_ops->sco_sb_deactive)(sb);
-}
--
2.54.0