[PATCH v2 openEuler-23.09] mm: gmem: Save vm_flags to gmf during mmap

From: Ma Wupeng <mawupeng1@huawei.com> euleros inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I7WLVX --------------------------------------------- During mmap_region, vm_flags is not save in gmf which lead to prot in gmf is always VM_NONE. To fix this, update prot to gmf during init. Fixes: 848492f233ce ("mm: gmem: Introduce vm_object for gmem") Signed-off-by: Ma Wupeng <mawupeng1@huawei.com> --- mm/mmap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 061cc7381233..a28b17c3cc83 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2732,20 +2732,18 @@ static int alloc_va_in_peer_devices(struct mm_struct *mm, vm_flags_t vm_flags) { gm_context_t *ctx, *tmp; - gm_prot_t prot = VM_NONE; gm_ret_t ret; struct gm_fault_t gmf = { .mm = mm, .va = addr, .size = len, - .prot = prot, + .prot = vm_flags, }; pr_debug("gmem: start mmap, as %p\n", mm->gm_as); if (!mm->gm_as) return -ENODEV; - prot |= vm_flags; if (!vma->vm_obj) vma->vm_obj = vm_object_create(vma); if (!vma->vm_obj) -- 2.25.1

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/1936 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/P... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/1936 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/P...
-
patchwork bot
-
Wupeng Ma