NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/48449: y2038 shortcomings of ffsv1

>Number:         48449
>Category:       kern
>Synopsis:       y2038 shortcomings of ffsv1
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 15 07:25:00 +0000 2013
>Originator:     David A. Holland
>Release:        NetBSD 6.99.28 (20131214)

ffsv1 stores 32-bit times on disk. This is not fixable (solution is to
use ffsv2) but we ought to have a scheme in place where the 32-bit
times that are read and written are interpreted as current.


Make an ffsv1 volume, set the date to 2040 and create some files. See
PR 48437 for an example seen in practice.


When 32-bit times are read in, instead of just sign-extending them as
currently appears to happen, paste on the top half of the current
64-bit time and then possibly adjust up or down by 0x100000000. There
are then several possible ways to pick the adjustment; one can match
on bits 30/31 of both times, or pick the version that's nearest the
current time; or assume that since file timestamps are rarely in the
future any time that would be more than a month or so in the future
should be interpreted in the past instead.

(This is basically the same as the y2k problem of deciding how to
interpret 2-digit years based on the current year, and I think a
standard scheme was eventually chosen for that but I forget what it
is; it should probably be replicated in binary for y2038.)

Home | Main Index | Thread Index | Old Index