bfs: update ctime in addition to mtime when adding entries
authorJeff Layton <jlayton@kernel.org>
Wed, 5 Jul 2023 19:00:29 +0000 (15:00 -0400)
committerChristian Brauner <brauner@kernel.org>
Mon, 10 Jul 2023 08:04:51 +0000 (10:04 +0200)
When adding entries to a directory, POSIX generally requires that the
ctime be updated alongside the mtime.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Message-Id: <20230705190309.579783-2-jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/bfs/dir.c

index 040d514..d2e8a2a 100644 (file)
@@ -294,7 +294,7 @@ static int bfs_add_entry(struct inode *dir, const struct qstr *child, int ino)
                                        dir->i_size += BFS_DIRENT_SIZE;
                                        dir->i_ctime = current_time(dir);
                                }
-                               dir->i_mtime = current_time(dir);
+                               dir->i_mtime = dir->i_ctime = current_time(dir);
                                mark_inode_dirty(dir);
                                de->ino = cpu_to_le16((u16)ino);
                                for (i = 0; i < BFS_NAMELEN; i++)