mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 03:50:53 +07:00
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>
This commit is contained in:
parent
cad3f00763
commit
af0b44a197
@ -693,6 +693,8 @@ do { \
|
||||
if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) \
|
||||
ext4_decode_extra_time(&(inode)->xtime, \
|
||||
raw_inode->xtime ## _extra); \
|
||||
else \
|
||||
(inode)->xtime.tv_nsec = 0; \
|
||||
} while (0)
|
||||
|
||||
#define EXT4_EINODE_GET_XTIME(xtime, einode, raw_inode) \
|
||||
@ -703,6 +705,8 @@ do { \
|
||||
if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime ## _extra)) \
|
||||
ext4_decode_extra_time(&(einode)->xtime, \
|
||||
raw_inode->xtime ## _extra); \
|
||||
else \
|
||||
(einode)->xtime.tv_nsec = 0; \
|
||||
} while (0)
|
||||
|
||||
#define i_disk_version osd1.linux1.l_i_version
|
||||
|
Loading…
Reference in New Issue
Block a user