|
@@ -262,6 +262,13 @@ int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
|
|
if (IS_IMMUTABLE(inode))
|
|
if (IS_IMMUTABLE(inode))
|
|
return -EPERM;
|
|
return -EPERM;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * We can not allow to do any fallocate operation on an active
|
|
|
|
+ * swapfile
|
|
|
|
+ */
|
|
|
|
+ if (IS_SWAPFILE(inode))
|
|
|
|
+ ret = -ETXTBSY;
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Revalidate the write permissions, in case security policy has
|
|
* Revalidate the write permissions, in case security policy has
|
|
* changed since the files were opened.
|
|
* changed since the files were opened.
|