mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
nfs_common: Remove unused nfs_ssc_client_ops infrastructure
Clean up: Commit 75333d48f9 ("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>
Link: https://patch.msgid.link/20260721162306.894558-2-cel@kernel.org
Signed-off-by: Chuck Lever <cel@kernel.org>
This commit is contained in:
parent
b30f238da8
commit
53f0adfd76
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -1698,8 +1698,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"
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user