提交 b9d83c98 编写于 作者: Z ZhangPeng 提交者: Ma Wupeng

userswap: fix BUG_ON in __mcopy_atomic()

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I6CAIM

--------------------------------

When the swap-in buffer contains no physical pages, the errno in
mfill_atomic_pte_nocopy() will be ENOENT. A BUG_ON error will occur
because the userswap feature does not use the struct page *page and page
is set to NULL.
To fix this issue, the errno should be changed from ENOENT to EINVAL.
Signed-off-by: NZhangPeng <zhangpeng362@huawei.com>
上级 2c317c48
......@@ -407,7 +407,7 @@ int mfill_atomic_pte_nocopy(struct mm_struct *mm,
src_vma = find_vma(mm, src_addr);
if (!src_vma || src_addr < src_vma->vm_start)
return -ENOENT;
return -EINVAL;
if (src_vma->vm_flags & VM_LOCKED)
return -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册