Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1213544pxb; Fri, 22 Jan 2021 09:41:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJSQEvYyKjKOjRaBc/bNkNlnptAh39Xsn2M3qEB6yc7HcHtcvrqLu6jgL3qNKcEUumKQ2r X-Received: by 2002:a17:906:3b97:: with SMTP id u23mr3728269ejf.147.1611337294441; Fri, 22 Jan 2021 09:41:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611337294; cv=none; d=google.com; s=arc-20160816; b=utRmKxAjwzt1OSG2b9eVtZxSkl/qPQCfbqZSRGE6ndiix+b35fS3WYvsM/bAsHBe8n zgKtVimv9UpRU5TRW2KWp/KWi71iu72u3KBDu1JHs/g5qgp19x1bCI1GBjiEZWFF2+RM m8byWjwxvEw/K0z6wzRTAy5XWMdk2MjaRt05Du91bAKbaWtml68yRNR2y1Fl5qHg/I1S jTrvjOh43dGE+m42AmZiSA4oRDP/WuVjogKGcu+YJxETmdV5BGmI7zc5hIDDZDKatIvn 7J8emeYNl48aEM3USvwGOuXH4wCaX+HkN2RHZHwUwz1N4YnViVO0mbcYIUJqaOsd63Rd cQhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zejNF9PdUWUD58A5TE4kg12XP3Xr4LOy04O8OoxwuFE=; b=Mq61AfSoy5zyduLIGnQhsQMSIGgbdpI3b/MfdIVD/m9M4WC5nHlVBRcgpAOX1H3he9 FaPjfwG5NHuah0KduENImFX6DGkUmXTWLMVolbWwarm4ctCOTHozoHot/+vIj+e52gA4 QAqpIzYoPJG1zXSx9IQUWzYhPBsxSCYW8Ma58PpKZHLCivK60IYJiTkbxLwscHN3F+Hv rj5/A3MuyFbzwMqbKBv3o+a8UT2w+UPqn/mSXmvuRQ4ctn5CrfDLV2FtAruKdLnwGO6O ujhvyDZozKvGkypZKX9F0bP1ktAvyqwH8FiizUgJfgxn4yJULV+ijoVhohOCO0vtzBMn sOIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Mbs9MA1p; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r9si3996653edm.110.2021.01.22.09.41.02; Fri, 22 Jan 2021 09:41:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Mbs9MA1p; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729813AbhAVRgA (ORCPT + 99 others); Fri, 22 Jan 2021 12:36:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729552AbhAVRdk (ORCPT ); Fri, 22 Jan 2021 12:33:40 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6198C061786; Fri, 22 Jan 2021 09:32:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=zejNF9PdUWUD58A5TE4kg12XP3Xr4LOy04O8OoxwuFE=; b=Mbs9MA1pDs4QRXJy9LAjLAJeqC QQ6Bac+mJ0Jrq7b579w9H7JlOPPin7jEeFhJwD1eGdUrhYYr/HkCYTkQmh5z9EQLXxYTzrAqPaXuI nekpAyiGU9uFeRXqI2DfC/04H/KM/JSqyF/esVXM4pF5saNjzdFyXT56P0x5YchkhR3Pp3djw1kLD lgZ7BvYOXrBA71e/VoxjJGEKXbTzWFVYuuIlqT1frx7teQOCTcaoSqPnY5gWLX0jL6k5M9KlDxVu1 8xBjnIIcQh/RESsXhvj8LBSUA/C+6/A91enu49A2RaKoi5kJqHCDO6ej2w5yidz2hl4/qgq8xlVxo zMBVcMxg==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1l30Ii-0011Uv-4d; Fri, 22 Jan 2021 17:32:48 +0000 Date: Fri, 22 Jan 2021 17:32:48 +0000 From: Christoph Hellwig To: "J. Bruce Fields" Cc: Christoph Hellwig , linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Trond Myklebust , Anna Schumaker , Chuck Lever Subject: Re: [PATCH 2/3] nfsd: move change attribute generation to filesystem Message-ID: <20210122173248.GB241302@infradead.org> References: <1611084297-27352-1-git-send-email-bfields@redhat.com> <1611084297-27352-3-git-send-email-bfields@redhat.com> <20210120084638.GA3678536@infradead.org> <20210121202756.GA13298@pick.fieldses.org> <20210122082059.GA119852@infradead.org> <20210122144753.GA52753@pick.fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210122144753.GA52753@pick.fieldses.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Fri, Jan 22, 2021 at 09:47:53AM -0500, J. Bruce Fields wrote: > > > I also have a vague idea that some filesystem-specific improvements > > > might be possible. (E.g., if a filesystem had some kind of boot count > > > in the superblock, maybe that would be a better way to prevent the > > > change attribute from going backwards on reboot than the thing > > > generic_fetch_iversion is currently doing with ctime. But I have no > > > concrete plan there, maybe I'm dreaming.) > > > > Even without the ctime i_version never goes backward, what is the > > problem here? > > Suppose a modification bumps the change attribute, a client reads > the new value of the change attribute before it's committed to disk, > then the server crashes. After the server comes back up, the client > requests the change attribute again and sees an older value. So all metadata operations kicked off by nfsd are synchronous due to ->commit_metadata/sync_inode_metadata, so this could only happen for operations not kicked off by nfsd. More importanly ctime will also be lost as i_version and the ctime are commited together. > > That's actually not too bad. What I'd mainly like to avoid is > incrementing the change attribute further and risking reuse of an old > value for a different new state of the file. Ok but that is an issue if we need to deal with changes that did not come in through NFSD.