mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-04 22:21:23 +00:00
vfs: fix check for fallocate on active swapfile
Fix the broken check for calling sys_fallocate() on an active swapfile,
introduced by commit 0790b31b69
("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>
This commit is contained in:
parent
af43647277
commit
6d2b6170c8
@ -263,11 +263,10 @@ int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
|
|||||||
return -EPERM;
|
return -EPERM;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We can not allow to do any fallocate operation on an active
|
* We cannot allow any fallocate operation on an active swapfile
|
||||||
* swapfile
|
|
||||||
*/
|
*/
|
||||||
if (IS_SWAPFILE(inode))
|
if (IS_SWAPFILE(inode))
|
||||||
ret = -ETXTBSY;
|
return -ETXTBSY;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Revalidate the write permissions, in case security policy has
|
* Revalidate the write permissions, in case security policy has
|
||||||
|
Loading…
Reference in New Issue
Block a user