Linux filesystem development
 help / color / mirror / Atom feed
From: "Lukáš Czerner" <lczerner@redhat.com>
To: Eric Biggers <ebiggers3@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vfs: fix check for fallocate on active swapfile
Date: Wed, 25 Jun 2014 10:31:42 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.1406251030500.2171@localhost.localdomain> (raw)
In-Reply-To: <1403671508-371-1-git-send-email-ebiggers3@gmail.com>

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
> 

      reply	other threads:[~2014-06-25  8:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-25  4:45 [PATCH] vfs: fix check for fallocate on active swapfile Eric Biggers
2014-06-25  8:31 ` Lukáš Czerner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.00.1406251030500.2171@localhost.localdomain \
    --to=lczerner@redhat.com \
    --cc=ebiggers3@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox