mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-08 03:33:25 -05:00
xfs: reject swapext ioctl on swapfiles
Swapfiles are magic - I/O is directly initialized by the VM without involving the filesystem. Swapping out extents underneath the VM thus can cause severe problems. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Felix Blyakher <[email protected]>
This commit is contained in:
parent
264307520b
commit
7c8f7af67d
1 changed files with 6 additions and 0 deletions
|
|
@ -79,6 +79,12 @@ xfs_swapext(
|
|||
goto out_put_target_file;
|
||||
}
|
||||
|
||||
if (IS_SWAPFILE(file->f_path.dentry->d_inode) ||
|
||||
IS_SWAPFILE(target_file->f_path.dentry->d_inode)) {
|
||||
error = XFS_ERROR(EINVAL);
|
||||
goto out_put_target_file;
|
||||
}
|
||||
|
||||
ip = XFS_I(file->f_path.dentry->d_inode);
|
||||
tip = XFS_I(target_file->f_path.dentry->d_inode);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue