NFSv4_2: SSC helper should use its own config.
Subsystems (3)
Dai Ngo
reviewerPATCH v2 1/1 NFSv4_2: SSC helper should use its own config.
Currently NFSv4_2 SSC helper, nfs_ssc, incorrectly uses GRACE_PERIOD as its config. Fix by adding new config NFS_V4_2_SSC_HELPER which depends on NFS_V4_2 and is automatically selected when NFSD_V4 is enabled. Also removed the file name from a comment in nfs_ssc.c.
--- fs/Kconfig | 4 ++++ fs/nfs/nfs4file.c | 4 ++++ fs/nfs/super.c | 12 ++++++++++++ fs/nfs_common/Makefile | 2 +- fs/nfs_common/nfs_ssc.c | 2 -- fs/nfsd/Kconfig | 1 + 6 files changed, 22 insertions(+), 3 deletions(-)
fs/Kconfig +4 -0
@@ -333,6 +333,10 @@ config NFS_COMMON depends on NFSD || NFS_FS || LOCKD default y +config NFS_V4_2_SSC_HELPER + tristate + default y if NFS_V4=y || NFS_FS=y + source "net/sunrpc/Kconfig" source "fs/ceph/Kconfig" source "fs/cifs/Kconfig"
fs/nfs/nfs4file.c +4 -0
@@ -420,7 +420,9 @@ static const struct nfs4_ssc_client_ops nfs4_ssc_clnt_ops_tbl = {*/ void nfs42_ssc_register_ops (void ) { +#ifdef CONFIG_NFSD_V4 nfs42_ssc_register (&nfs4_ssc_clnt_ops_tbl); +#endif }/**
@@ -431,7 +433,9 @@ void nfs42_ssc_register_ops(void)*/ void nfs42_ssc_unregister_ops (void ) { +#ifdef CONFIG_NFSD_V4 nfs42_ssc_unregister (&nfs4_ssc_clnt_ops_tbl); +#endif }#endif /* CONFIG_NFS_V4_2 */
fs/nfs/super.c +12 -0
@@ -86,9 +86,11 @@ 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 )
@@ -111,15 +113,21 @@ static void unregister_nfs4_fs(void) }#endif +#ifdef CONFIG_NFS_V4_2 static void nfs_ssc_register_ops (void ) { +#ifdef CONFIG_NFSD_V4 nfs_ssc_register (&nfs_ssc_clnt_ops_tbl); +#endif }static void nfs_ssc_unregister_ops (void ) { +#ifdef CONFIG_NFSD_V4 nfs_ssc_unregister (&nfs_ssc_clnt_ops_tbl); +#endif } +#endif /* CONFIG_NFS_V4_2 */ static struct shrinker acl_shrinker = { .count_objects = nfs_access_cache_count,
@@ -148,7 +156,9 @@ int __init register_nfs_fs(void) ret =register_shrinker (&acl_shrinker);if (ret <0 ) goto error_3; +#ifdef CONFIG_NFS_V4_2 nfs_ssc_register_ops (); +#endif return 0 ; error_3:nfs_unregister_sysctl ();
@@ -168,7 +178,9 @@ void __exit unregister_nfs_fs(void)unregister_shrinker (&acl_shrinker);nfs_unregister_sysctl ();unregister_nfs4_fs (); +#ifdef CONFIG_NFS_V4_2 nfs_ssc_unregister_ops (); +#endif unregister_filesystem (&nfs_fs_type); }
fs/nfs_common/Makefile +1 -1
@@ -7,4 +7,4 @@ obj-$(CONFIG_NFS_ACL_SUPPORT) += nfs_acl.o nfs_acl-objs := nfsacl.o obj-$(CONFIG_GRACE_PERIOD) += grace.o -obj-$(CONFIG_GRACE_PERIOD) += nfs_ssc.o +obj-$(CONFIG_NFS_V4_2_SSC_HELPER) += nfs_ssc.o
fs/nfs_common/nfs_ssc.c +0 -2
@@ -1,7 +1,5 @@// SPDX-License-Identifier: GPL-2.0-only /* -* fs/nfs_common/nfs_ssc_comm.c -* * Helper for knfsd's SSC to access ops in NFS client modules * * Author: Dai Ngo <[email protected]>
fs/nfsd/Kconfig +1 -0
@@ -76,6 +76,7 @@ config NFSD_V4 select CRYPTO_MD5 select CRYPTO_SHA256 select GRACE_PERIOD + select NFS_V4_2_SSC_HELPER if NFS_V4_2 help This option enables support in your system's NFS server for version 4 of the NFS protocol (RFC 3530).
Signature · 1 line
2.9.5
Hello Dai-
Quoted 8 lines · Dai Ngo
Currently
NFSv4_2SSC helper,nfs_ssc, incorrectly usesGRACE_PERIODas its config. Fix by adding new configNFS_V4_2_SSC_HELPERwhich depends onNFS_V4_2and is automatically selected whenNFSD_V4is enabled. Also removed the file name from a comment innfs_ssc.c.Signed-off-by Dai Ngo <[email protected]>
v2 of your patch has replaced the original version in the for-next branch at
git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git
Quoted 143 lines
---
fs/Kconfig | 4 ++++ fs/nfs/nfs4file.c | 4 ++++ fs/nfs/super.c | 12 ++++++++++++ fs/nfs_common/Makefile | 2 +- fs/nfs_common/nfs_ssc.c | 2 -- fs/nfsd/Kconfig | 1 + 6 files changed, 22 insertions(+), 3 deletions(-)fs/Kconfig +4
-0@@ -333,6 +333,10 @@ config NFS_COMMON depends on NFSD || NFS_FS || LOCKD default y +config NFS_V4_2_SSC_HELPER + tristate + default y if NFS_V4=y || NFS_FS=y +source "
net/sunrpc/Kconfig"
source "fs/ceph/Kconfig"
source "fs/cifs/Kconfig"fs/nfs/nfs4file.c +4
-0@@ -420,7 +420,9 @@ static const struct nfs4_ssc_client_ops nfs4_ssc_clnt_ops_tbl = {*/ void nfs42_ssc_register_ops (void ) { +#ifdef CONFIG_NFSD_V4 nfs42_ssc_register (&nfs4_ssc_clnt_ops_tbl); +#endif }/** @@ -431,7 +433,9 @@ void nfs42_ssc_register_ops(void)*/ void nfs42_ssc_unregister_ops (void ) { +#ifdef CONFIG_NFSD_V4 nfs42_ssc_unregister (&nfs4_ssc_clnt_ops_tbl); +#endif }#endif /* CONFIG_NFS_V4_2 */ fs/nfs/super.c +10
-0@@ -86,9 +86,11 @@ 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 )@@ -111,15 +113,21 @@ static void unregister_nfs4_fs(void) }#endif +#ifdef CONFIG_NFS_V4_2 static void nfs_ssc_register_ops (void ) { +#ifdef CONFIG_NFSD_V4 nfs_ssc_register (&nfs_ssc_clnt_ops_tbl); +#endif }static void nfs_ssc_unregister_ops (void ) { +#ifdef CONFIG_NFSD_V4 nfs_ssc_unregister (&nfs_ssc_clnt_ops_tbl); +#endif } +#endif /* CONFIG_NFS_V4_2 */ static struct shrinker acl_shrinker = { .count_objects = nfs_access_cache_count,@@ -148,7 +156,9 @@ int __init register_nfs_fs(void) ret =register_shrinker (&acl_shrinker);if (ret <0 ) goto error_3; +#ifdef CONFIG_NFS_V4_2 nfs_ssc_register_ops (); +#endif return 0 ;
error_3:nfs_unregister_sysctl();fs/nfs/super.c +2
-0@@ -168,7 +178,9 @@ void __exit unregister_nfs_fs(void)unregister_shrinker (&acl_shrinker);nfs_unregister_sysctl ();unregister_nfs4_fs (); +#ifdef CONFIG_NFS_V4_2 nfs_ssc_unregister_ops (); +#endif unregister_filesystem (&nfs_fs_type); }fs/nfs_common/Makefile +0
-0@@ -7,4 +7,4 @@ obj-$(CONFIG_NFS_ACL_SUPPORT) += nfs_acl.onfs_acl-objs := nfsacl.o
obj-$(CONFIG_GRACE_PERIOD) += grace.o
fs/nfs_common/Makefile +1
-1-obj-$(CONFIG_GRACE_PERIOD) += nfs_ssc.o +obj-$(CONFIG_NFS_V4_2_SSC_HELPER) += nfs_ssc.ofs/nfs_common/nfs_ssc.c +0
-2@@ -1,7 +1,5 @@// SPDX-License-Identifier: GPL-2.0-only /* -* fs/nfs_common/nfs_ssc_comm.c -* * Helper for knfsd's SSC to access ops in NFS client modules * * Author: Dai Ngo <[email protected]> fs/nfsd/Kconfig +1
-0@@ -76,6 +76,7 @@ config NFSD_V4 select CRYPTO_MD5 select CRYPTO_SHA256 select GRACE_PERIOD + select NFS_V4_2_SSC_HELPER if NFS_V4_2 help This option enables support in your system's NFS server for version 4 of the NFS protocol (RFC 3530).Signature · 1 line
2.9.5
--
Chuck Lever