From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5707DE95A87 for ; Sun, 8 Oct 2023 00:53:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234237AbjJHAx4 (ORCPT ); Sat, 7 Oct 2023 20:53:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344306AbjJHAxb (ORCPT ); Sat, 7 Oct 2023 20:53:31 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFC2A26AD; Sat, 7 Oct 2023 17:51:52 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05603C4167D; Sun, 8 Oct 2023 00:50:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696726247; bh=YyfUth6wYtBqZbQ3zXY8oAjRt7Q3DhLoD/Yttggwqe4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jWeoxmzRHnausWiLV8VIoaiitWKphq7IFvurMByjXwfQPJmz1a+QFvzZt4bqgYag/ jxeiXJrMrp/tLFgTnOD+3/mVGr5HHsYqSrjLglbKJH+LaTZ/pVrx90/8KSlpT1PAW/ f6HNT5JWCxwu0v1b7KXNzf+6krHq+1Nj8cvAxGW7ImXM2YQ03DLrI8NqDhyMmA8SWR X1XtE1b5NmmhzyeRYdUwXqZm9TKlkxwvdABT7va44TqJltf30qem1ZItH8+wNxOXMO jrmixLqAcWmXZI+GsIZzL4sqsnbK3QXUF7c8u2tXg9Vjt9vLLjoG2j0p9A7inFDzWn 9TxLG3SzGKQWg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jeff Layton , Nathan Chancellor , Christian Brauner , Amir Goldstein , Sasha Levin , miklos@szeredi.hu, linux-unionfs@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 5/8] overlayfs: set ctime when setting mtime and atime Date: Sat, 7 Oct 2023 20:50:35 -0400 Message-Id: <20231008005039.3768522-5-sashal@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231008005039.3768522-1-sashal@kernel.org> References: <20231008005039.3768522-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 4.19.295 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-unionfs@vger.kernel.org From: Jeff Layton [ 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 Signed-off-by: Jeff Layton Tested-by: Nathan Chancellor Acked-by: Christian Brauner Acked-by: Amir Goldstein Message-Id: <20230913-ctime-v1-1-c6bc509cbc27@kernel.org> Signed-off-by: Christian Brauner Signed-off-by: Sasha Levin --- 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 3d7a700350c1d..debcac35a51dc 100644 --- a/fs/overlayfs/copy_up.c +++ b/fs/overlayfs/copy_up.c @@ -195,7 +195,7 @@ static int ovl_set_timestamps(struct dentry *upperdentry, struct kstat *stat) { 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