Skip to content

Commit 5980021

Browse files
vijaydhanrajacrnsi
authored andcommitted
DM: Increase hugetlbfs MAX_PATH_LEN from 128 to 256
Current hugetlbfs code has a limitation on file path length. The path string comprises of mount path + vm name. Something like /run/hugepage/acrn/huge_lv1/vm1. To this UUID (32 bytes) is added and the total path length should be less than 128. This works fine but in cases where the VM name is large as in case kata, this check fails. Kata passes a sandbox-id as VM name and so path + 32 for UUID easily exceed 128 bytes. “/run/hugepage/acrn/huge_lv1/ sandbox-6d455fa48788eae82dee42410fc3d38849c2a5196f930b3d6944805aed8d24c7" To address this, increase the size of MAX_PATH_LEN from 128 to 256 bytes. Tracked-On: #3379 Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
1 parent 44fc5fc commit 5980021

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

devicemodel/core/hugetlb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extern char *vmname;
4545
#define HUGETLB_LV2 1
4646
#define HUGETLB_LV_MAX 2
4747

48-
#define MAX_PATH_LEN 128
48+
#define MAX_PATH_LEN 256
4949

5050
#define HUGETLBFS_MAGIC 0x958458f6
5151

@@ -410,7 +410,7 @@ static int mount_hugetlbfs(int level)
410410
static void umount_hugetlbfs(int level)
411411
{
412412
char path[MAX_PATH_LEN];
413-
413+
414414
if (level >= HUGETLB_LV_MAX) {
415415
perror("exceed max hugetlb level");
416416
return;

0 commit comments

Comments
 (0)