Skip to content
  • Arnd Bergmann's avatar
    cachefiles: avoid deprecated get_seconds() · 34e06fe4
    Arnd Bergmann authored
    
    
    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: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    34e06fe4