mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-20 12:42:54 +00:00
dm: Fix wrong hugetlb_lv_max
hugetlb_lv_max will get wrong value if the HUGETLB_LV2 mount failed. Once hugetlb_lv_max is wrong, the following code logic messes up. Tracked-On: #4937 Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com> Acked-by: Yu Wang <yu1.wang@intel.com>
This commit is contained in:
parent
6edd21c1dc
commit
bdbf135708
@ -653,16 +653,13 @@ bool init_hugetlb(void)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (level = HUGETLB_LV1; level < HUGETLB_LV_MAX; level++) {
|
for (level = HUGETLB_LV1; level < HUGETLB_LV_MAX; level++)
|
||||||
if (mount_hugetlbfs(level) < 0) {
|
if (mount_hugetlbfs(level) < 0)
|
||||||
level--;
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (level < HUGETLB_LV1) /* mount fail for level 1 */
|
if (level == HUGETLB_LV1) /* mount fail for level 1 */
|
||||||
return false;
|
return false;
|
||||||
else if (level == HUGETLB_LV1) /* mount fail for level 2 */
|
else if (level == HUGETLB_LV2) /* mount fail for level 2 */
|
||||||
pr_warn("WARNING: only level 1 hugetlb supported");
|
pr_warn("WARNING: only level 1 hugetlb supported");
|
||||||
|
|
||||||
lock_fd = open(ACRN_HUGETLB_LOCK_FILE, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
|
lock_fd = open(ACRN_HUGETLB_LOCK_FILE, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
|
||||||
|
Loading…
Reference in New Issue
Block a user