From: Chuck Lever <cel@kernel.org>
To: NeilBrown <neil@brown.name>, Jeff Layton <jlayton@kernel.org>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <dai.ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: <linux-nfs@vger.kernel.org>
Subject: [PATCH 1/4] nfs_common: Remove unused nfs_ssc_client_ops infrastructure
Date: Tue, 21 Jul 2026 12:23:03 -0400 [thread overview]
Message-ID: <20260721162306.894558-2-cel@kernel.org> (raw)
In-Reply-To: <20260721162306.894558-1-cel@kernel.org>
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 <okorniev@redhat.com>
Cc: Dai Ngo <dai.ngo@oracle.com>
Signed-off-by: Chuck Lever <cel@kernel.org>
---
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
next prev parent reply other threads:[~2026-07-21 16:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 16:23 [PATCH 0/4] Confine the inter-server copy interface to fs/nfs_common Chuck Lever
2026-07-21 16:23 ` Chuck Lever [this message]
2026-07-21 16:23 ` [PATCH 2/4] NFSD: Hoist nfs42_ssc_open() into fs/nfs_common/nfs_ssc.c Chuck Lever
2026-07-21 16:23 ` [PATCH 3/4] nfs_common: Synchronize access to the SSC client ops table Chuck Lever
2026-07-21 16:23 ` [PATCH 4/4] NFSD: Split linux/nfs_ssc.h Chuck Lever
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=20260721162306.894558-2-cel@kernel.org \
--to=cel@kernel.org \
--cc=dai.ngo@oracle.com \
--cc=jlayton@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=okorniev@redhat.com \
--cc=tom@talpey.com \
/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.