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 9C264C77B7F for ; Fri, 19 May 2023 10:37:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 26906900005; Fri, 19 May 2023 06:37:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2187C900003; Fri, 19 May 2023 06:37:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0E0BB900005; Fri, 19 May 2023 06:37:10 -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 F3A89900003 for ; Fri, 19 May 2023 06:37:09 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C5BBE160A2A for ; Fri, 19 May 2023 10:37:09 +0000 (UTC) X-FDA: 80806652178.09.8DDF7F1 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf14.hostedemail.com (Postfix) with ESMTP id 20DD610000C for ; Fri, 19 May 2023 10:37:06 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=LesqHPpJ; spf=pass (imf14.hostedemail.com: domain of brauner@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=brauner@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=1684492627; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=z1NzlRLsfHC+fmVHg1zybc2da7i1QtzMLnxoButiHqw=; b=ouAmGJeEBBHTLr8OyrZCcM7jDFNG1vZFpgrgS5ubafAWDFGSuIQLCqULkU6h1HTq4UNqIk hV/xOHE/EbtR4IAHku9mvpJ2moJyP9p0uFF1z9ToG8I/SvXpr4UG/A67qPo0j7mgD9mGKI Cvkwl6WyZcIQEsJgdgyPaH1ibC56N8I= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=LesqHPpJ; spf=pass (imf14.hostedemail.com: domain of brauner@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=brauner@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684492627; a=rsa-sha256; cv=none; b=vvONottO5XKHJJg/WGcmg5ERPHOIKtrFjNEIHrZ6+RWqat1fzpHQUI58usLDpqUELHc4mn WicfX8jaxrQZjVOd9FPnKTmFH5HIFT9hFplponXUmbCCGeauC4IdfVw/TVR195AcYDjmZh dQiFFFfJrGahZUqZb5jbkrdN4Uu2vgw= 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 1F33965656; Fri, 19 May 2023 10:37:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 355FBC433EF; Fri, 19 May 2023 10:36:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684492625; bh=wml5FX+iifwiN9GWfcWZwLOn5yYaW+2EgAm1pGQ4wag=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LesqHPpJFvmUzFRNKNrXorR1EYqX2OH4PzpfMnfkwpXBNMAdG0ZQ2/EhXWk4IygXG 2SChx7zSoJ0YLPAx8NLZvJ6SOzp1REqqg2W4zVp5wbwe7o+dIDPVWUoxCl/qyUoiC6 Hc8K5v1h61MJ/2+pFTwgJ2RbfpliI2uZCFdccGPMr9bJ2ILACO3fq5ktbLX9Ih9mt7 borB3WCTF8vBovAIwJK2NJXzqkEsDom9vEZ+pqPWJpam+HPFNvtn25M8aQT5NRfCtp AGEEcDIESrx+0PUP4SCR9bC6eWarMtHEgUXfuLLSvsE0ZBK7mZlQH/I+SzX7bqFsFt 94cgCHIsObdWA== Date: Fri, 19 May 2023 12:36:51 +0200 From: Christian Brauner To: Jeff Layton 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" Subject: Re: [PATCH v4 4/9] nfsd: ensure we use ctime_peek to grab the inode->i_ctime Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 20DD610000C X-Rspam-User: X-Stat-Signature: fy1dqxem9rejq1kuonz5crghm38s4xrn X-Rspamd-Server: rspam01 X-HE-Tag: 1684492626-800625 X-HE-Meta: U2FsdGVkX1/TT6V2eBU88EWRl5Sc7+llxzK2vGG+qU1KmhDKps+yYJtM7IvH9Dm+4c8Dp8Ose5YIf+/9I8vSnUU26AwO2TbKE/jOZgEiMh6k8u1pftwTtvFB8tIGOSqoC1Afx1wZRMlFYN1jvn9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z8GJtcElqOlt+ex7DRwkLPid1M5DIVUyORTSM5Rn9b5phIISbi9icEpAiXSqWXWQNQ/B8jZJnE+ng4U37ACfNyMzfZN4U1KIDAahVn31N95D/pi72+aTAw82idNRKFkleR4QtzIVNOTcxOz8XxE4hJQxXCFrPHCR6MpK0AYb2GRYjO99aNSC+NNGSJCLvXOEIxxQGXweGf9h/k43ilAjwy9LjoKSCAUS/mHcOXR9b0dhucU4 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, May 18, 2023 at 11:31:45AM -0400, Jeff Layton wrote: > On Thu, 2023-05-18 at 13:43 +0000, Chuck Lever III wrote: > > > > > On May 18, 2023, at 7:47 AM, Jeff Layton wrote: > > > > > > If getattr fails, then nfsd can end up scraping the time values directly > > > 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. > > > > That code comes from: > > > > 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 > > > > nfsd: store stat times in fill_pre_wcc() instead of inode times > > > > The time values in stat and inode may differ for overlayfs and stat time > > values are the correct ones to use. This is also consistent with the fact > > that fill_post_wcc() also stores stat time values. > > > > 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 (though > > note the BUG_ON in set_change_info). > > > > Signed-off-by: Amir Goldstein > > Signed-off-by: J. Bruce Fields > > > > 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. > > > > 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. > > > > 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). I'll wait with reviewing this until you send the next version then.