[lug] question about ext 2/3 fs

Zan Lynx zlynx at acm.org
Wed Oct 18 21:29:43 MDT 2006


On Wed, 2006-10-18 at 15:21 -0600, Paul E Condon wrote:
> I'm having a problem with mtime handling in coreutils. I won't
> give details of that problem, but ...
> 
> I look into how Linux keeps track of mtime for files. I find
> that it is stored in the inode of the file, and that 64 bits are
> allocated for the number of seconds since the Unix epoch.
> Fine but somehow 'ls --full-time' displays a fractional part of
> a second right down to a nanosecond (9digits!). Where is this
> stored? It haven't seen any mention of it. Where is the way
> its done documented?

I am pretty sure ext2 doesn't have nanosecond storage but ext3 does.
Where it is I am not sure.  You'll also get nanosecond timestamps for
all files that are in cache memory.  The Linux VFS stores it for
everybody, even FAT.

This can lead to Heisen-bug problems on multi-processor machines doing
forked makes on old filesystems, because when memory pressure gets high,
some files lose their high-precision timestamps and Make cannot decide
if they're older or newer.

Huh, weird.  I just looked in the code for linux-2.6.19-rc2-mm1 and I do
not see support for nanoseconds in any filesystem but Reiser4 and
OCFS2.  I was sure there were more.

-- 
Zan Lynx <zlynx at acm.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20061018/1d62e00d/attachment.pgp>


More information about the LUG mailing list