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 23B4AEE020B for ; Wed, 13 Sep 2023 19:57:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232500AbjIMT5k (ORCPT ); Wed, 13 Sep 2023 15:57:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229642AbjIMT5i (ORCPT ); Wed, 13 Sep 2023 15:57:38 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EE9D9E; Wed, 13 Sep 2023 12:57:34 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57B0AC433CC; Wed, 13 Sep 2023 19:57:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694635053; bh=8s2Z1d1m3xuRoijuegAF7XDzYLIWy1+XSu3/xCTkOGU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bKNQUkL1wCDZ/gm59APeTdRTYc1TQhIDHGTt+vC8/7wftu+kCz5uohuq79uNm62eS uEeqVtIu5SN8F8Jqs8GfRUbQVgSdWaJanEGOw4VkV426meePVQmAvqG1P83G6n2u4g GlqylAHiVR/yZxYYVQJAAFCWyiAhXhzstAY9+OCq23xLvlrqDaxRbRVtUa7XAaXwDm 8KakiD8ydMsHMy4mP/KC8SeBWBkXsryAsC2to77GPy/wm8dSIGWcvzld5Ljm+8Nc9j kqrZeCZvK163CtW4GRTIb7S+QSKYmDyQn7i4HLTkpaz6mh/pFndc22UxzhORnsznAl aBCfHLzvi8LBA== Date: Wed, 13 Sep 2023 12:57:31 -0700 From: Nathan Chancellor To: Jeff Layton Cc: Miklos Szeredi , Amir Goldstein , Christian Brauner , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] overlayfs: set ctime when setting mtime and atime Message-ID: <20230913195731.GA2922283@dev-arch.thelio-3990X> References: <20230913-ctime-v1-1-c6bc509cbc27@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230913-ctime-v1-1-c6bc509cbc27@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 13, 2023 at 09:33:12AM -0400, Jeff Layton wrote: > 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 I applied this patch on top of next-20230913 and I do not see the warning I reported on any of my machines. Thanks for the quick fix! Tested-by: Nathan Chancellor > --- > The new WARN_ON_ONCE in setattr_copy_mgtime caught a bug! Fix up > overlayfs to ensure that the ctime on the upper inode is also updated > when copying up the atime and mtime. > --- > 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 d1761ec5866a..ada3fcc9c6d5 100644 > --- a/fs/overlayfs/copy_up.c > +++ b/fs/overlayfs/copy_up.c > @@ -337,7 +337,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, > }; > > --- > base-commit: 9cb8e7c86ac793862e7bea7904b3426942bbd7ef > change-id: 20230913-ctime-299173760dd9 > > Best regards, > -- > Jeff Layton >