]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
nfsd: fix delay timer on 32-bit architectures
authorArnd Bergmann <arnd@arndb.de>
Sun, 3 Nov 2019 21:32:20 +0000 (22:32 +0100)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 13 Mar 2020 04:31:00 +0000 (00:31 -0400)
commit7e5716700919ef81a24be4a22669a263704c66da
treea4a52598f5a07e9d0b186024ee4fe1b1dd8aa912
parent05b7ab8cb4b77eb30c60a59d3df6847e78e3edb6
nfsd: fix delay timer on 32-bit architectures

BugLink: https://bugs.launchpad.net/bugs/1866678
commit 2561c92b12f4f4e386d453556685f75775c0938b upstream.

The nfsd4_cb_layout_done() function takes a 'time_t' value,
multiplied by NSEC_PER_SEC*2 to get a nanosecond value.

This works fine on 64-bit architectures, but on 32-bit, any
value over 1 second results in a signed integer overflow
with unexpected results.

Cast one input to a 64-bit type in order to produce the
same result that we have on 64-bit architectures, regarless
of the type of nfsd4_lease.

Fixes: 6b9b21073d3b ("nfsd: give up on CB_LAYOUTRECALLs after two lease periods")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/nfsd/nfs4layouts.c