From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-15?Q?Luk=E1=A8_Czerner?= Subject: Re: [PATCH] vfs: fix check for fallocate on active swapfile Date: Wed, 25 Jun 2014 10:31:42 +0200 (CEST) Message-ID: References: <1403671508-371-1-git-send-email-ebiggers3@gmail.com> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Eric Biggers Return-path: In-Reply-To: <1403671508-371-1-git-send-email-ebiggers3@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue, 24 Jun 2014, Eric Biggers wrote: > Date: Tue, 24 Jun 2014 23:45:08 -0500 > From: Eric Biggers > To: linux-fsdevel@vger.kernel.org > Cc: linux-kernel@vger.kernel.org, Eric Biggers > Subject: [PATCH] vfs: fix check for fallocate on active swapfile > > Fix the broken check for calling sys_fallocate() on an active swapfile, > introduced by commit 0790b31b69374ddadefe ("fs: disallow all fallocate > operation on active swapfile"). Oops, good catch, Thanks! Reviewed-by: Lukas Czerner > > Signed-off-by: Eric Biggers > --- > fs/open.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/fs/open.c b/fs/open.c > index 36662d0..d6fd3ac 100644 > --- a/fs/open.c > +++ b/fs/open.c > @@ -263,11 +263,10 @@ int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len) > return -EPERM; > > /* > - * We can not allow to do any fallocate operation on an active > - * swapfile > + * We cannot allow any fallocate operation on an active swapfile > */ > if (IS_SWAPFILE(inode)) > - ret = -ETXTBSY; > + return -ETXTBSY; > > /* > * Revalidate the write permissions, in case security policy has >