lkml.org 
[lkml]   [2021]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH 5.14 298/334] time: Handle negative seconds correctly in timespec64_to_ns()
    Date
    On Thu, Sep 16 2021 at 22:57, Arnd Bergmann wrote:
    > On Thu, Sep 16, 2021 at 6:50 PM OPENSOURCE Lukas Hannen
    > <lukas.hannen@opensource.tttech-industrial.com> wrote:
    > I did stumble over one small detail:
    >
    > if (ts->tv_sec <= KTIME_SEC_MIN)
    > return KTIME_MIN;
    >
    > I think this is not entirely correct for the case of tv_sec==KTIME_SEC_MIN
    > with a nonzero tv_nsec, as we now round down to the full second. Not sure
    > if that's worth changing, as we also round up for any value between
    > KTIME_SEC_MAX*NSEC_PER_SEC and KTIME_MAX, or between
    > KTIME_MIN and KTIME_SEC_MIN*NSEC_PER_SEC.
    > In practice I guess we care very little about the last nanosecond in the corner
    > cases.

    It's completely irrelevant whether the result is off by one second
    related to the 292 years limit.

    Thanks,

    tglx

    \
     
     \ /
      Last update: 2021-09-17 00:40    [W:4.777 / U:0.140 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site