NFS client made without CONFIG_NFS_V4 option does not call
nfs_unregister_sysctl() when the module is unloaded, and
causes kernel oopses. For instance, the oopses will occur
when accessing /proc/sys.
This fixes the problem.
Note that register_nfs_fs() requires no change in this regard.
It looks similar at the first glance, but written properly.
Signed-off-by: Ryusuke Konishi <[email protected]>
---
fs/nfs/super.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index b2a851c..e784310 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -345,8 +345,8 @@ void __exit unregister_nfs_fs(void)
unregister_shrinker(&acl_shrinker);
#ifdef CONFIG_NFS_V4
unregister_filesystem(&nfs4_fs_type);
- nfs_unregister_sysctl();
#endif
+ nfs_unregister_sysctl();
unregister_filesystem(&nfs_fs_type);
}