All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jordan Russell <jr-list-2010@quo.to>
To: linux-ext4@vger.kernel.org
Subject: Garbage returned in nanosecond component of timestamps
Date: Sat, 20 Nov 2010 00:22:48 -0600	[thread overview]
Message-ID: <4CE76938.8050304@quo.to> (raw)

[Fedora 14 with vendor kernel 2.6.35.6-48.fc14.i686.PAE]

When nanosecond timestamp resolution isn't supported on an ext4
partition (inode size = 128), stat() appears to be returning
uninitialized garbage in the nanosecond component of timestamps.

See the following tests.
Expected: All timestamps should end with '.0000000000'.
Actual: '.0026721629' popping up on a different file each time.

> # tune2fs -l /dev/md0 | fgrep 'Inode size'
> Inode size:               128
> # echo 3 >/proc/sys/vm/drop_caches
> # find / -xdev -type f -printf '%t - %p\n' | fgrep -v '.0000000000'
> Wed Nov  4 16:53:20.0026721629 2009 - /boot/oldconfigs/config-2.6.27.38-170.2.113.fc10.i686.PAE
> # echo 3 >/proc/sys/vm/drop_caches
> # find / -xdev -type f -printf '%t - %p\n' | fgrep -v '.0000000000'
> Thu Nov  8 20:38:30.0026721629 2007 - /boot/oldconfigs/config-2.6.23.1-49.fc8PAE
> # echo 3 >/proc/sys/vm/drop_caches
> # find / -xdev -type f -printf '%t - %p\n' | fgrep -v '.0000000000'
> Thu Aug 12 17:44:51.0026721629 2010 - /lib/firmware/emi26/bitstream.fw
> # echo 3 >/proc/sys/vm/drop_caches
> # find / -xdev -type f -printf '%t - %p\n' | fgrep -v '.0000000000'
> Thu Aug 12 17:44:51.0026721629 2010 - /lib/firmware/slicoss/gbdownload.sys
> # echo 3 >/proc/sys/vm/drop_caches
> # find / -xdev -type f -printf '%t - %p\n' | fgrep -v '.0000000000'
> Fri Nov  5 01:16:32.0026721629 2010 - /boot/grub/e2fs_stage1_5


Shouldn't EXT4_INODE_GET_XTIME zero out tv_nsec when EXT4_FITS_IN_INODE
evaluates to false...?

> #define EXT4_INODE_GET_XTIME(xtime, inode, raw_inode)                          \
> do {                                                                           \
>         (inode)->xtime.tv_sec = (signed)le32_to_cpu((raw_inode)->xtime);       \
>         if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra))     \
>                 ext4_decode_extra_time(&(inode)->xtime,                        \
>                                        raw_inode->xtime ## _extra);            \
> } while (0)

-- 
Jordan Russell

             reply	other threads:[~2010-11-20  6:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-20  6:22 Jordan Russell [this message]
2010-11-20  7:53 ` Garbage returned in nanosecond component of timestamps Eric Sandeen
2010-11-22 17:45 ` [PATCH] ext4: zero out nanosecond timestamps for small inodes Eric Sandeen
2010-12-20  3:11   ` Ted Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CE76938.8050304@quo.to \
    --to=jr-list-2010@quo.to \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.