Received: by 10.223.176.46 with SMTP id f43csp118904wra; Thu, 18 Jan 2018 14:48:11 -0800 (PST) X-Google-Smtp-Source: ACJfBous3zqDLCG/ZF9Vl4t7Ji1IEXVzymC6qTwbTyF17J9G2mT16VDqyxBnKrjeUnqsKZLO51hH X-Received: by 10.101.96.78 with SMTP id b14mr11237046pgv.339.1516315691617; Thu, 18 Jan 2018 14:48:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516315691; cv=none; d=google.com; s=arc-20160816; b=L3X6TFdGfvXt1lDzCQiWp76xDcs7q5BtWakij4l1AbvkvNOvV1aAbM2EAijgT05pmr BIFyErkIjizRy0YSRJ9Fiio7jL6RDbHAGQO7ZvUM688Ib+MfT+wylUKFF2Jj1XdjltEG d/aUT1EbA4+5EoVqgR9OvnCquzJMCi3C2eumT1skb7f6PxioFwIaPkITN334AIsFpHFX AMescK24p13tmvuZYDjEB3TVD5ihvrOZedkYTTkNQXoQ93MawgQzWe6K+f3Fl0IwUK2x GoYSuv4lgmv9HL/1hffteDHxBEj8nK1iYJ9WbbzfDM6TlCpNJNUklDOflTwGJC+rtwUj +gNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dmarc-filter:arc-authentication-results; bh=SbMV8sfeVkSupYGoYI7Ck2kj+X7TwZoPdAyTGZhQ0Eg=; b=V2amUEZyaK3F2TtM5jSA4LxpW3d8OWZiSW4uUchpDf0CYcJf811h1cRFWNuHHxua45 Hg/kUM428u0+4BKJb0TZKhZ5MM9NaUVVUEmmjAp2vSFJHpBqBM3SaNHpUjaKyojqWY70 69DB5kgnIZ6jnu27+lB0LQUqHzIfWD8G4UXucVdkwExB1pDGpPCEUQAo2NwXEcyLqdoe XjtMN8aM1w9YPnSzzhWhKhSL0y1COxSrgDAEz39mTg3xw6mRxCPZfoQoKFgeg+qi6TkJ 2DI3/BUgOFudMAdotZiF2L7H1qixnqKV5L7AN4vQphRe35O36Y1plrooxZbcQm1/Vf23 DKXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x13si6749949pgv.268.2018.01.18.14.47.54; Thu, 18 Jan 2018 14:48:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932606AbeARWrO (ORCPT + 99 others); Thu, 18 Jan 2018 17:47:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:57386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932138AbeARWrI (ORCPT ); Thu, 18 Jan 2018 17:47:08 -0500 Received: from tleilax.poochiereds.net (cpe-71-70-156-158.nc.res.rr.com [71.70.156.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E9BDE21719; Thu, 18 Jan 2018 22:47:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E9BDE21719 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jlayton@kernel.org Message-ID: <1516315623.3379.10.camel@kernel.org> Subject: Re: [PATCH v5 01/19] fs: new API for handling inode->i_version From: Jeff Layton To: "J. Bruce Fields" Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, linux-nfs@vger.kernel.org, neilb@suse.de, jack@suse.de, linux-ext4@vger.kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, linux-xfs@vger.kernel.org, darrick.wong@oracle.com, david@fromorbit.com, linux-btrfs@vger.kernel.org, clm@fb.com, jbacik@fb.com, dsterba@suse.com, linux-integrity@vger.kernel.org, zohar@linux.vnet.ibm.com, dmitry.kasatkin@gmail.com, linux-afs@lists.infradead.org, dhowells@redhat.com, jaltman@auristor.com, krzk@kernel.org Date: Thu, 18 Jan 2018 17:47:03 -0500 In-Reply-To: <20180118213821.GA5299@fieldses.org> References: <20180109141059.25929-1-jlayton@kernel.org> <20180109141059.25929-2-jlayton@kernel.org> <20180118213821.GA5299@fieldses.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.3 (3.26.3-1.fc27) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2018-01-18 at 16:38 -0500, J. Bruce Fields wrote: > On Tue, Jan 09, 2018 at 09:10:41AM -0500, Jeff Layton wrote: > > --- /dev/null > > +++ b/include/linux/iversion.h > > @@ -0,0 +1,236 @@ > > +/* SPDX-License-Identifier: GPL-2.0 */ > > +#ifndef _LINUX_IVERSION_H > > +#define _LINUX_IVERSION_H > > + > > +#include > > + > > +/* > > + * The change attribute (i_version) is mandated by NFSv4 and is mostly for > > + * knfsd, but is also used for other purposes (e.g. IMA). The i_version must > > + * appear different to observers if there was a change to the inode's data or > > + * metadata since it was last queried. > > + * > > + * Observers see the i_version as a 64-bit number that never changes. > > I don't understand that sentence. > That's because it's utter nonsense. I noticed that the other day and fixed it in my tree. It now reads: * Observers see the i_version as a 64-bit number that never decreases. > > If it > > + * remains the same since it was last checked, then nothing has changed in the > > + * inode. If it's different then something has changed. Observers cannot infer > > + * anything about the nature or magnitude of the changes from the value, only > > + * that the inode has changed in some fashion. > > As we've discussed before, there may be brief windows where the first > two statements aren't quite correct. I think that would be worth a > mention if we can keep it concise. Maybe add something like this?: > > It may be impractical for filesystems to keep i_version updates > atomic with respect to the changes that cause them. They > should, however, guarantee that i_version updates are never > visible before the changes that caused them. Also, i_version > updates should never be delayed longer than it takes the > original change to reach disk. That makes sense. I added it in pretty much verbatim. I think we mostly follow the latter should already. > Or maybe those details are best left to documentation on the relevant > parts of the api below (maybe inode_maybe_inc_iversion?). > > I dunno if it's also worth mentioning that nfsd doesn't actually use the > raw i_version--it mixes it with ctime to prevent i_version reuse after > reboot. Presumably that doesn't matter to IMA since it doesn't compare > i_version across reboots. > I think I won't document that here. nfsd is a consumer of i_version. What it does with it is sort of its own business. Might be good to have a comment blurb in the nfsd code about it though. > The documentation here is all very helpful, thanks. Thanks for all of the suggestions so far! -- Jeff Layton