vfs: fix check for fallocate on active swapfile
PATCH 1/1 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 <[email protected]>
--- fs/open.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
fs/open.c +2 -3
@@ -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
Signature · 1 line
2.0.0
Quoted 9 lines · Eric Biggers
Date: Tue, 24 Jun 2014 23:45:08 -0500
From: Eric Biggers <[email protected]>
To: [email protected]
Cc: [email protected], Eric Biggers <[email protected]>
Subject: [PATCH] vfs: fix check for fallocate on active swapfileFix the broken check for calling
sys_fallocate()on an active swapfile, introduced by commit0790b31b69374ddadefe("fs: disallow all fallocate operation on active swapfile").
Oops, good catch, Thanks!
Reviewed-by Lukas Czerner <[email protected]>
Quoted 25 lines
Signed-off-by Eric Biggers <[email protected]>--- fs/open.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)fs/open.c +2
-3@@ -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