From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Biggers Subject: [PATCH] vfs: fix check for fallocate on active swapfile Date: Tue, 24 Jun 2014 23:45:08 -0500 Message-ID: <1403671508-371-1-git-send-email-ebiggers3@gmail.com> Cc: linux-kernel@vger.kernel.org, Eric Biggers To: linux-fsdevel@vger.kernel.org Return-path: Received: from mail-ig0-f180.google.com ([209.85.213.180]:63374 "EHLO mail-ig0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750732AbaFYEpx (ORCPT ); Wed, 25 Jun 2014 00:45:53 -0400 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 --- 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 -- 2.0.0