From 2955f04d22750903ee78739756d267b0dbe17f90 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 24 Jun 2014 23:45:08 -0500 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 2e31ca1a886a80ce5ed9 ("fs: disallow all fallocate operation on active swapfile"). Signed-off-by: Eric Biggers Signed-off-by: Al Viro --- fs/open.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/open.c b/fs/open.c index 36662d0362379..d6fd3acde134d 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.39.5