Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3547409rdb; Wed, 13 Sep 2023 15:56:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHLcJQ+0rdjzzSKFWgN6VrYJMtbePdoZwBU5luqwB6iEl2linBwbfcED4pyJBB7dbtxBZXb X-Received: by 2002:a17:902:da92:b0:1c3:2c2f:1132 with SMTP id j18-20020a170902da9200b001c32c2f1132mr4148148plx.54.1694645802503; Wed, 13 Sep 2023 15:56:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694645802; cv=none; d=google.com; s=arc-20160816; b=UmJ63J/4HqMm0FoJrPPCBUtOWyCvYm+6wHqiwx33y9J+1UVyTVfvp/phRwODpWsBmi mnbctkGKj5pp3cuUz0VCS1DhNV/BT4xOsnvqjT7HrZ8TQhRY3qkNg/9JR+ghWv8+xSSq 3pK03HUswKEBzh9isgu4hM37NQZoiGdTXz4i17e6UpdenvNpzFNCy15u2RF2A0nWF8MV JXfMszzrdfQNP6o8wiriHXYh63LJawSW4ks5x9NxOW9cbxLYVGQmMi+Ry+xVQkPDpSpE Mbs0lhd1jDYFQoYJjcoQgYYO733e7ERUstHWQX71cEn3gKBbf44Yc14buhJXOBTslkQs +qJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=yUBTHLHMdVrFtqCVTI9npNAUNxOv53pR5xqiTxGy/z4=; fh=eVaVyZS1c6jJSEKou4Y5Hvu5bTo7Gpg1akKr5/ztgmU=; b=oJE57NxBiJuDLXMJyd1ocPiC4DSlS2HGu0QGt0xTPT/kIAX+b/vU5dKJst5UygAR/q YCF6W6rR6wUW1sKZoeoN3Dm7XA7BTgP8epq5zthnvxhVK2s1NbqW8Uz4UunkGEUdrgoT T2bWMZTAbhSbkl+uJq9HRt1Amtx0vKsJqO8RSGnjmPJydnH3mFg+LkuEK+px3kXnLg+q y3930OLlYT/4CN42EFTD5Vy0BUq4AUoA5qCsOZisWzd5IiLaMoFRTYoFXrZFBDinll9p 7T8KYmaCUYi/OtlVg0Up7fFzeWdIVd3k7l77OJbrUJqgvOewppXj0TyPAjerPsy5O8+s 7D4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=ltuvVGdO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id j4-20020a170903028400b001bf7289d2b2si289305plr.315.2023.09.13.15.56.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 15:56:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=ltuvVGdO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 6D0DA80ACC5A; Wed, 13 Sep 2023 10:37:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230371AbjIMRhC (ORCPT + 99 others); Wed, 13 Sep 2023 13:37:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbjIMRhC (ORCPT ); Wed, 13 Sep 2023 13:37:02 -0400 Received: from mail-ua1-x92f.google.com (mail-ua1-x92f.google.com [IPv6:2607:f8b0:4864:20::92f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 046D0A8; Wed, 13 Sep 2023 10:36:58 -0700 (PDT) Received: by mail-ua1-x92f.google.com with SMTP id a1e0cc1a2514c-7a505727e7eso59670241.0; Wed, 13 Sep 2023 10:36:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694626617; x=1695231417; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=yUBTHLHMdVrFtqCVTI9npNAUNxOv53pR5xqiTxGy/z4=; b=ltuvVGdONvIKlvwk2W8dWK0O7Bz8lZG3Q0Fo9ie3+DF0onqsskDOI5hFVoqDhDdkSh SA67qvyX0epiZI76QFWKGHXbyvRNft9s3ZNg9OQITwvlORj/rMsEuVIGkap1Jo4Gjau1 TOwwVFNwskW3YId4fFrQYJg+w5yMB93eqiVsbyPSwDhYkeGIkR1Dr+GnQoOSnkgpDhuJ rJy+MOXakH8vJ4/OWGTe0Z0q+2qCDwIBleV6uEbUo/3RiVvutIMYn9y+LNvWZUEwu49k BLWfrI3lLRnNHOyn6fSP2FvHpecboq5apMOdB3PPkopIQcBHrWrA3zI88l522THoK4/v LLSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694626617; x=1695231417; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yUBTHLHMdVrFtqCVTI9npNAUNxOv53pR5xqiTxGy/z4=; b=DOcJvirKFSlhlFP8aj8i+kymldOpDUN3yo+10A78n+3uMvQh445IKOL5teV7z5ON5U DuMWZXIUa5wS8h8HpQrBrGRENOAB0BB2jEQROU2RSZTnpzSyWCgtMmiHzNDB6/10Eehu 0FNo+GtoZxLJd1oLL/U3YjYXXcoPNsto4MqTZwvqJx8ls/19dEE6XZfck2Ue3k48J6yZ 4JwAUAPR0o7XdJyAYWwpBykA9lc5q3bQNnezIB3Gn3AE0opixIP1vQ2h76ayXD7UydK5 Rf+xdFsWMOGXuK9PezKPZ+IEeGKRZLWod0vTb5FIhrWZuw36YrTpzf36Kvcl6naNDpMG k1Kw== X-Gm-Message-State: AOJu0Yz0oFh8kUgMV+AOJy5weXpzOibxsBPol9UZqc+htyP/9mZ/1wIz LTPBlNQ+iRiut68awOw1tfeBpKvQyqBHxfL0+Ck= X-Received: by 2002:a1f:4b85:0:b0:495:bc26:d110 with SMTP id y127-20020a1f4b85000000b00495bc26d110mr3150824vka.12.1694626616904; Wed, 13 Sep 2023 10:36:56 -0700 (PDT) MIME-Version: 1.0 References: <20230913-ctime-v1-1-c6bc509cbc27@kernel.org> In-Reply-To: <20230913-ctime-v1-1-c6bc509cbc27@kernel.org> From: Amir Goldstein Date: Wed, 13 Sep 2023 20:36:45 +0300 Message-ID: Subject: Re: [PATCH] overlayfs: set ctime when setting mtime and atime To: Jeff Layton Cc: Miklos Szeredi , Nathan Chancellor , Christian Brauner , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 (groat.vger.email [0.0.0.0]); Wed, 13 Sep 2023 10:37:09 -0700 (PDT) X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email On Wed, Sep 13, 2023 at 4:33=E2=80=AFPM Jeff Layton wr= ote: > > 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 analogous, so add ATTR_CTIME to the bitmask. > notify_change will fill in the value. > IDGI, if ctime always needs to be set along with ATIME / MTIME, why not let notify_change() set the bit instead of assert and fix all the callers? But maybe I am missing something. Anyway, I have no objection to the ovl patch. It's fine by me if Christian applies it to the vfs.ctime branch with my ACK= . Thanks, Amir. > Reported-by: Nathan Chancellor > Signed-off-by: Jeff Layton > --- > 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, str= uct dentry *upperdentry, > { > struct iattr attr =3D { > .ia_valid =3D > - ATTR_ATIME | ATTR_MTIME | ATTR_ATIME_SET | ATTR_MTIM= E_SET, > + ATTR_ATIME | ATTR_MTIME | ATTR_ATIME_SET | ATTR_MTIM= E_SET | ATTR_CTIME, > .ia_atime =3D stat->atime, > .ia_mtime =3D stat->mtime, > }; > > --- > base-commit: 9cb8e7c86ac793862e7bea7904b3426942bbd7ef > change-id: 20230913-ctime-299173760dd9 > > Best regards, > -- > Jeff Layton >