From owner-freebsd-fs@freebsd.org Tue Jun 21 17:18:41 2016 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FE71AC4F94 for ; Tue, 21 Jun 2016 17:18:41 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2205827F5; Tue, 21 Jun 2016 17:18:40 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-242-176.lns20.per4.internode.on.net [121.45.242.176]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id u5LHISxB093782 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 21 Jun 2016 10:18:31 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: futimens and utimensat vs birthtime (resurrected) To: Kirk McKusick References: <201508142122.t7ELMPjR002452@chez.mckusick.com> <56401002.8020909@freebsd.org> Cc: "freebsd-fs@freebsd.org" , "'Jilles Tjoelker'" , John Baldwin From: Julian Elischer Message-ID: Date: Wed, 22 Jun 2016 01:18:22 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <56401002.8020909@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 17:18:41 -0000 bringing this up again. see below for new info.. On 9/11/2015 11:16 AM, Julian Elischer wrote: > On 8/15/15 5:22 AM, Kirk McKusick wrote: >>> From: John Baldwin >>> To: freebsd-current@freebsd.org >>> Subject: Re: futimens and utimensat vs birthtime >>> Date: Fri, 14 Aug 2015 10:39:41 -0700 >>> Cc: "freebsd-fs@freebsd.org" , >>> "'Jilles Tjoelker'" >>> >>> On Friday, August 14, 2015 10:46:10 PM Julian Elischer wrote: >>>> I would like to implement this call. but would like input as to it's >>>> nature. >>>> The code inside the system would already appear to support handling >>>> three elements, though it needs some scrutiny, >>>> so all that is needed is a system call with the ability to set the >>>> birthtime directly. >>>> >>>> Whether it should take the form of the existing calls but expecting >>>> three items is up for discussion. >>>> Maybe teh addition of a flags argument to specify which items are >>>> present and which to set. >>>> >>>> ideas? >>> I believe these should be new calls. Only utimensat() provides a >>> flag >>> argument, but it is reserved for AT_* flags. I would be fine with >>> something like futimens3() and utimensat3() (where 3 means "three >>> timespecs"). Jilles implemented futimens() and utimensat(), so he >>> might have ideas as well. I would probably stick the birth time in >>> the third (final) timespec slot to make it easier to update new code >>> (you can use an #ifdef just around ts[2] without having to #ifdef the >>> entire block). >>> >>> -- >>> John Baldwin >> I concur with John's suggestion. Add a new system call with three >> argument set of times specifying birthtime as the last one. I >> proposed doing this when I added birthtime, but did not as the >> sentiment at the time was that it would gratuitously make FreeBSD >> written applications less portable if they used this new non-standard >> system call. > > time has passed and I would like to get back to this: > There was some feedback last time. Taking that into account: > > One problem with the '3 arg' version is that we have to reinvent it > again if we get a 4th. > We could make something like the following: > > It has been suggested that a 4th entry might be "last archive time" > and that > "time created on this filesystem" and "file created first time > (ever)" might also > be separate in some systems. (as examples of why 3 might not be enough) ok, so a real 4th arg has turned up it turns out that to be really compatible with windows servers and if you are running a filesystem capable of doing it.. then you need to be able to stamp the "change time". Apparently Windows does this an there are applications that require it. I believe that most filesystems would simply not do this but at $JOB we have our own FS and it CAN do this. we just need a way to interface to it. So now we have 4 real and a hypothetical timestamps. access time modification time birth/creation time change time (archive time) The filesystem would have to support changing ctime, and you'd have to have some other safeguards but does anyone have any comments on the example below? Does anyone know what people like netapp and panasas do? isilon? > > the syscall name is also not decided. (fsetnstimes()) > one suggested form is: > $name (int fd, int32 flags/mask, const struct timespec *arrayptr[]); > > vs the current: > utimensat(int fd, const char *path, const struct timespec times[2], > int flag); > > where mask is: > --- > 0x01 disable_heuristic > 0x02 AT_SYMLINK_NOFOLLOW > 0x04-0x08 unused > -- times present--- > 0x10 access time > 0x20 mod time > 0x40 birth time > 0x80 change time > 0x100 archive time > 0x200-on reserverd for future times > > any bit not set in 0x010-on is not represented in the array. > no bits would be a nop (the price for orthogonality) and would > effectively be the same as a test for writeability. > "disable heuristic" would disable the forcing of birthtime back to > mod time or earlier (and any other 'logical fixes') > setting all 5 'time-present' bits would imply the array has 5 entries. > > anyone care to comment ? >> >> Kirk McKusick >> >