Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964830AbaGBTHm (ORCPT ); Wed, 2 Jul 2014 15:07:42 -0400 Received: from mail-we0-f177.google.com ([74.125.82.177]:57248 "EHLO mail-we0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932333AbaGBTHk (ORCPT ); Wed, 2 Jul 2014 15:07:40 -0400 MIME-Version: 1.0 In-Reply-To: References: <53B3D3AA.3000408@samsung.com> <20140702184050.GA24583@infradead.org> Date: Wed, 2 Jul 2014 22:07:38 +0300 Message-ID: Subject: Re: IMA: kernel reading files opened with O_DIRECT From: Dmitry Kasatkin Cc: Christoph Hellwig , Dmitry Kasatkin , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Linux Kernel Mailing List , akpm@linux-foundation.org, Al Viro , Mimi Zohar , linux-security-module , Greg KH Content-Type: text/plain; charset=UTF-8 To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2 July 2014 21:45, Jeff Moyer wrote: > Christoph Hellwig writes: > >> On Wed, Jul 02, 2014 at 11:55:41AM -0400, Jeff Moyer wrote: >>> It's acceptable. >> >> It's not because it will then also affect other reads going on at the >> same time. > > OK, that part I was fuzzy on. I wasn't sure if they were preventing > other reads/writes to the same file somehow. I should have mentioned > that. > > Cheers, > Jeff What Christoph says is not very correct. At open there cannot be any reads going on at the same time. IMA reading is guarded by mutex. Following opens do not perform any IMA readings and do not do what he says... If file was modified with direct-io, VFS code itself always invalidate pages before and after any write. It is basically what Christoph says. But that is not IMA problem but direct-io itself. As it is stupid interface. I would be more looking to kind of fadvise interface to control amount of page caching... So I think what Jeff suggest suites well to IMA. -- Thanks, Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/