Thread (11 messages) 11 messages, 5 authors, 2021-09-16
STALE1728d REVIEWED: 1 (0M)

[PATCH 2/2] lockd: change the proc_handler for nsm_use_hostnames

From: Thomas Huth <hidden>
Date: 2021-08-03 11:00:00
Also in: linux-fsdevel, linux-nfs, lkml
Subsystem: filesystems (vfs and infrastructure), kernel nfsd, sunrpc, and lockd servers, nfs, sunrpc, and lockd clients, the rest · Maintainers: Alexander Viro, Christian Brauner, Chuck Lever, Jeff Layton, Trond Myklebust, Anna Schumaker, Linus Torvalds

From: Jia He <redacted>

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 <redacted>
Reviewed-by: Pan Xinhui <redacted>
[thuth: Fix typo in commit message]
Signed-off-by: Thomas Huth <redacted>
---
 fs/lockd/svc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index 2de048f80eb8..0ab9756ed235 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -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",
-- 
2.27.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help