aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Biggers <ebiggers3@gmail.com>2014-06-24 23:45:08 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-08-07 16:53:53 -0700
commit7a456400382ab4b9e6436182a010cee89e729890 (patch)
tree37384786124a7a9ee47309ddd566362297b7e821
parentb3faa01ff2ef1e26255e5ee575912798fe9c242d (diff)
vfs: fix check for fallocate on active swapfile
commit 6d2b6170c8914c6c69256b687651fb16d7ec3e18 upstream. 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> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/open.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/open.c b/fs/open.c
index 9d64679cec73..dd24f21d31f7 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