Unverified Commit f32b99fe authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!12217 v2 RDMA/hns: Fix new mmaped pages during resetting

parents d7824242 89e09350
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -683,6 +683,11 @@ static int hns_roce_mmap(struct ib_ucontext *uctx, struct vm_area_struct *vma)
	pgprot_t prot;
	int ret;

	if (hr_dev->dis_db) {
		atomic64_inc(&hr_dev->dfx_cnt[HNS_ROCE_DFX_MMAP_ERR_CNT]);
		return -EPERM;
	}

	rdma_entry = rdma_user_mmap_entry_get_pgoff(uctx, vma->vm_pgoff);
	if (!rdma_entry) {
		atomic64_inc(&hr_dev->dfx_cnt[HNS_ROCE_DFX_MMAP_ERR_CNT]);