]> git.baikalelectronics.ru Git - kernel.git/commit
cachefiles: avoid deprecated get_seconds()
authorArnd Bergmann <arnd@arndb.de>
Fri, 13 Jul 2018 14:27:44 +0000 (16:27 +0200)
committerDavid Howells <dhowells@redhat.com>
Fri, 30 Nov 2018 16:00:58 +0000 (16:00 +0000)
commitb5e550ed1a530672989e5159fb0f8c6108f6c0e1
tree46c49be455c1154616f49b177fc8063558e4f883
parent53f7eb538203a2c012de0d672fbab2f1c3a61a59
cachefiles: avoid deprecated get_seconds()

get_seconds() returns an unsigned long can overflow on some architectures
and is deprecated because of that. In cachefs, we cast that number to
a a 32-bit integer, which will overflow in year 2106 on all architectures.

As confirmed by David Howells, the overflow probably isn't harmful
in the end, since the timestamps are only used to make the file names
unique, but they don't strictly have to be in monotonically increasing
order since the files only exist in order to be deleted as quickly
as possible.

Moving to ktime_get_real_seconds() avoids the deprecated interface.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David Howells <dhowells@redhat.com>
fs/cachefiles/namei.c