Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3474292rdb; Wed, 13 Sep 2023 13:11:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFq4RSkE25T6RfUhQWnzUkuk1d5sbBI12N+N0hPoZQ0Yn/FQAisd38eP9Q5XZkxXStF/hAp X-Received: by 2002:a17:903:41cb:b0:1c3:c5b5:8a83 with SMTP id u11-20020a17090341cb00b001c3c5b58a83mr4609773ple.4.1694635870387; Wed, 13 Sep 2023 13:11:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694635870; cv=none; d=google.com; s=arc-20160816; b=kvu16xaGOx2APmZ927Hrrb9nd2VbPuTkEnQK8Om4iSRNKbuAdmGQWaIwB3Z2k5/jb1 rW14mdfaT+m/23SPrzk+w7rtphuduA6xLO8NfIRa9lAoWzL8VvRv1SOER8KzpDiPbnoq JPeas9xE5Ndo9mnaJkvJQhXt05ey6nxF8htrEfW9KM16BO8xs0zww/8ujJIDkUUg1lJv IQCvrl354XSsf+fvF8nk+/ufBqq8SEJSesQn//1LOlHE35d6h8Qzu4PFO16VF8jRdCQZ iRH2EhIyYNr79nexHEINK5JJ2MNSiWTfjmfSf2OljK54GbB1lPXwx8rZxdxurZ3wu7s3 jsxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=g5RDlIQ6RCLCP6G2pOGsY37QGDKxwZMABsCmzLldfwk=; fh=XrSvMaDkbpzIFYf1SwdvE/DhGCnFSLd7JAJkv6jO7to=; b=Zz9FoSa/gLPUMa3JT2+evUgZqY+nieOvn2POfj0N20/BLBZc/cfagv7DwDRxa5AC1Q slfBWJ5tdz7AtxlGF5O8Ji2h8sJ8UzVkKrqggMkM9pUYQbi5pHsuOEZMSADZOC+bbxXW hTwXqnRjavMXDOTnigJPv6Rh5eA4hYLC3m+xt6pxgEIf8w9WaVrHjYdnO2gsOd6CdN70 vHeX3PM23NAYjo+E9nC2HQN39BqtBn2OuLL74rCiR7j8RGFguC1kLrvLH/kx29d3Nx5g 3KN1OoGrlEiqxpPDTlnNggbwg41DWYQCisb5J3Bd7zrwN5mc1mx11qqZsm+mVcgNgtUm y7sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bKNQUkL1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id w1-20020a170902e88100b001b973681493si65892plg.16.2023.09.13.13.11.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 13:11:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bKNQUkL1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 19050814E364; Wed, 13 Sep 2023 12:57:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232417AbjIMT5j (ORCPT + 99 others); Wed, 13 Sep 2023 15:57:39 -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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Sep 2023 12:57:47 -0700 (PDT) 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 >