]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: make 'boot_time' 64-bit wide
authorArnd Bergmann <arnd@arndb.de>
Thu, 31 Oct 2019 14:53:13 +0000 (15:53 +0100)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 19 Dec 2019 22:46:08 +0000 (17:46 -0500)
commitf4095761dacf09d779e5a24dded123c6c7714b83
treeef10cbb50010ca6cf0ab07332b95fe88391c07e3
parentc3a4264f1947f3d8e61cd68bcc67f068bb885ab4
nfsd: make 'boot_time' 64-bit wide

The local boot time variable gets truncated to time_t at the moment,
which can lead to slightly odd behavior on 32-bit architectures.

Use ktime_get_real_seconds() instead of get_seconds() to always
get a 64-bit result, and keep it that way wherever possible.

It still gets truncated in a few places:

- When assigning to cl_clientid.cl_boot, this is already documented
  and is only used as a unique identifier.

- In clients_still_reclaiming(), the truncation is to 'unsigned long'
  in order to use the 'time_before() helper.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/netns.h
fs/nfsd/nfs4recover.c
fs/nfsd/nfs4state.c