diff options
author | Theodore Ts'o <tytso@mit.edu> | 2014-02-16 19:29:32 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-03-07 00:30:00 -0500 |
commit | 0c9f21983490feb5637990d719e729bf77b99bd1 (patch) | |
tree | 6c9f92ae5ce713283853f5e28e0c1d6c2bec85f6 /fs | |
parent | d6b55805ac4ffbcd63bf74ce572cc7a94f15be9e (diff) |
ext4: don't leave i_crtime.tv_sec uninitialized
commit 19ea80603715d473600cd993b9987bc97d042e02 upstream.
If the i_crtime field is not present in the inode, don't leave the
field uninitialized.
Fixes: ef7f38359 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/ext4.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 7bb2e2e55123..790b14c5f262 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -774,6 +774,8 @@ do { \ | |||
774 | if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime)) \ | 774 | if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime)) \ |
775 | (einode)->xtime.tv_sec = \ | 775 | (einode)->xtime.tv_sec = \ |
776 | (signed)le32_to_cpu((raw_inode)->xtime); \ | 776 | (signed)le32_to_cpu((raw_inode)->xtime); \ |
777 | else \ | ||
778 | (einode)->xtime.tv_sec = 0; \ | ||
777 | if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime ## _extra)) \ | 779 | if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime ## _extra)) \ |
778 | ext4_decode_extra_time(&(einode)->xtime, \ | 780 | ext4_decode_extra_time(&(einode)->xtime, \ |
779 | raw_inode->xtime ## _extra); \ | 781 | raw_inode->xtime ## _extra); \ |