nfs: fscache: use timespec64 in inode auxdata
authorArnd Bergmann <arnd@arndb.de>
Mon, 11 Nov 2019 20:16:25 +0000 (21:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 May 2020 06:20:23 +0000 (08:20 +0200)
commit021f5799de535c5223aa340267cf073c939e9371
tree7c32e1b54f5c00cd194a6e877d25307da6355af1
parentef8195ee1618d2000517e0de47ec96f3048137fb
nfs: fscache: use timespec64 in inode auxdata

[ Upstream commit 6e31ded6895adfca97211118cc9b72236e8f6d53 ]

nfs currently behaves differently on 32-bit and 64-bit kernels regarding
the on-disk format of nfs_fscache_inode_auxdata.

That format should really be the same on any kernel, and we should avoid
the 'timespec' type in order to remove that from the kernel later on.

Using plain 'timespec64' would not be good here, since that includes
implied padding and would possibly leak kernel stack data to the on-disk
format on 32-bit architectures.

struct __kernel_timespec would work as a replacement, but open-coding
the two struct members in nfs_fscache_inode_auxdata makes it more
obvious what's going on here, and keeps the current format for 64-bit
architectures.

Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/fscache-index.c
fs/nfs/fscache.c
fs/nfs/fscache.h