lockd: change the proc_handler for nsm_use_hostnames
authorJia He <hejianet@gmail.com>
Tue, 3 Aug 2021 10:59:37 +0000 (12:59 +0200)
committerChuck Lever <chuck.lever@oracle.com>
Tue, 17 Aug 2021 15:47:53 +0000 (11:47 -0400)
nsm_use_hostnames is a module parameter and it will be exported to sysctl
procfs. This is to let user sometimes change it from userspace. But the
minimal unit for sysctl procfs read/write it sizeof(int).
In big endian system, the converting from/to  bool to/from int will cause
error for proc items.

This patch use a new proc_handler proc_dobool to fix it.

Signed-off-by: Jia He <hejianet@gmail.com>
Reviewed-by: Pan Xinhui <xinhui.pan@linux.vnet.ibm.com>
[thuth: Fix typo in commit message]
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/lockd/svc.c

index 2de048f80eb8c3b310b71740bf99009f29f432aa..0ab9756ed2359f69efbda3d473acbe8946455b43 100644 (file)
@@ -584,7 +584,7 @@ static struct ctl_table nlm_sysctls[] = {
                .data           = &nsm_use_hostnames,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = proc_dointvec,
+               .proc_handler   = proc_dobool,
        },
        {
                .procname       = "nsm_local_state",