diff options
author | Eric Sandeen <sandeen@redhat.com> | 2010-12-19 22:10:31 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-12-19 22:10:31 -0500 |
commit | af0b44a1970fed1cda31d2969c99c46ffc515160 (patch) | |
tree | b382d80df604c0bbd61836c13ae0b6f3020728e5 /fs/ext4/ext4.h | |
parent | cad3f00763dcf9dfc62cbddf4bd714ab5a71a0eb (diff) |
ext4: zero out nanosecond timestamps for small inodes
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.
EXT4_INODE_GET_XTIME should zero out tv_nsec when EXT4_FITS_IN_INODE
evaluates to false.
Reported-by: Jordan Russell <jr-list-2010@quo.to>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 49f1ceaac57d..8104ab7eb7d4 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -693,6 +693,8 @@ do { \ | |||
693 | if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) \ | 693 | if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) \ |
694 | ext4_decode_extra_time(&(inode)->xtime, \ | 694 | ext4_decode_extra_time(&(inode)->xtime, \ |
695 | raw_inode->xtime ## _extra); \ | 695 | raw_inode->xtime ## _extra); \ |
696 | else \ | ||
697 | (inode)->xtime.tv_nsec = 0; \ | ||
696 | } while (0) | 698 | } while (0) |
697 | 699 | ||
698 | #define EXT4_EINODE_GET_XTIME(xtime, einode, raw_inode) \ | 700 | #define EXT4_EINODE_GET_XTIME(xtime, einode, raw_inode) \ |
@@ -703,6 +705,8 @@ do { \ | |||
703 | if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime ## _extra)) \ | 705 | if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime ## _extra)) \ |
704 | ext4_decode_extra_time(&(einode)->xtime, \ | 706 | ext4_decode_extra_time(&(einode)->xtime, \ |
705 | raw_inode->xtime ## _extra); \ | 707 | raw_inode->xtime ## _extra); \ |
708 | else \ | ||
709 | (einode)->xtime.tv_nsec = 0; \ | ||
706 | } while (0) | 710 | } while (0) |
707 | 711 | ||
708 | #define i_disk_version osd1.linux1.l_i_version | 712 | #define i_disk_version osd1.linux1.l_i_version |