]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
overlayfs: set ctime when setting mtime and atime
authorJeff Layton <jlayton@kernel.org>
Wed, 13 Sep 2023 13:33:12 +0000 (09:33 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Oct 2023 09:13:32 +0000 (11:13 +0200)
commitd03732a4b735822f3a6f8cd11f1eb88efd27ce55
tree93a20260d0ba4b4c3e3d7c8141adbabd436ad05c
parenta72a4432ce9c4a60b36c93e3949aa52cc563f4bd
overlayfs: set ctime when setting mtime and atime

[ Upstream commit 03dbab3bba5f009d053635c729d1244f2c8bad38 ]

Nathan reported that he was seeing the new warning in
setattr_copy_mgtime pop when starting podman containers. Overlayfs is
trying to set the atime and mtime via notify_change without also
setting the ctime.

POSIX states that when the atime and mtime are updated via utimes() that
we must also update the ctime to the current time. The situation with
overlayfs copy-up is analogies, so add ATTR_CTIME to the bitmask.
notify_change will fill in the value.

Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Christian Brauner <brauner@kernel.org>
Acked-by: Amir Goldstein <amir73il@gmail.com>
Message-Id: <20230913-ctime-v1-1-c6bc509cbc27@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/overlayfs/copy_up.c