Skip to content

Commit 6d2b617

Browse files
ebiggersAl Viro
authored andcommitted
vfs: fix check for fallocate on active swapfile
Fix the broken check for calling sys_fallocate() on an active swapfile, introduced by commit 0790b31 ("fs: disallow all fallocate operation on active swapfile"). Signed-off-by: Eric Biggers <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent af43647 commit 6d2b617

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fs/open.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,10 @@ int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
263263
return -EPERM;
264264

265265
/*
266-
* We can not allow to do any fallocate operation on an active
267-
* swapfile
266+
* We cannot allow any fallocate operation on an active swapfile
268267
*/
269268
if (IS_SWAPFILE(inode))
270-
ret = -ETXTBSY;
269+
return -ETXTBSY;
271270

272271
/*
273272
* Revalidate the write permissions, in case security policy has

0 commit comments

Comments
 (0)