Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1155337rwd; Thu, 18 May 2023 08:35:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6s0TMljm7uEm66MaUY3Q66i9ILHPP30HpVeqRTKxj3jWtylPuwm8fXib/pJznmqXgO0aZu X-Received: by 2002:a05:6a21:7889:b0:104:45df:42d8 with SMTP id bf9-20020a056a21788900b0010445df42d8mr165755pzc.10.1684424132327; Thu, 18 May 2023 08:35:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684424132; cv=none; d=google.com; s=arc-20160816; b=mZJCO4n+9Ft/a2nMPWGG9aqH8xd2fZiuEzV/q3KmCELyr/lnQYSf9S1ztGkTQA6oML wfXnfrXAX3fT9Lq99Q8aAhmWGtVNAGCWd/ZYc8PrmsS6Ua/R4qbLPEKRzXc/v0MCTgET 2FO1qikUshh4Y9xqQs7vXXhzNCo9ciIkCUR+7kY+AGTPHL8ealMllsMBHEfSUHkzA+FF CWiUJKbZOBko1G8sRDZOJC2BU0HCqbhJCDEaFFwcgw3KetCiyGOnIJQN6+ZwiMY6mSNi 0W3HoVoL+POZpRv/2aYFGTuU0NlZYOus/PqAZgBcjjxMVkHk+DNenNwIIaLQjomBBcU4 Dhbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=Swp1MVUl7n/cfaXqhgHCS2j7CNvKb6sfBAld0G5Ctm0=; b=y5i4qVrC0eHeFXwdPLi8nFvAfE+hprBzENDWQ8m3ZQ+esh8+PSsFg2Sp3AsA09e25T XK2WbEbgxjZACTAsgb+Dzg5uqCU/j4/dHiegAACE6u2zj16oEjzI7GoG2zNMrg98QbHu B31ZTai27VY5dZh9pD2h05mug0ykM2Bx8NLFrCm8i+gPmO95frmYjAtFvsqxU7NOtifv Euxpd/JIEZXYHQ2BGjP3cwDtu/LvUVwTB5R1EM+H83sqC4jM7PRUFfhKRcuHYRQJG7su 530dnGCDRY4eQ2gc8RBuHSUZSpPhMI0g1hzdTvQ8l+FOrwHEoc9Fbtdc0NgLgvVP5Ku0 cAcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hkdFwcBJ; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f185-20020a6251c2000000b006281ec442absi1855883pfb.309.2023.05.18.08.35.14; Thu, 18 May 2023 08:35:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hkdFwcBJ; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231311AbjERPbz (ORCPT + 99 others); Thu, 18 May 2023 11:31:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230234AbjERPby (ORCPT ); Thu, 18 May 2023 11:31:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32177F9; Thu, 18 May 2023 08:31:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BB72161127; Thu, 18 May 2023 15:31:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD10BC433EF; Thu, 18 May 2023 15:31:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684423909; bh=QR4Dg1YX8B3ucH22ew4CZd/iXu3GjZRKYDWVOpx+evE=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=hkdFwcBJVE9dIN6CfKsxNXSd9p1Dtcr1QSDfC8aMAvKedIePfHDxUlpwmozTZzfAP TLCpcZOxGKz5VlEpgPrgpr5t3YzKML/wC+aJreAjz3GtZlHuoNi30y34bKkaomgG+X Yy9zcWXpi6PGfMYcOZ3z6O8VqBMQf8pvec+lwb6DaGTqCS3CRxKjPqps536opGcEvy TAJgkl6XBfgrbZe5ZkFzqgubsFE59jd2MfqCUK6kqij4NFXrre+7zIPhMXng2Ms9Z4 JvY0rdmps06AX+Bqn9hYd6YD6k8r0RJk2reKh6o2ga0ZDkvPqjI+YpWD2wcKBcIlkx adWAjdBLXM3Sw== Message-ID: Subject: Re: [PATCH v4 4/9] nfsd: ensure we use ctime_peek to grab the inode->i_ctime From: Jeff Layton To: Chuck Lever III Cc: Al Viro , Christian Brauner , "Darrick J. Wong" , Hugh Dickins , Andrew Morton , Dave Chinner , Jan Kara , Amir Goldstein , David Howells , Neil Brown , Matthew Wilcox , Andreas Dilger , Theodore T'so , Chris Mason , Josef Bacik , David Sterba , Namjae Jeon , Steve French , Sergey Senozhatsky , Tom Talpey , linux-fsdevel , open list , Linux-XFS , "linux-btrfs@vger.kernel.org" , "linux-ext4@vger.kernel.org" , linux-mm , Linux NFS Mailing List , "linux-cifs@vger.kernel.org" Date: Thu, 18 May 2023 11:31:45 -0400 In-Reply-To: <2B6A4DDD-0356-4765-9CED-B22A29767254@oracle.com> References: <20230518114742.128950-1-jlayton@kernel.org> <20230518114742.128950-5-jlayton@kernel.org> <2B6A4DDD-0356-4765-9CED-B22A29767254@oracle.com> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.1 (3.48.1-1.fc38) MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, 2023-05-18 at 13:43 +0000, Chuck Lever III wrote: >=20 > > On May 18, 2023, at 7:47 AM, Jeff Layton wrote: > >=20 > > If getattr fails, then nfsd can end up scraping the time values directl= y > > out of the inode for pre and post-op attrs. This may or may not be the > > right thing to do, but for now make it at least use ctime_peek in this > > situation to ensure that the QUERIED flag is masked. >=20 > That code comes from: >=20 > commit 39ca1bf624b6b82cc895b0217889eaaf572a7913 > Author: Amir Goldstein > AuthorDate: Wed Jan 3 17:14:35 2018 +0200 > Commit: J. Bruce Fields > CommitDate: Thu Feb 8 13:40:17 2018 -0500 >=20 > nfsd: store stat times in fill_pre_wcc() instead of inode times >=20 > The time values in stat and inode may differ for overlayfs and stat t= ime > values are the correct ones to use. This is also consistent with the = fact > that fill_post_wcc() also stores stat time values. >=20 > This means introducing a stat call that could fail, where previously = we > were just copying values out of the inode. To be conservative about > changing behavior, we fall back to copying values out of the inode in > the error case. It might be better just to clear fh_pre_saved (thoug= h > note the BUG_ON in set_change_info). >=20 > Signed-off-by: Amir Goldstein > Signed-off-by: J. Bruce Fields >=20 > I was thinking it might have been added to handle odd corner > cases around re-exporting NFS mounts, but that does not seem > to be the case. >=20 > The fh_getattr() can fail for legitimate reasons -- like the > file is in the middle of being deleted or renamed over -- I > would think. This code should really deal with that by not > adding pre-op attrs, since they are optional. >=20 That sounds fine to me. I'll plan to drop this patch from the series and I'll send a separate patch to just remove those branches altogether (which should DTRT). --=20 Jeff Layton