Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1540027

[PATCH 1/1] lockd: Change nsm_use_hostnames from bool to u32

From Jia He <hejianet@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 1/1] lockd: Change nsm_use_hostnames from bool to u32
Date 2016-12-11 15:50 +0100
Message-ID <sNdBU-jJ-17@gated-at.bofh.it> (permalink)
References <sNdBU-jJ-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 changes the type definition of nsm_use_hostnames.

Signed-off-by: Jia He <hejianet@gmail.com>
---
 fs/lockd/mon.c | 2 +-
 fs/lockd/svc.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
index 19166d4..3e7ff4d 100644
--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
@@ -57,7 +57,7 @@ static				DEFINE_SPINLOCK(nsm_lock);
  * Local NSM state
  */
 u32	__read_mostly		nsm_local_state;
-bool	__read_mostly		nsm_use_hostnames;
+u32	__read_mostly		nsm_use_hostnames;
 
 static inline struct sockaddr *nsm_addr(const struct nsm_handle *nsm)
 {
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index fc4084e..308033d 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -658,7 +658,7 @@ module_param_call(nlm_udpport, param_set_port, param_get_int,
 		  &nlm_udpport, 0644);
 module_param_call(nlm_tcpport, param_set_port, param_get_int,
 		  &nlm_tcpport, 0644);
-module_param(nsm_use_hostnames, bool, 0644);
+module_param(nsm_use_hostnames, u32, 0644);
 module_param(nlm_max_connections, uint, 0644);
 
 static int lockd_init_net(struct net *net)
-- 
2.5.5

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/1] lockd: Change nsm_use_hostnames from bool to u32 Jia He <hejianet@gmail.com> - 2016-12-11 15:50 +0100
  [PATCH 1/1] lockd: Change nsm_use_hostnames from bool to u32 Jia He <hejianet@gmail.com> - 2016-12-11 15:50 +0100
    Re: [PATCH 1/1] lockd: Change nsm_use_hostnames from bool to u32 kbuild test robot <lkp@intel.com> - 2016-12-11 16:10 +0100

csiph-web