From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [RFC/PATCH] revoke/frevoke system calls Date: Fri, 21 Jul 2006 23:59:31 -0700 Message-ID: <20060721235931.e8336001.akpm@osdl.org> References: <20060721171922.602706f9.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: alan@lxorguk.ukuu.org.uk, tytso@mit.edu, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Return-path: Received: from smtp.osdl.org ([65.172.181.4]:27858 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S1751288AbWGVG7s (ORCPT ); Sat, 22 Jul 2006 02:59:48 -0400 To: Pekka J Enberg In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Sat, 22 Jul 2006 09:22:37 +0300 (EEST) Pekka J Enberg wrote: > On Thu, 20 Jul 2006 15:07:30 +0300 (EEST) > Pekka J Enberg wrote: > > > This patch implements the revoke(2) and frevoke(2) system calls for all > > > types of files. > > > > > > ... > > > > > > - file = fget_light(fd, &fput_needed); > > > + file = fget(fd); > > On Fri, 21 Jul 2006, Andrew Morton wrote: > > This is sad. > > There are alternatives, playing games with ->f_op, creating fake struct > file, and doing IS_REVOKED if-else in the paths, but I think this is by > far the simplest way to do it. So in the Andrew scale of sads, how > sad is it, exactly?-) Sad enough. Certainly worth an if-else to fix. > On Thu, 20 Jul 2006 15:07:30 +0300 (EEST) > Pekka J Enberg wrote: > > > +static int revoke_files(struct task_struct *owner, struct inode *inode, > > > + struct file *exclude, struct list_head *to_close) > > > +{ > > > ... > > > + spin_lock(&files->file_lock); > > > ... > > > + revoked = kmalloc(sizeof(*revoked), GFP_KERNEL); > > On Fri, 21 Jul 2006, Andrew Morton wrote: > > This is bad. > > Indeed, I'll come up with a better one as soon as I sort out the mmap > takedown issues. > Why is this approach so different from Tigran's, I wonder. iirc, one of the things we added file.f_mapping for was revokation, but this patch doesn't use it. Please ask Al Viro about this.