On 64bit systems, using ext4 to store inode times for after the 32bit time rollover doesn't work as expected. Setting a date with a time too big for 32bits can still result in time wrapping around when read back from disk. This is do to the sign extension performed in EXT4_INODE_GET_XTIME(). The sign extension causes any time with the 32nd bit set to be sign extended and have a time before 1970. For the case where there isn't any extra time storage area, this patch leaves the sign extension as is. In the event there is the >32 bit time bits in the inode, the ext4_decode_extra_time() is patched to clear the upper 32 time bits, set the extra time bits, and perform a sign extension if needed. The patch also alters ext4_encode_extra_time() for 32bit systems. Previously, the extra time bits were never set on 32bit system. The patch now sets them so that times will remain the same when migrating an ext4 filesystem from a 32bit system to a 64bit system. Signed-off-by: David Jeffery <dhjeffery@xxxxxxxxx> --- diffstat ext4_extra_time_fix.patch ext4.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
Attachment:
ext4_extra_time_fix.patch
Description: Binary data