Received: by 10.223.176.46 with SMTP id f43csp41714wra; Thu, 18 Jan 2018 13:39:19 -0800 (PST) X-Google-Smtp-Source: ACJfBosWEAUJ/T8v7FoCh2JZ+U1G8TNnOwiZ52lahXRol8iEf6eMSqhilsnmsAL50Q++j/qorcwG X-Received: by 10.99.116.22 with SMTP id p22mr33969046pgc.4.1516311559177; Thu, 18 Jan 2018 13:39:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516311559; cv=none; d=google.com; s=arc-20160816; b=GLeIq8UHXW8CYMeQoOoV6X7Qr4mnU1jRwMgODNHi5aBdBw/C9OzD7Jp8Kf2h/3XwRo pRu+Y+aoyibziD0bCjaZoCHCavLb/0eW6pSVbuPVmU5nqVahdskufh7uqlb01w8lX5ns MUAUvQ7/DoLg2a1rMpMEn0TCzcAa8IWPgKu4WEh3GV3tcQ2dq1M1xPRSGIbz7qB6tFts fZur7eKVG5lOd7h1x4sUQC/PRKDUTtI7+RAtg/Eex5DK16xWLW/GJymKd28aI6iH8H4Z SFw74wxhksA1wxhGZQnerEaILmr/CfyRkkcyikTFwYLuYjeDbsVJWAJ+DTMmgDXnVo7P /TtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=XlXTbvkyisTyOKdoz7YRMysF2gwjP+Tyynoy5HVJvDY=; b=GHJv9IDi6HsnHVDZyZ/+2bRgYq63tB2oiG0Fg4LTl9fi+/p06A68xSczbu3Sm7W0Nn dz78dRbQkUAm5ptucKwbG4k618yMimTDsPNfgtFcPo6OEPTJ3t+WcCkNr+VRUskjuYwD sEY1SO5vZM67HTD7Ve6WZuJOeOe666FF83v/93VTRMuxGUnhEhXXx0YEqTslzD7cB5FU pUlwPXzkhQ4oYMeGj2kOYGAe10q32UNrX2KJvFXqJS5u9DI6QpKVaMl7fRwmbzgVEmsG M2o4o6XJobRmY5c93cty0BrYVbW3CpBoyz77M4854nrvzRSZ/NbJOUzgWR1zEBpV50S3 94Iw== 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 g83si7776365pfk.234.2018.01.18.13.39.05; Thu, 18 Jan 2018 13:39:19 -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 S1754895AbeARVia (ORCPT + 99 others); Thu, 18 Jan 2018 16:38:30 -0500 Received: from fieldses.org ([173.255.197.46]:49802 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753791AbeARViW (ORCPT ); Thu, 18 Jan 2018 16:38:22 -0500 Received: by fieldses.org (Postfix, from userid 2815) id 8E086189; Thu, 18 Jan 2018 16:38:21 -0500 (EST) Date: Thu, 18 Jan 2018 16:38:21 -0500 From: "J. Bruce Fields" To: Jeff Layton 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 Subject: Re: [PATCH v5 01/19] fs: new API for handling inode->i_version Message-ID: <20180118213821.GA5299@fieldses.org> References: <20180109141059.25929-1-jlayton@kernel.org> <20180109141059.25929-2-jlayton@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180109141059.25929-2-jlayton@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 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. 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. The documentation here is all very helpful, thanks. --b.