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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 466F0C77B7A for ; Fri, 19 May 2023 11:22:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D05CC280001; Fri, 19 May 2023 07:22:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CB6B7900003; Fri, 19 May 2023 07:22:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BA636280001; Fri, 19 May 2023 07:22:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id A96F1900003 for ; Fri, 19 May 2023 07:22:48 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 7432FA09C1 for ; Fri, 19 May 2023 11:22:48 +0000 (UTC) X-FDA: 80806767216.04.774E10C Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf04.hostedemail.com (Postfix) with ESMTP id 9675C40012 for ; Fri, 19 May 2023 11:22:45 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=LL1zcwb+; spf=pass (imf04.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684495365; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=IoOetOaDt5ZDwB2qJaAhPl759FzK0cSJ8mbgk+nhVTc=; b=SThnJhuFsw+EI5Rrr7Gk7oDImI/Yi9UlhFWqrdyvRuKCOaBKe8LMzpJf2C7Ok/g9lrN56j zmsMITBVPg6cddmAjxpSwO9DY9JuOJAXHJ8/vFUHrR4ivdl+RPa3eVDHjJONGukUpvAToB GyiIK3e3kwdR/3CK0hkc/mcwaiade+A= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684495365; a=rsa-sha256; cv=none; b=FjaV25LiTTIFbkDnnd69nRytZQAAHle8jmDtSrFX4Bb0MTGuGX78QQhrexvrgfT69l8pW6 eb9YdJsCu/rlkj5/S+LTfMm8wjYqi8BtGy9tfUOdg9ncRxgEo2MYydZHq4SX/+BSyACupt wQLz7whmMEhDHRlnvr4rBoTskcCIrp8= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=LL1zcwb+; spf=pass (imf04.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org; dmarc=pass (policy=none) header.from=kernel.org 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 A4F5160A20; 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-Rspamd-Queue-Id: 9675C40012 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: zi9nqjwzqj1odrgffp8fwh4rtkg4bdhd X-HE-Tag: 1684495365-518925 X-HE-Meta: U2FsdGVkX189pMaLbcn7ViypsYNLnP6fPPZWb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qQNAVwRQnp97JnLuQHDYWSeMEYR/QBYGTcoos5v0g3MWyQ3PVE9o5qFDNpxFWDHVVeuQ140sa+pF9lwWrrYwd+n75qSSpHjXWryplLcGISvgD5duwKPTs7X0fN9eSdZ80bY8sk22IIty8NrBneyPwNR7cMW2KkvXmlNCravkKn5ww/oK/tdy9cRiE8kcaqk696zEXtL3lJ03BgUY+d3w7uujC4eYpG47zyhc6hFjehSN3usIPieHhqAgllizg0BhEnQaoEPY1+QUiIhWrd1bVIB807bF9vTFluJa7gicPJPRCZJp7CYaXqc5X+I/E0IUNjb3ZiYwxU+xZ6LfbQc2iVqOmP9NsBR1lCj3nND2MOub1JxVQ= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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