]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
fuse2fs: update new child timestamps during mkdir/symlink
authorDarrick J. Wong <djwong@kernel.org>
Thu, 24 Apr 2025 21:43:54 +0000 (14:43 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 9 Jun 2025 20:53:09 +0000 (16:53 -0400)
These two file creation functions fail to update the timestamps of the
new child file, unlike the others (mknod/creat).  Fix that.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/174553065141.1160461.7342685341356901806.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
(cherry picked from commit f73fbf8e2cee1f2d49f4e7573eadb9f1cf141879)

misc/fuse2fs.c

index 238804dd4565ede4cc9b26efe3f8aa47b8a69a66..d123eebb151123e32385a1bb16b586526028fd2a 100644 (file)
@@ -976,6 +976,7 @@ static int op_mkdir(const char *path, mode_t mode)
        inode.i_mode = LINUX_S_IFDIR | (mode & ~S_ISUID) |
                       parent_sgid;
        inode.i_generation = ff->next_generation++;
+       init_times(&inode);
 
        err = ext2fs_write_inode_full(fs, child, (struct ext2_inode *)&inode,
                                      sizeof(inode));
@@ -1349,6 +1350,7 @@ static int op_symlink(const char *src, const char *dest)
        inode.i_gid = ctxt->gid;
        ext2fs_set_i_gid_high(inode, ctxt->gid >> 16);
        inode.i_generation = ff->next_generation++;
+       init_times(&inode);
 
        err = ext2fs_write_inode_full(fs, child, (struct ext2_inode *)&inode,
                                      sizeof(inode));