[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a2sAwjQfkW9rLjYkb=TnoKTuqhJ5rMJZK8AWw8O0qtsVg@mail.gmail.com>
Date: Mon, 31 Jul 2017 16:09:53 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Deepa Dinamani <deepa.kernel@...il.com>
Cc: Al Viro <viro@...iv.linux.org.uk>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux FS-devel Mailing List <linux-fsdevel@...r.kernel.org>,
y2038 Mailman List <y2038@...ts.linaro.org>
Subject: Re: [PATCH v2 4/6] ipc: sem: Make sem_array timestamps y2038 safe
On Mon, Jul 31, 2017 at 12:30 AM, Deepa Dinamani <deepa.kernel@...il.com> wrote:
> time_t is not y2038 safe. Replace all uses of
> time_t by y2038 safe time64_t.
>
> Similarly, replace the calls to get_seconds() with
> y2038 safe ktime_get_real_seconds().
> Note that this preserves fast access on 64 bit systems,
> but 32 bit systems need sequence counters.
>
> The syscall interface themselves are not changed as part of
> the patch. They will be part of a different series.
>
> Signed-off-by: Deepa Dinamani <deepa.kernel@...il.com>
Looks good. One detail:
> @@ -2310,7 +2310,7 @@ static int sysvipc_sem_proc_show(struct seq_file *s, void *it)
> sem_otime = get_semotime(sma);
>
> seq_printf(s,
> - "%10d %10d %4o %10u %5u %5u %5u %5u %10lu %10lu\n",
> + "%10d %10d %4o %10u %5u %5u %5u %5u %10llu %10llu\n",
> sma->sem_perm.key,
> sma->sem_perm.id,
> sma->sem_perm.mode,
> @@ -2319,8 +2319,8 @@ static int sysvipc_sem_proc_show(struct seq_file *s, void *it)
> from_kgid_munged(user_ns, sma->sem_perm.gid),
> from_kuid_munged(user_ns, sma->sem_perm.cuid),
> from_kgid_munged(user_ns, sma->sem_perm.cgid),
> - sem_otime,
> - sma->sem_ctime);
> + (unsigned long long) sem_otime,
> + (unsigned long long) sma->sem_ctime);
>
Unless I'm missing something here, you can drop the cast to
unsigned long long: time64_t is always 'long long' and won't
cause a warning here.
We only need a cast like this when printing the members of 'struct
timespec64', since that can be either 'long long' or 'long', when
it is defined as an alias for timespec.
Arnd
Powered by blists - more mailing lists