From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Piggin Subject: Re: [PATCH 04/23] vfs: Introduce infrastructure for revoking a file Date: Tue, 2 Jun 2009 09:14:11 +0200 Message-ID: <20090602071411.GE31556@wotan.suse.de> References: <1243893048-17031-4-git-send-email-ebiederm@xmission.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Al Viro , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Hugh Dickins , Tejun Heo , Alexey Dobriyan , Linus Torvalds , Alan Cox , Greg Kroah-Hartman , Andrew Morton , Christoph Hellwig , "Eric W. Biederman" To: "Eric W. Biederman" Return-path: Content-Disposition: inline In-Reply-To: <1243893048-17031-4-git-send-email-ebiederm@xmission.com> Sender: linux-pci-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Mon, Jun 01, 2009 at 02:50:29PM -0700, Eric W. Biederman wrote: > From: Eric W. Biederman > > Introduce the file_hotplug_lock to protect file->f_op, file->private, > file->f_path from revoke operations. > > The file_hotplug_lock is used typically as: > error = -EIO; > if (!file_hotplug_read_trylock(file)) > goto out; > .... > file_hotplug_read_unlock(file); Why is it called hotplug? Does it have anything to do with hardware? Because every concurrently changed software data structure in the kernel can be "hot"-modified, right? Wouldn't file_revoke_lock be more appropriate? > In addition for a complete solution we need: > - A reliable way the file structures that we need to revoke. > - To wait for but not tamper with ongoing file creation and cleanup. > - A guarantee that all with user space controlled duration are removed. > > The file_hotplug_lock has a very unique implementation necessitated by > the need to have no performance impact on existing code. Classic locking Well, it isn't no performance impact. Function calls, branches, icache and dcache...