From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mingming Subject: Re: ext4 - getting at birth time (file create time) and getting/setting nanosecond time stamps and utime Date: Wed, 21 Oct 2009 16:42:39 -0700 Message-ID: <1256168559.6404.14.camel@mingming-laptop> References: <524f69650910191017j7883ed7bvdb0329d1a73f34e4@mail.gmail.com> <524f69650910191245t2eb7ffb2r770a7373ec2ba1e3@mail.gmail.com> <5715838A-4568-4273-B1C1-983B348580B6@sun.com> <524f69650910191524k5c9d766fu430c4f7b17d86952@mail.gmail.com> <890110E9-FA69-4356-9BEB-925F98487C52@sun.com> <4ADDB09D.5000707@hp.com> <6E5D19DA-64C5-4A44-9DF4-BEF2AA8DD8AB@sun.com> <524f69650910201349w20a3145cm6b88cd4029912b6b@mail.gmail.com> <0D2A558D-C332-4C82-999A-A29B740C2008@sun.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Steve French , jim owens , linux-fsdevel , samba-technical To: Andreas Dilger Return-path: Received: from e34.co.us.ibm.com ([32.97.110.152]:43398 "EHLO e34.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751622AbZJUXp6 (ORCPT ); Wed, 21 Oct 2009 19:45:58 -0400 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by e34.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id n9LNfFSr024247 for ; Wed, 21 Oct 2009 17:41:15 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n9LNjwmM124828 for ; Wed, 21 Oct 2009 17:45:58 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id n9LNjs0r023083 for ; Wed, 21 Oct 2009 17:45:55 -0600 In-Reply-To: <0D2A558D-C332-4C82-999A-A29B740C2008@sun.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, 2009-10-20 at 18:44 -0600, Andreas Dilger wrote: > On 20-Oct-09, at 14:49, Steve French wrote: > > On Tue, Oct 20, 2009 at 3:33 PM, Andreas Dilger > > wrote: > >> For those users/admins that want to be able to change this (due to > >> Samba, or whatever), great, we can give them this ability, but for > >> users who do NOT want regular users to be able to change the file > >> creation timestamp, that should be possible as well. > > > > So, are we ready for Mingming or one of the ext4 developers to propose > > a patch for this via xattrs (I can do a similar one for cifs). > > Sounds like various have said: > > > > 1) xattrs instead of ioctl > > 2) get of create time allowed by default, but set of create time > > limited > > > A wildly untested/uncompiled patch is attached for purposes of > discussion. > One issue that I've already come across is if we are storing a raw > "timespec" > we will get different xattrs on disk in the fallback case where the on- > disk > inodes are not large enough to store the crtime inside the inode. > > This version of the patch will fall back to storing the timespec on disk > in the supplied size/endianness as an xattr, but it definitely needs > to be > handled more appropriately (endian/word size). It _would_ be nice to > store > a full 64-bit timespec on disk, but given that the in-inode format > only can > handle 34 bits of seconds + 30 bits of nanoseconds, it isn't clear > whether > the "fallback" should do better than that. > Could we transparently convert user provided raw creation time and store the same format as whose in-inode creation timestamp in the fallback case? Just to be consistent. User doesn't have to know what type/size of ext4 inode it is accessing... > The main question is whether storing a "user.crtime" as an on-disk xattr > is a desirable fallback, or if this should just fail? I think it would be nice to have this fallback, just be consistent, that for all type of ext4 inodes there is a way to set file creation time for allowed users(whether default 256 bytes large inode which could store the 34+30bit creation time, or the 128 bytes smaller inode, which doesn't have space to store the creation in the inode) Regards, Mingming > Similarly, should > the lack of on-disk crtime return "0.0" as the creation time, or should > it return -ENODATA or similar? > Cheers, Andreas > -- > Andreas Dilger > Sr. Staff Engineer, Lustre Group > Sun Microsystems of Canada, Inc.