From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [PATCH 0/4] IMA: making i_readcount a first class inode citizen Date: Thu, 28 Oct 2010 15:46:04 -0700 Message-ID: References: <1288303325-9628-1-git-send-email-zohar@linux.vnet.ibm.com> <20101028222404.GG2715@dastard> <1288305510.2610.13.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Cc: Dave Chinner , linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, hch@infradead.org, warthog9@kernel.org, jmorris@namei.org, kyle@mcmartin.ca, hpa@zytor.com, akpm@linux-foundation.org, mingo@elte.hu, eparis@redhat.com, viro@zeniv.linux.org.uk, Matthew Wilcox To: Mimi Zohar Return-path: In-Reply-To: <1288305510.2610.13.camel@localhost.localdomain> Sender: linux-security-module-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, Oct 28, 2010 at 3:38 PM, Mimi Zohar wrote: > > Would making i_readcount atomic be enough in ima_rdwr_violation_check(), > or would it still need to take the spin_lock? IMA needs guarantees > that the i_readcount/i_writecount won't be updated in between. If i_writecount is always updated under the i_lock, then the fix is probably to make that one non-atomic instead. There's no point in having an atomic that is always updated under a spinlock, that just makes everything slower. Regardless, I don't think i_readcount should be different from i_writecount. Al? Comments? Linus