[LTP] testcases/nvme: Add NVMe device discovery and identification test
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Wed Apr 29 09:33:26 CEST 2026
Hi Priya,
On 2026-04-30, priyama2 <priyama2@linux.ibm.com> wrote:
> [PATCH] testcases/nvme: Add NVMe device discovery and identification test
The subject prefix should match the actual directory path:
testcases/kernel/device-drivers/nvme:
The commit body only describes what the test does (restating the subject).
Please add a sentence explaining why the test is needed, e.g. what gap in
NVMe coverage this fills.
> +/*
> + * Copyright (c) 2024 IBM Corporation
New files added in 2026 must use 2026 as the copyright year.
[...]
> +SUBDIRS := acpi \
> + ...
testcases/kernel/device-drivers/Makefile has an explicit SUBDIRS list that
does not include nvme. The directory will not be built. Add nvme to the list.
[...]
> +static int nvme_device_found;
> +static char nvme_dev_name[256];
These statics are written in run() case 0 and read in cases 1-3 but are
never reset at the top of run(). With -i, stale values from a previous
iteration carry over. Reset them at the start of run().
[...]
> + .needs_root = 1,
All operations here (reading /dev, /sys) are world-readable. Remove
.needs_root = 1.
[...]
> + fp = fopen(class_path, "r");
> + if (!fp)
> + continue;
> + ...
> + fclose(fp);
Use SAFE_FOPEN/SAFE_FCLOSE (include/tst_safe_stdio.h), or document why
the raw call with continue-on-failure is intentional.
[...]
> + len = readlink(driver_path, driver_link, sizeof(driver_link) - 1);
Use SAFE_READLINK (include/tst_safe_macros.h).
Also missing:
- testcases/kernel/device-drivers/nvme/.gitignore entry for nvme01
- runtest/ entry for nvme01 (e.g. in runtest/drivers)
---
Note:
Our agent completed the review of the patch. The full review can be
found at: (not available)
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