Skip to content

Commit

Permalink
vfs: fix check for fallocate on active swapfile
Browse files Browse the repository at this point in the history
Fix the broken check for calling sys_fallocate() on an active swapfile,
introduced by commit 0790b31 ("fs: disallow all fallocate
operation on active swapfile").

Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Eric Biggers authored and Al Viro committed Aug 1, 2014
1 parent af43647 commit 6d2b617
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6d2b617

Please sign in to comment.