Changes determination of Device Self-Test in progress to be based on the
Current Device Self-Test Operation field as opposed to the Current
Device Self-Test Completion field.
Current implementation assumes that the Current Device Self-Test
Completion field will be 100% when no Device Self-Test operation is in
progress. This is an unsafe assumption as the NVMe Specification
explicitly specifies that the Current Device Self-Test Completion field
is invalid when no Device Self-Test operation in progress as indicated
by a value of 0 in the Current Device Self-Test Operation field.
A safe assumption is to use the Current Device Self-Test Operation field
which will be 0 when no Device Self-Test operation is in progress.
Signed-off-by: ekohande <abe.kohandel@intel.com>
err = nvme_self_test_log(fd, &self_test_log);
if (!err) {
- if (self_test_log.crnt_dev_selftest_compln == 100) {
+ if (self_test_log.crnt_dev_selftest_oprn == 0) {
if (fmt == BINARY)
d_raw((unsigned char *)&self_test_log, sizeof(self_test_log));
else if (fmt == JSON)