mbox series

[0/2] Fix /proc/sys/fs/nfs/nsm_use_hostnames on big endian machines

Message ID 20210803105937.52052-1-thuth@redhat.com (mailing list archive)
Headers show
Series Fix /proc/sys/fs/nfs/nsm_use_hostnames on big endian machines | expand

Message

Thomas Huth Aug. 3, 2021, 10:59 a.m. UTC
There is an endianess problem with /proc/sys/fs/nfs/nsm_use_hostnames
(which can e.g. be seen on an s390x host) :

 # modprobe lockd nsm_use_hostnames=1
 # cat /proc/sys/fs/nfs/nsm_use_hostnames
 16777216

The nsm_use_hostnames variable is declared as "bool" which is required
for the correct type for the module parameter. However, this does not
work correctly with the entry in the /proc filesystem since this
currently requires "int".

Jia He already provided patches for this problem a couple of years ago,
but apparently they felt through the cracks and never got merged. So
here's a rebased version to finally fix this issue.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1764075

Jia He (2):
  sysctl: introduce new proc handler proc_dobool
  lockd: change the proc_handler for nsm_use_hostnames

 fs/lockd/svc.c         |  2 +-
 include/linux/sysctl.h |  2 ++
 kernel/sysctl.c        | 42 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 45 insertions(+), 1 deletion(-)

Comments

J. Bruce Fields Aug. 3, 2021, 2:08 p.m. UTC | #1
Looks good to me.  Could Chuck take it with nfsd stuff if somebody could
ACK the sysctl part?

--b.

On Tue, Aug 03, 2021 at 12:59:35PM +0200, Thomas Huth wrote:
> There is an endianess problem with /proc/sys/fs/nfs/nsm_use_hostnames
> (which can e.g. be seen on an s390x host) :
> 
>  # modprobe lockd nsm_use_hostnames=1
>  # cat /proc/sys/fs/nfs/nsm_use_hostnames
>  16777216
> 
> The nsm_use_hostnames variable is declared as "bool" which is required
> for the correct type for the module parameter. However, this does not
> work correctly with the entry in the /proc filesystem since this
> currently requires "int".
> 
> Jia He already provided patches for this problem a couple of years ago,
> but apparently they felt through the cracks and never got merged. So
> here's a rebased version to finally fix this issue.
> 
> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1764075
> 
> Jia He (2):
>   sysctl: introduce new proc handler proc_dobool
>   lockd: change the proc_handler for nsm_use_hostnames
> 
>  fs/lockd/svc.c         |  2 +-
>  include/linux/sysctl.h |  2 ++
>  kernel/sysctl.c        | 42 ++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 45 insertions(+), 1 deletion(-)
> 
> -- 
> 2.27.0
Chuck Lever III Aug. 3, 2021, 2:24 p.m. UTC | #2
Thanks for your review, Bruce. I'll watch for the additional Ack.

> On Aug 3, 2021, at 10:08 AM, J. Bruce Fields <bfields@fieldses.org> wrote:
> 
> Looks good to me.  Could Chuck take it with nfsd stuff if somebody could
> ACK the sysctl part?
> 
> --b.
> 
> On Tue, Aug 03, 2021 at 12:59:35PM +0200, Thomas Huth wrote:
>> There is an endianess problem with /proc/sys/fs/nfs/nsm_use_hostnames
>> (which can e.g. be seen on an s390x host) :
>> 
>> # modprobe lockd nsm_use_hostnames=1
>> # cat /proc/sys/fs/nfs/nsm_use_hostnames
>> 16777216
>> 
>> The nsm_use_hostnames variable is declared as "bool" which is required
>> for the correct type for the module parameter. However, this does not
>> work correctly with the entry in the /proc filesystem since this
>> currently requires "int".
>> 
>> Jia He already provided patches for this problem a couple of years ago,
>> but apparently they felt through the cracks and never got merged. So
>> here's a rebased version to finally fix this issue.
>> 
>> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1764075
>> 
>> Jia He (2):
>>  sysctl: introduce new proc handler proc_dobool
>>  lockd: change the proc_handler for nsm_use_hostnames
>> 
>> fs/lockd/svc.c         |  2 +-
>> include/linux/sysctl.h |  2 ++
>> kernel/sysctl.c        | 42 ++++++++++++++++++++++++++++++++++++++++++
>> 3 files changed, 45 insertions(+), 1 deletion(-)
>> 
>> -- 
>> 2.27.0

--
Chuck Lever
Jia He Aug. 4, 2021, 2:12 a.m. UTC | #3
On 2021/8/3 18:59, Thomas Huth wrote:
> There is an endianess problem with /proc/sys/fs/nfs/nsm_use_hostnames
> (which can e.g. be seen on an s390x host) :
>
>   # modprobe lockd nsm_use_hostnames=1
>   # cat /proc/sys/fs/nfs/nsm_use_hostnames
>   16777216
>
> The nsm_use_hostnames variable is declared as "bool" which is required
> for the correct type for the module parameter. However, this does not
> work correctly with the entry in the /proc filesystem since this
> currently requires "int".
>
> Jia He already provided patches for this problem a couple of years ago,
> but apparently they felt through the cracks and never got merged. So
> here's a rebased version to finally fix this issue.
>
> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1764075
>
> Jia He (2):
>    sysctl: introduce new proc handler proc_dobool
>    lockd: change the proc_handler for nsm_use_hostnames

Thanks for picking them up ;-)

---
Cheers,
Justin (Jia He)
Chuck Lever III Aug. 9, 2021, 5:50 p.m. UTC | #4
> On Aug 3, 2021, at 6:59 AM, Thomas Huth <thuth@redhat.com> wrote:
> 
> There is an endianess problem with /proc/sys/fs/nfs/nsm_use_hostnames
> (which can e.g. be seen on an s390x host) :
> 
> # modprobe lockd nsm_use_hostnames=1
> # cat /proc/sys/fs/nfs/nsm_use_hostnames
> 16777216
> 
> The nsm_use_hostnames variable is declared as "bool" which is required
> for the correct type for the module parameter. However, this does not
> work correctly with the entry in the /proc filesystem since this
> currently requires "int".
> 
> Jia He already provided patches for this problem a couple of years ago,
> but apparently they felt through the cracks and never got merged. So
> here's a rebased version to finally fix this issue.
> 
> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1764075
> 
> Jia He (2):
>  sysctl: introduce new proc handler proc_dobool
>  lockd: change the proc_handler for nsm_use_hostnames
> 
> fs/lockd/svc.c         |  2 +-
> include/linux/sysctl.h |  2 ++
> kernel/sysctl.c        | 42 ++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 45 insertions(+), 1 deletion(-)
> 
> -- 
> 2.27.0

To get these patches in front of our zero-day apparatus,
I've applied them to the for-next topic branch here:

https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git/log/?h=for-next

However I haven't seen an Ack for the kernel/sysctl.c change yet.


--
Chuck Lever