Skip to content

Commit be2d5fa

Browse files
jeff-lien-sndkigaw
authored andcommitted
wdc: Fix for get-drive-status wdc plugin command
With fabric attached drives, the PCI device id is not accessible. Therefore, capability checks based on device id are not possible. Added a default else leg that should catch these cases. Signed-off-by: jeff-lien-sndk <[email protected]>
1 parent 1494a4d commit be2d5fa

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

plugins/wdc/wdc-nvme.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2698,7 +2698,7 @@ static bool get_dev_mgment_data(nvme_root_t r, struct nvme_dev *dev,
26982698
(wdc_is_sn640_3(device_id) || wdc_is_sn655(device_id)))
26992699
uuid_index = nvme_uuid_find(&uuid_list, WDC_UUID_SN640_3);
27002700

2701-
if (uuid_index > 0)
2701+
if (uuid_index >= 0)
27022702
found = get_dev_mgmt_log_page_data(dev, data, uuid_index);
27032703
} else if (needs_c2_log_page_check(device_id)) {
27042704
/* In certain devices that don't support UUID lists, there are multiple
@@ -2718,6 +2718,10 @@ static bool get_dev_mgment_data(nvme_root_t r, struct nvme_dev *dev,
27182718

27192719
found = get_dev_mgmt_log_page_data(dev, data, uuid_index);
27202720
}
2721+
} else {
2722+
/* Default to uuid-index 0 for cases where UUID lists are not supported */
2723+
uuid_index = 0;
2724+
found = get_dev_mgmt_log_page_data(dev, data, uuid_index);
27212725
}
27222726

27232727
return found;
@@ -2752,13 +2756,9 @@ static bool get_dev_mgment_cbs_data(nvme_root_t r, struct nvme_dev *dev,
27522756
uuid_index = nvme_uuid_find(&uuid_list, WDC_UUID_SN640_3);
27532757
}
27542758

2755-
if (uuid_index > 0)
2759+
if (uuid_index >= 0)
27562760
found = get_dev_mgmt_log_page_lid_data(dev, cbs_data, lid,
27572761
log_id, uuid_index);
2758-
2759-
} else if (wdc_is_zn350(device_id)) {
2760-
uuid_index = 0;
2761-
found = get_dev_mgmt_log_page_lid_data(dev, cbs_data, lid, log_id, uuid_index);
27622762
} else if (needs_c2_log_page_check(device_id)) {
27632763
/* In certain devices that don't support UUID lists, there are multiple
27642764
* definitions of the C2 logpage. In those cases, the code
@@ -2776,6 +2776,10 @@ static bool get_dev_mgment_cbs_data(nvme_root_t r, struct nvme_dev *dev,
27762776
found = get_dev_mgmt_log_page_lid_data(dev, cbs_data, lid, log_id,
27772777
uuid_index);
27782778
}
2779+
} else {
2780+
/* Default to uuid-index 0 for cases where UUID lists are not supported */
2781+
uuid_index = 0;
2782+
found = get_dev_mgmt_log_page_lid_data(dev, cbs_data, lid, log_id, uuid_index);
27792783
}
27802784

27812785
return found;

plugins/wdc/wdc-nvme.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#if !defined(WDC_NVME) || defined(CMD_HEADER_MULTI_READ)
66
#define WDC_NVME
77

8-
#define WDC_PLUGIN_VERSION "2.14.3"
8+
#define WDC_PLUGIN_VERSION "2.14.4"
99
#include "cmd.h"
1010

1111
PLUGIN(NAME("wdc", "Western Digital vendor specific extensions", WDC_PLUGIN_VERSION),

0 commit comments

Comments
 (0)