All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vfs: fix check for fallocate on active swapfile
@ 2014-06-25  4:45 Eric Biggers
  2014-06-25  8:31 ` Lukáš Czerner
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Biggers @ 2014-06-25  4:45 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: linux-kernel, Eric Biggers

Fix the broken check for calling sys_fallocate() on an active swapfile,
introduced by commit 0790b31b69374ddadefe ("fs: disallow all fallocate
operation on active swapfile").

Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
---
 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
-- 
2.0.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] vfs: fix check for fallocate on active swapfile
  2014-06-25  4:45 [PATCH] vfs: fix check for fallocate on active swapfile Eric Biggers
@ 2014-06-25  8:31 ` Lukáš Czerner
  0 siblings, 0 replies; 2+ messages in thread
From: Lukáš Czerner @ 2014-06-25  8:31 UTC (permalink / raw)
  To: Eric Biggers; +Cc: linux-fsdevel, linux-kernel

On Tue, 24 Jun 2014, Eric Biggers wrote:

> Date: Tue, 24 Jun 2014 23:45:08 -0500
> From: Eric Biggers <ebiggers3@gmail.com>
> To: linux-fsdevel@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org, Eric Biggers <ebiggers3@gmail.com>
> 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 <lczerner@redhat.com>

> 
> Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
> ---
>  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
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-06-25  9:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-25  4:45 [PATCH] vfs: fix check for fallocate on active swapfile Eric Biggers
2014-06-25  8:31 ` Lukáš Czerner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.