From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:51388 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750767AbdH1ENO (ORCPT ); Mon, 28 Aug 2017 00:13:14 -0400 Date: Mon, 28 Aug 2017 05:13:01 +0100 From: Al Viro To: Mimi Zohar Cc: Christoph Hellwig , Matthew Garrett , James Morris , linux-fsdevel@vger.kernel.org, linux-ima-devel@lists.sourceforge.net, linux-security-module@vger.kernel.org, Matthew Garrett , Jan Kara , Theodore Ts'o , Andreas Dilger , Jaegeuk Kim , Chao Yu , Steven Whitehouse , Bob Peterson , David Woodhouse , Dave Kleikamp , Ryusuke Konishi , Mark Fasheh , Joel Becker , Richard Weinberger , "Darrick J. Wong" , Hugh Dickins , Chris Mason Subject: Re: [PATCH v6 4/6] ima: use fs method to read integrity data Message-ID: <20170828041301.GA21125@ZenIV.linux.org.uk> References: <1502808237-2035-1-git-send-email-zohar@linux.vnet.ibm.com> <1502808237-2035-5-git-send-email-zohar@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1502808237-2035-5-git-send-email-zohar@linux.vnet.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Aug 15, 2017 at 10:43:55AM -0400, Mimi Zohar wrote: > From: Christoph Hellwig > > Add a new ->integrity_read file operation to read data for integrity > hash collection. This is defined to be equivalent to ->read_iter, > except that it will be called with the i_rwsem held exclusively. Hmm... I'm really tempted to add default_integrity_read() that would just call ->read_iter(), with boilerplate part becoming .integrity_read = default_integrity_read Note that all stuff accessed in it would be fresh in caches, so it's not as if we had serious overhead there. And we are going to be reading from file, anyway... I agree that it should be an opt-in from filesystem; default is still "don't know how to read, sod off". It's just that telling at the glance whether it's supposed to be a simple case or something tricky is needed would be simpler that way and it might turn out to be more robust that way...