[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231008004929.3767992-8-sashal@kernel.org>
Date: Sat, 7 Oct 2023 20:49:25 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Jeff Layton <jlayton@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
Christian Brauner <brauner@...nel.org>,
Amir Goldstein <amir73il@...il.com>,
Sasha Levin <sashal@...nel.org>, miklos@...redi.hu,
linux-unionfs@...r.kernel.org
Subject: [PATCH AUTOSEL 6.1 08/12] overlayfs: set ctime when setting mtime and atime
From: Jeff Layton <jlayton@...nel.org>
[ 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@...nel.org>
Signed-off-by: Jeff Layton <jlayton@...nel.org>
Tested-by: Nathan Chancellor <nathan@...nel.org>
Acked-by: Christian Brauner <brauner@...nel.org>
Acked-by: Amir Goldstein <amir73il@...il.com>
Message-Id: <20230913-ctime-v1-1-c6bc509cbc27@...nel.org>
Signed-off-by: Christian Brauner <brauner@...nel.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
fs/overlayfs/copy_up.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
index e6d711f42607b..86d4b6975dbcb 100644
--- a/fs/overlayfs/copy_up.c
+++ b/fs/overlayfs/copy_up.c
@@ -300,7 +300,7 @@ static int ovl_set_timestamps(struct ovl_fs *ofs, struct dentry *upperdentry,
{
struct iattr attr = {
.ia_valid =
- ATTR_ATIME | ATTR_MTIME | ATTR_ATIME_SET | ATTR_MTIME_SET,
+ ATTR_ATIME | ATTR_MTIME | ATTR_ATIME_SET | ATTR_MTIME_SET | ATTR_CTIME,
.ia_atime = stat->atime,
.ia_mtime = stat->mtime,
};
--
2.40.1
Powered by blists - more mailing lists