[PATCH][e2fsprogs] fix 0 file creation time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



$ lsattr -c
1970-01-01 08:00:00.0 +0800 --------------- ./lost+found

It turns out that the crtime of files created by e2fsprogs is 0.

Signed-off-by: Li Zefan <lizf@xxxxxxxxxxxxxx>
---
 lib/ext2fs/inode.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/ext2fs/inode.c b/lib/ext2fs/inode.c
index ba15dda..66ddae4 100644
--- a/lib/ext2fs/inode.c
+++ b/lib/ext2fs/inode.c
@@ -767,6 +767,7 @@ errcode_t ext2fs_write_new_inode(ext2_filsys fs, ext2_ino_t ino,
 	large_inode = (struct ext2_inode_large *) buf;
 	large_inode->i_extra_isize = sizeof(struct ext2_inode_large) - 
 		EXT2_GOOD_OLD_INODE_SIZE;
+	large_inode->i_crtime = large_inode->i_atime;
 
 	retval = ext2fs_write_inode_full(fs, ino, buf, size);
 	free(buf);
-- 
1.5.4.rc3
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux