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 D0F91C7EE23 for ; Thu, 18 May 2023 15:32:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 59C39900005; Thu, 18 May 2023 11:32:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 54C1B900004; Thu, 18 May 2023 11:32:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 41332900005; Thu, 18 May 2023 11:32:12 -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 2D572900004 for ; Thu, 18 May 2023 11:32:12 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id E8F381208D3 for ; Thu, 18 May 2023 15:32:11 +0000 (UTC) X-FDA: 80803766862.14.D3D84CA Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf26.hostedemail.com (Postfix) with ESMTP id 204AA140037 for ; Thu, 18 May 2023 15:31:50 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=hkdFwcBJ; spf=pass (imf26.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684423911; a=rsa-sha256; cv=none; b=Vo9FIl1lksO3uLQ+/Cr5+iK4MqBWbvDotT3GjHXS0wUVu1rqN1tCrG+iQJ32jw+NZ1V+l8 nQ0A8XYVWGUOMcnFuJ1+6BpAERr0cE+F2bs7/dXYFoIatKK01XamSATD4gkYZxt7FBN0f8 67Hir/O5vZOOrZJybMIgWMmlMOo+Emg= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=hkdFwcBJ; spf=pass (imf26.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=1684423911; 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=Swp1MVUl7n/cfaXqhgHCS2j7CNvKb6sfBAld0G5Ctm0=; b=ynf/v1dTosyNlgnqJgkdkmy2+sJPIyZcZAmsq9tJ0SYf4CMda1iP/kxfWfcBSYFYbLJnX5 9gKdgroKrR7w2uRLys9/Z5LiNIp1oTND+xbJ9zSztxnFUwmdlWoM5nluP2kascoxsK+z0O H/TdYzMKNgi3oJoSjBsbbJ7u4E/bMRs= 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 BF20865026; 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-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 204AA140037 X-Stat-Signature: qc5of1q16c83dcsfhz8z1hc34876gr7x X-HE-Tag: 1684423910-685550 X-HE-Meta: U2FsdGVkX18ZlmPIXXIUtT6rDTsykrTDlqoAWxo4h/e/g4QPUW3QqARgtvB1rIMphpZXQwpWpXsqc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M7KigpvqH/Jcvgnjop1rYsSxhA4/ds7/IrYhO28G4ZDXYRmwOCvgbEwpxUxH9NNhDdghaFFnlywQSoQVLzgALZ/gK92EFDvJvIbT5+Itpj2zwBWdCELYPkyqSb6GxEWtMm8nU2MNzO9/lA0oxn8RcIIRBfTc1LWNeSjX/0Wg0Qk6nptimbvdq+V26WEmlFlpdY4ObbLD1uvlOt4+yZ7Lipfgnq/lSMNPONQ3kkuZDv6qtgB7kJU5ucPLqrMcgjo7R1Tybbugyns9Fo7nyXYwT0S/PFeYN2mgOqvIQ6aWJvHGn64oUrmeNbyWJFH4lVLYQqqQ= 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 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