From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751503AbdFZSRc (ORCPT ); Mon, 26 Jun 2017 14:17:32 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:33858 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751308AbdFZSRZ (ORCPT ); Mon, 26 Jun 2017 14:17:25 -0400 MIME-Version: 1.0 In-Reply-To: <20170626023525.GY10672@ZenIV.linux.org.uk> References: <20170624184508.21500-1-deepa.kernel@gmail.com> <20170626023525.GY10672@ZenIV.linux.org.uk> From: Deepa Dinamani Date: Mon, 26 Jun 2017 11:17:13 -0700 Message-ID: Subject: Re: [PATCH v3 0/7] Isolate time_t data types for clock/timer syscalls To: Al Viro Cc: Thomas Gleixner , Linux Kernel Mailing List , John Stultz , Nicolas Pitre , Arnd Bergmann , y2038 Mailman List , Linux FS-devel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 25, 2017 at 7:35 PM, Al Viro wrote: > On Sat, Jun 24, 2017 at 11:45:01AM -0700, Deepa Dinamani wrote: >> The series aims at isolating data conversions of time_t based structures: >> struct timespec and struct itimerspec at user space boundaries. >> This helps to later change the underlying types to handle y2038 changes >> to these. > > Nice... A few questions: > > * what about setitimer(2)? Right now that's the only remaining user of > get_compat_itimerval(); similar for getitimer(2) and put_compat_itimerval(). We do not plan to support these beyond y2038 on 32 bit systems. timer_settime() and timer_gettime() are considered to be replacements for these, respectively. There is also going to be a cleanup of timeval/ timespec/ time_t data types and apis after the new syscalls are ready. At that time I might choose to get rid of these itimerval apis. I'm not sure yet. > * you have two callers of get_compat_itimerspec64(); one is followed by > itimerspec64_valid(), another - by its open-coded analogue. The same > goes for get_itimerspec64(); wouldn't it be better to have both check > the validity immediately and simply fail with -EINVAL? Matter of taste, > but... This is what I thought also. And, in fact this is how I had it in one of the earlier version of my series. But, the utimensat(2) is what I consider provides a counter example of why this is a bad idea. There is no reason you should not be able to read the itimerspec64 and not check for validity soon after. Meaning there can be special markers like UTIME_NOW and UTIME_OMIT in the nanosecond field which will make the validity check fail. But, is perfectly normal for the syscall under consideration. > * should __sys_recvmmsg() switch to timespec64? Socket timestamps will be handled in a different series. These could be done a few ways like adding a new flag to recv syscall variants or defining new timestamp types. The above call will be changed at that time. -Deepa