[LTP] hugetlb/hugemmap: add hugemmap33 to test hugetlbfs quota accounting

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Fri Jul 17 19:15:57 CEST 2026


Hi Pavithra,

On Fri, 17 Jul 2026, Pavithra wrote:
> hugetlb/hugemmap: add hugemmap33 to test hugetlbfs quota accounting

> +// SPDX-License-Identifier: LGPL-2.1-or-later

All LTP tests use GPL-2.0-or-later. LGPL-2.1-or-later is wrong here.
Every other test in this directory (hugemmap32.c, hugemmap34.c, ...) uses
GPL-2.0-or-later, as does the required test structure template.

> +	if (mount("none", quota_mnt, "hugetlbfs", 0, mount_opts) == -1) {
> +		if (errno == ENODEV)
> +			tst_brk(TCONF, "hugetlbfs not supported");
> +		tst_brk(TBROK | TERRNO, "mount() failed");
> +	}
> +	quota_mounted = 1;

The ENODEV branch is unreachable: the test already sets .needs_hugetlbfs = 1,
so the framework validates and mounts hugetlbfs at MNTPOINT before setup()
runs. Since MNTPOINT is successfully mounted, ENODEV cannot occur on the
quota mount. Use SAFE_MOUNT() instead:

    SAFE_MOUNT("none", quota_mnt, "hugetlbfs", 0, mount_opts);

> +static struct tst_test test = {
> +	.needs_root = 1,
> +	.mntpoint = MNTPOINT,
> +	.needs_hugetlbfs = 1,
> +	.forks_child = 1,
> +	.setup = setup,
> +	.cleanup = cleanup,
> +	.test_all = run_test,
> +	.hugepages = {2, TST_NEEDS},
> +};

Both the commit message and the doc comment describe this test as checking
for regressions in hugetlbfs quota accounting. Regression tests must include
a .tags entry in struct tst_test.

Verdict - Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer


More information about the ltp mailing list