Skip to content

Commit

Permalink
ext4: don't leave i_crtime.tv_sec uninitialized
Browse files Browse the repository at this point in the history
If the i_crtime field is not present in the inode, don't leave the
field uninitialized.

Fixes: ef7f383 ("ext4: Add nanosecond timestamps")
Reported-by: Vegard Nossum <vegard.nossum@oracle.com>
Tested-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@vger.kernel.org
  • Loading branch information
tytso committed Feb 17, 2014
1 parent 3d2660d commit 19ea806
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/ext4/ext4.h
Expand Up @@ -771,6 +771,8 @@ do { \
if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime)) \
(einode)->xtime.tv_sec = \
(signed)le32_to_cpu((raw_inode)->xtime); \
else \
(einode)->xtime.tv_sec = 0; \
if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime ## _extra)) \
ext4_decode_extra_time(&(einode)->xtime, \
raw_inode->xtime ## _extra); \
Expand Down

0 comments on commit 19ea806

Please sign in to comment.