提交 7c8f7af6 编写于 作者: C Christoph Hellwig 提交者: Christoph Hellwig

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: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NFelix Blyakher <felixb@sgi.com>
上级 26430752
...@@ -79,6 +79,12 @@ xfs_swapext( ...@@ -79,6 +79,12 @@ xfs_swapext(
goto out_put_target_file; 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); ip = XFS_I(file->f_path.dentry->d_inode);
tip = XFS_I(target_file->f_path.dentry->d_inode); tip = XFS_I(target_file->f_path.dentry->d_inode);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册