[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a06uP18jei=b3Hwdoe21f3gM6K5j2129Ra5CdVx5aKh6g@mail.gmail.com>
Date: Wed, 20 Jun 2018 14:03:40 +0200
From: Arnd Bergmann <arnd@...db.de>
To: David Howells <dhowells@...hat.com>
Cc: y2038 Mailman List <y2038@...ts.linaro.org>,
linux-cachefs@...hat.com,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] cachefiles: avoid deprecated get_seconds()
On Wed, Jun 20, 2018 at 12:58 PM, David Howells <dhowells@...hat.com> wrote:
> Arnd Bergmann <arnd@...db.de> wrote:
>
>> - sprintf(nbuffer, "%08x%08x",
>> - (uint32_t) get_seconds(),
>> + sprintf(nbuffer, "%08llx%08x",
>> + (uint64_t) ktime_get_real_seconds(),
>
> It's not necessary to expand the 'time' field of the name. It's not
> interpreted by userspace, it's just there to prevent collisions when moving
> directories about. If your cache goes weird in the future because there was a
> collision with an object that was moved to the graveyard 68 years ago and not
> cleaned up, then that's probably a bug in cachefilesd.
>
> But I've no objection to using ktime_get_real_seconds() and truncating the
> value.
Ok, fair enough. I was mainly worried about what might happen when the
file names stop being strictly sorted in numerical order by their creation
time. If that is not a problem, I'll send the simpler patch to use
lower_32_bits(ktime_get_real_seconds()) for clarity.
Arnd
Powered by blists - more mailing lists