Skip to content

Commit c744af6

Browse files
mdouchametan-ucw
authored andcommitted
hugemmap32: Check for hugetlbfs availability
Trying to open PATH_HUGEPAGE unconditionally will fail if hugepage support is disabled in kernel or not provided by hardware. Signed-off-by: Martin Doucha <[email protected]> Reviewed-by: Cyril Hrubis <[email protected]>
1 parent 39fc422 commit c744af6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

testcases/kernel/mem/hugetlb/hugemmap/hugemmap32.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ static void setup(void)
4747
struct dirent *ent;
4848
unsigned long hpage_size;
4949

50+
if (access(PATH_HUGEPAGE, F_OK))
51+
tst_brk(TCONF, "hugetlbfs is not supported");
52+
5053
dir = SAFE_OPENDIR(PATH_HUGEPAGE);
5154
while ((ent = SAFE_READDIR(dir))) {
5255
if ((sscanf(ent->d_name, "hugepages-%lukB", &hpage_size) == 1) &&

0 commit comments

Comments
 (0)