Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163013Ab3DEUvm (ORCPT ); Fri, 5 Apr 2013 16:51:42 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:53139 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162134Ab3DEUvk (ORCPT ); Fri, 5 Apr 2013 16:51:40 -0400 Date: Fri, 5 Apr 2013 21:51:37 +0100 From: Al Viro To: Greg Kroah-Hartman Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds , Rik van Riel , Andrew Morton , Alexey Dobriyan Subject: Re: [RFC] revoke(2) and generic handling of things like remove_proc_entry() Message-ID: <20130405205137.GG4068@ZenIV.linux.org.uk> References: <20130405042932.GB4068@ZenIV.linux.org.uk> <20130405195609.GA8745@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130405195609.GA8745@kroah.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2406 Lines: 55 On Fri, Apr 05, 2013 at 12:56:09PM -0700, Greg Kroah-Hartman wrote: > Which methods do you mean here? file->f_op->some_method() > The vfs core would call start_using(), or would filesystems / drivers > need to do this? The former; we have relatively few places that call file_operations members directly and we'd turn each of those into if (likely(start_using(file)) { res = file->f_op->foo(....); stop_using(file); } else { res = error_value_appropriate_for_foo; } > > 4) nasty semantics issue - mmap() vs. revoke (of any sort, including > > remove_proc_entry(), etc.). Suppose a revokable file had been mmapped; > > now it's going away. What should we do to its VMAs? Right now sysfs > > and procfs get away with that, but only because there's only one thing > > that has ->mmap() there - /proc/bus/pci and sysfs equivalents. I've > > no idea how does pci_mmap_page_range() interact with PCI hotplug (and > > I'm not at all sure that whatever it does isn't racy wrt device removal), > > The page range should just start returning 0xff all over the place, the > BIOS should have kept the mapping around, as it can't really assign it > anywhere else, so all _should_ be fine here. Umm... 0xff or SIGSEGV? > I think that's a reasonable constraint, although tearing down the VMAs > might be possible if we just invalidate the file handle "forcefully" > (i.e. manually tear them down and then further accesses should through a > SIGSEV fail, or am I missing something more basic here?) The question is how to do that in a reasonably clean way; we would've done as part of ->kick(), I suppose, or right next to it. > > 6) how do we get from revoke(2) to call of revoke_it() on the right object? > > Note that revoke(2) is done by pathname; we might want an ...at() variant, > > but all we'll have to play with will be inode, not an opened file. > > Can we make revoke(2) require a valid file handle? Is there a POSIX > spec for revoke(2) that we have to follow here, or given that we haven't > had one yet, are we free to define whatever we want without people > getting that upset? BSD one takes a pathname and so do all derived ones... -- 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/