Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2326833rwd; Fri, 19 May 2023 04:23:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5lLX4DlmbTWte/rLch1ynXaxjxEASBRSiq+TyedA8CWU9tq0dvdOAIoBq0Y3bihvFTHc/s X-Received: by 2002:a05:6a00:2e01:b0:64d:3fb3:9ed9 with SMTP id fc1-20020a056a002e0100b0064d3fb39ed9mr258846pfb.23.1684495395566; Fri, 19 May 2023 04:23:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684495395; cv=none; d=google.com; s=arc-20160816; b=NaYvvE4lH42GnHoizDonENISIJue6p7VRPoBYpXcorlDVXwRMFfyqtogJ6iAsku7kJ GB2L4mvmfjewmxVsTq+f3ta5EO5yDyGDf6kkdTTemibubHXK80F8UNhKuEMzgb1Jf1gA GHzF3TUbGGfHI5oovmAkNyDF6XB4zSOLDv+t1q/8J73Q1/AgRhORSLeT9Uwgn5AP8y37 Twjpzakx10XDqA0RkQ/rGE+0784gaBSDBlmkq5tJ6/FiRUcINwDGy0OP6nzOVfrR8176 Y7ygzosL4uf2w5HuCCcpSBXsAMGhjubmyHJP4jUuI40jqcpcYx/evD+/G7laG5jYmFG1 871g== 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=IoOetOaDt5ZDwB2qJaAhPl759FzK0cSJ8mbgk+nhVTc=; b=KLWU8q97NPVQ4FM7Ug4OGz/wkQb1fMuX9dJnEzPRdvhcJPSEbs3X0rYPL8aWCeKlKO MpZkivL5/JrppO04oMkN+h8wjNJ9PjpEf0rhpZ355LfCVoyR9Vkc515NUer4PA2LCUzf woSwmU0rrJY6svhIxzwfZ9x3UHThrDbxwc3BRarwQL43SI/KP/bk61CNvdvPVEgAxjGc pSPjextHgH8HCJ14zCKRS2wlx//qulkG1UyXL45Xb4pKnQPBC4c7R4TAhcnU2hv3I0tK 6Au5Zq4OKxGmtzZrhwi/vQCTniMvh/9LC6VmLa6M3R6+AETFZn4kdneT7oh3KJXBYgkk 741w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LL1zcwb+; 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 h124-20020a625382000000b0063b5f25dd95si3658063pfb.391.2023.05.19.04.22.59; Fri, 19 May 2023 04:23:15 -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=LL1zcwb+; 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 S231635AbjESLWy (ORCPT + 99 others); Fri, 19 May 2023 07:22:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231594AbjESLWs (ORCPT ); Fri, 19 May 2023 07:22:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C02710E6; Fri, 19 May 2023 04:22:45 -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 A981464811; Fri, 19 May 2023 11:22:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3240C433A0; Fri, 19 May 2023 11:22:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684495364; bh=OcLM1N2ClGCrQpYWDpWQ6HQjg4/ELs+8TOzmNb/8/CI=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=LL1zcwb+2438spSK6nu0QO3uhzmYznCJ6FYaKF0rs9YJzYZuu8q7BN/huMRZ4XVqU 4UTECX1FDgXRdS6Hcp1cWQukl9y61Nqt8atvBSfQzPf0TQTJuYvBs18zMv+CB2Z+9F BdHC51FzAjsQbRGzpE5DM3BQRphGFVqWstaNg4sVKaSKySAvAB5EsuMkelYtdruZDr U+KcHge73B0ozjP5fEq7yDURVBW3gkporZYf+I4EjjYprwmtZybM8spv8qcLTjKeBt zD0v+X553SpUwol+ns3i/J6jkmT/x9UPBf0hGy3IHNqQUkDr4lwEh9NqfpqcZaAV0F S4TGrgB1oAKjA== Message-ID: <54b7d304016fd6e89a2899f7e417ba89bcb81c78.camel@kernel.org> Subject: Re: [PATCH v4 4/9] nfsd: ensure we use ctime_peek to grab the inode->i_ctime From: Jeff Layton To: Christian Brauner Cc: Chuck Lever III , Al Viro , "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: Fri, 19 May 2023 07:22:40 -0400 In-Reply-To: <20230519-zierde-legieren-e769c19a29cb@brauner> References: <20230518114742.128950-1-jlayton@kernel.org> <20230518114742.128950-5-jlayton@kernel.org> <2B6A4DDD-0356-4765-9CED-B22A29767254@oracle.com> <20230519-zierde-legieren-e769c19a29cb@brauner> 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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Fri, 2023-05-19 at 12:36 +0200, Christian Brauner wrote: > On Thu, May 18, 2023 at 11:31:45AM -0400, Jeff Layton wrote: > > 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 dir= ectly > > > > 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 t= his > > > > 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 st= at time > > > 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 previou= sly we > > > were just copying values out of the inode. To be conservative ab= out > > > changing behavior, we fall back to copying values out of the inod= e in > > > the error case. It might be better just to clear fh_pre_saved (t= hough > > > 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 > >=20 > > That sounds fine to me. I'll plan to drop this patch from the series an= d > > I'll send a separate patch to just remove those branches altogether > > (which should DTRT). >=20 > I'll wait with reviewing this until you send the next version then. I don't have any other big changes queued up. So far, this would just be the exact same set, without this patch. FWIW, I'm mostly interested in your review of patches #1 and 2. Is altering prototype for generic_fillattr, and changing the logic in current_time the right approach here? --=20 Jeff Layton