Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753085AbdDLGGN (ORCPT ); Wed, 12 Apr 2017 02:06:13 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:33311 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752902AbdDLGGJ (ORCPT ); Wed, 12 Apr 2017 02:06:09 -0400 Date: Wed, 12 Apr 2017 08:05:34 +0200 From: Oleksij Rempel To: Richard Weinberger Cc: Christoph Hellwig , Oleksij Rempel , dedekind1@gmail.com, adrian.hunter@intel.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes Message-ID: <20170412060534.meohif5djev7johp@pengutronix.de> References: <20170411095055.26328-1-o.rempel@pengutronix.de> <20170411095055.26328-3-o.rempel@pengutronix.de> <20170411160530.GA25234@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 07:58:27 up 8 days, 22:42, 10 users, load average: 0.08, 0.04, 0.01 User-Agent: Mutt/1.6.2-neo (2016-06-11) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1502 Lines: 36 On Tue, Apr 11, 2017 at 11:13:24PM +0200, Richard Weinberger wrote: > Am 11.04.2017 um 18:05 schrieb Christoph Hellwig: > > On Tue, Apr 11, 2017 at 11:50:54AM +0200, Oleksij Rempel wrote: > >> increment i_version to notify security/IMA about changes > >> made in inode. > >> > >> Signed-off-by: Oleksij Rempel > > > > And how is this stored on disk? > > > > Hehe, I was about to ask the same question. :-) No. it is not stored to fs. Heh, the same question i asked my self. On linux-ima-user i found this post (2009-07-23): https://sourceforge.net/p/linux-ima/mailman/message/23152923/ --- When an inode entry is removed from dcache, the corresponding iint entry is removed from the radix tree. Unmounting an fs will cause the inodes, and by extension iint's, to be freed. When the fs is remounted, any file accessed will result in allocating a new iint structure with the i_version set to 0. --- The code seems to confirm it. So i assumed that IMA don't care if i_version is stored to disk or not. And i_version is the only way to notify IMA about inode changes. Since IMA documentation explecitley set i_version as reqieremt, so this option was provided as well. -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |