-
Notifications
You must be signed in to change notification settings - Fork 85
nvme/065: add nvme format test with supported LBA format #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
nvme/065: add nvme format test with supported LBA format #183
Conversation
320045b to
c91107c
Compare
| nlbaf=$(nvme id-ns --output-format=json "$TEST_DEV" | jq '.nlbaf') | ||
|
|
||
| for lbaf in $(seq 0 "$nlbaf"); do | ||
| nvme format --lbaf="$lbaf" --force "$TEST_DEV" >> "${FULL}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is going to work well. In the nvme-cli nightly CI runs there is such a test and it needed a bit of safety net to get it working right, e.g. the device needs time to finish the operation before you can do the next.
https://github.com/linux-nvme/nvme-cli/actions/runs/15625258463/job/44018152431
At least you need to test if the expected formatting operation was been done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @igaw for the review, I have five nvme disks on my local server, and the test works as expected.
It seems that nvme-cli doesn't have such options to wait for the formatting operation to be done.
Do you have any suggestions for checking whether the formatting is done?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait, I've confused the formatting with the create namespace operation. But still you should add a check if the format has at least changed after the nvme format command.
You are right, nvme-cli doesn't have anything like, 'wait for operation to complete' option. Something to consider for sure. Thanks for the input.
Anyway, you might want to add some try check loop nevertheless, e.g.:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, just updated.
|
@yizhanglinux Thanks for this PR. With a first look, this test case looks useful for me. I tried to run the test case for a QEMU NVME device on the kernel v6.16-rc3 applying the patch series titled "fix atomic limits check v2". I observed a lockdep WARN at the first run. More importantly, I observed the test case hang at the 2nd run. For recording, I upload dmesg observed at the WARN and the hang. Yi, do you expect the WARN the hang? |
c91107c to
2181300
Compare
Yeah, seems the test found new issue on kernel side, I didn't find such failure before, let me retest it on the latest linux-block/for-next now. |
Link: https://lore.kernel.org/linux-nvme/[email protected]/ Signed-off-by: Yi Zhang <[email protected]>
41dd731 to
fcd0020
Compare
|
I tried 6 NVMe disks with the latest linux-block/for-next and didn't reproduce the WARNING/hang issue, bug there is one intel NVMe SSD, it reports supported lbaf0 to lbaf6, but the format operation failed with most of the lbaf, maybe there is FW issue with it. |
|
Today, I tried to run the test with v6.17-rc5 kernel. When repeated the test case for 4kb block size QEMU NVME device, the kernel hanged: This symptom is similar as the one I observed in June, so I guess the same cause still exists. udev-worker calls munmap() system call, then a Oops happens. |
Link: https://lore.kernel.org/linux-nvme/[email protected]/