From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Sat, 18 Oct 2008 22:56:47 +0200 From: Willy Tarreau Subject: Re: no way to swapoff a deleted swap file? Message-ID: <20081018205647.GA29946@1wt.eu> References: <20081018003117.GC26067@cordes.ca> <20081018051800.GO24654@1wt.eu> <20081018204948.GA22140@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081018204948.GA22140@infradead.org> Sender: owner-linux-mm@kvack.org Return-Path: To: Christoph Hellwig Cc: Hugh Dickins , Peter Cordes , Bodo Eggert <7eggert@gmx.de>, David Newall , Peter Zijlstra , linux-kernel@vger.kernel.org, linux-mm List-ID: On Sat, Oct 18, 2008 at 04:49:48PM -0400, Christoph Hellwig wrote: > On Sat, Oct 18, 2008 at 09:45:14PM +0100, Hugh Dickins wrote: > > --- 2.6.27/fs/namei.c 2008-10-09 23:13:53.000000000 +0100 > > +++ linux/fs/namei.c 2008-10-18 21:33:01.000000000 +0100 > > @@ -1407,7 +1407,7 @@ static int may_delete(struct inode *dir, > > if (IS_APPEND(dir)) > > return -EPERM; > > if (check_sticky(dir, victim->d_inode)||IS_APPEND(victim->d_inode)|| > > - IS_IMMUTABLE(victim->d_inode)) > > + IS_IMMUTABLE(victim->d_inode) || IS_SWAPFILE(victim->d_inode)) > > return -EPERM; > > if (isdir) { > > if (!S_ISDIR(victim->d_inode->i_mode)) > > Looks reasonable. I like the idea and the simplicity a lot ! Willy -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org