aboutsummaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers3@gmail.com>2014-06-25 00:45:08 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-08-01 02:36:04 -0400
commit6d2b6170c8914c6c69256b687651fb16d7ec3e18 (patch)
treef3a2cb3335d8497e4cebcb2b3ab2291c6d1308db /fs/open.c
parentaf436472772d474acfad724ce789e003d1ca41c3 (diff)
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"). Signed-off-by: Eric Biggers <ebiggers3@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/open.c b/fs/open.c
index 36662d036237..d6fd3acde134 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)
263 return -EPERM; 263 return -EPERM;
264 264
265 /* 265 /*
266 * We can not allow to do any fallocate operation on an active 266 * We cannot allow any fallocate operation on an active swapfile
267 * swapfile
268 */ 267 */
269 if (IS_SWAPFILE(inode)) 268 if (IS_SWAPFILE(inode))
270 ret = -ETXTBSY; 269 return -ETXTBSY;
271 270
272 /* 271 /*
273 * Revalidate the write permissions, in case security policy has 272 * Revalidate the write permissions, in case security policy has