From: Andreas Dilger on
On 2010-06-28, at 10:26, David Howells wrote:
> Make the file creation time, inode data version number and inode generation
> number available on Ext4 by as xattrs named:
>
> file.crtime
> file.i_generation
> file.i_version (directories only for ext4)

Some minor nits:
- I'd prefer calling these "file.generation" and "file.version".
I don't think there is value in the "i_" prefix adds anything,
and it seems more like an internal detail to me
- why not expose the ".version" field for regular files? It seems
that all of them are applicable for all file types.
- it would be good to not introduce a new xattr namespace, since
tools like tar (even the RHEL-patched one) will not backup and
restore these namespaces. Using "trusted." would allow them to
be backed up and restored using existing xattr-patched GNU tar
by root, but wouldn't allow them to be modified by regular users.
I think this is important for proper backup/restore of a filesystem,
but can have correctness implications and shouldn't be accessible
to regular users.

> file.crtime=0x53ba244c000000000000000000000000

Is this a binary (host-endian) struct timespec?

> file.i_generation=0x0000000000000000

This seems odd, i_generation should never be zero, AFAIK.

Cheers, Andreas





--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: David Howells on
Andreas Dilger <adilger(a)dilger.ca> wrote:

> - I'd prefer calling these "file.generation" and "file.version".
> I don't think there is value in the "i_" prefix adds anything,
> and it seems more like an internal detail to me

That's reasonable.

> - why not expose the ".version" field for regular files? It seems
> that all of them are applicable for all file types.

Because Ext4 doesn't support it for anything other than directories.

> - it would be good to not introduce a new xattr namespace, since
> tools like tar (even the RHEL-patched one) will not backup and
> restore these namespaces. Using "trusted." would allow them to
> be backed up and restored using existing xattr-patched GNU tar
> by root, but wouldn't allow them to be modified by regular users.
> I think this is important for proper backup/restore of a filesystem,
> but can have correctness implications and shouldn't be accessible
> to regular users.

Does backing them up make sense, though? They are filesystem structural
attributes. Can you restore the inode number, for example? If not, then you
can't restore i_generation either. Restoring i_version might make sense, but
what if it winds i_version backwards whilst maintaining i_ino and i_generation,
that means there'll be a time in the future where the three values are once
again what might have been already published - and may already be in someone's
persistent cache.

> > file.crtime=0x53ba244c000000000000000000000000
>
> Is this a binary (host-endian) struct timespec?

Yes. That might not be the best representation, however. It could also be,
say "<decimal-secs>.<decimal-nsecs>", eg: "1234.000000567".

> > file.i_generation=0x0000000000000000
>
> This seems odd, i_generation should never be zero, AFAIK.

That might be because it's the root directory, and so cannot be replaced.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: David Howells on
Jeremy Allison <jra(a)samba.org> wrote:

> We already have code in Samba to detect "birthtime"
> (st_btime) as a returned member of a stat struct.

Is it, though?

Googling for st_btime suggests it could also be taken as the time last
archived. That may just be a NetWareism though.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: David Howells on
Jeremy Allison <jra(a)samba.org> wrote:

> > Googling for st_btime suggests it could also be taken as the time last
> > archived. That may just be a NetWareism though.
>
> It's a *BSD'ism.

I meant that st_btime meaning "last archive time" may be a NetWareism. That
seems to get more hits than anything else.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/