From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?Bj=F6rn?= Jacke Subject: Re: [PATCH 02/18] xstat: Add a pair of system calls to make extended file stats available [ver #6] Date: Fri, 23 Jul 2010 11:14:53 +0200 Message-ID: References: <20100715021712.5544.44845.stgit@warthog.procyon.org.uk> <30448.1279800887@redhat.com> <20100722162712.GB10352@jeremy-laptop> <19528.60019.28495.655512@samba.org> <20100723012130.GD16373@thunk.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE To: Ted Ts'o , tridge-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org, Linus Torvalds , Jeremy Allison , linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Volk Return-path: Content-Disposition: inline In-Reply-To: <20100723012130.GD16373-AKGzg7BKzIDYtjvyW6yDsg@public.gmane.org> Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: On 2010-07-22 at 21:21 -0400 Ted Ts'o sent off: > Well, not POSIX, because POSIX doesn't have CreationTime at all. > BSD's birthtime doesn't allow it to be set, and the question here is > largely philosophical. actually, it can (partly :). But the way it can be done is an insane ha= ck: To provide a sensible birth time for applications that are unaware of t= he birth time attribute, we changed the semantics of the "utimes" system call so= that if the birth time was newer than the value of the modification time that i= t was setting, it sets the birth time to the same time as the modification ti= me. An application that is aware of the birth time attribute can set both the = birth time and the modification time by doing two calls to "utimes". First it= calls "utimes" with a modification time equal to the saved birth time, then i= t calls "utimes" a second time with a modification time equal to the (presumabl= y newer) saved modification time. Thus it can also be only be set more in the past. Cheers Bj=F6rn --=20 SerNet GmbH, Bahnhofsallee 1b, 37081 G=F6ttingen phone: +49-551-370000-0, fax: +49-551-370000-9 AG G=F6ttingen, HRB 2816, GF: Dr. Johannes Loxen From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.SerNet.de ([193.175.80.2]:39012 "EHLO mail.SerNet.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753033Ab0GWJWN (ORCPT ); Fri, 23 Jul 2010 05:22:13 -0400 Date: Fri, 23 Jul 2010 11:14:53 +0200 From: =?iso-8859-1?Q?Bj=F6rn?= Jacke To: "Ted Ts'o" , tridge@samba.org, Linus Torvalds , Jeremy Allison , linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, Volker.Lendecke@SerNet.DE, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, Jan Engelhardt , David Howells , viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org Subject: Re: [PATCH 02/18] xstat: Add a pair of system calls to make extended file stats available [ver #6] References: <20100715021712.5544.44845.stgit@warthog.procyon.org.uk> <30448.1279800887@redhat.com> <20100722162712.GB10352@jeremy-laptop> <19528.60019.28495.655512@samba.org> <20100723012130.GD16373@thunk.org> Content-Type: text/plain; charset=iso-8859-1 In-Reply-To: <20100723012130.GD16373@thunk.org> Message-Id: Sender: linux-nfs-owner@vger.kernel.org List-ID: MIME-Version: 1.0 On 2010-07-22 at 21:21 -0400 Ted Ts'o sent off: > Well, not POSIX, because POSIX doesn't have CreationTime at all. > BSD's birthtime doesn't allow it to be set, and the question here is > largely philosophical. actually, it can (partly :). But the way it can be done is an insane hack: To provide a sensible birth time for applications that are unaware of the birth time attribute, we changed the semantics of the "utimes" system call so that if the birth time was newer than the value of the modification time that it was setting, it sets the birth time to the same time as the modification time. An application that is aware of the birth time attribute can set both the birth time and the modification time by doing two calls to "utimes". First it calls "utimes" with a modification time equal to the saved birth time, then it calls "utimes" a second time with a modification time equal to the (presumably newer) saved modification time. Thus it can also be only be set more in the past. Cheers Björn -- SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen phone: +49-551-370000-0, fax: +49-551-370000-9 AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen