Commit b9d83c98 authored by ZhangPeng's avatar ZhangPeng Committed by Ma Wupeng
Browse files

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: default avatarZhangPeng <zhangpeng362@huawei.com>
parent 2c317c48
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;