nvme-cli: Increase size of ONTAP namespace path variable
PATCH 1/1 nvme-cli: Increase size of ONTAP namespace path variable
nspath's size is ONTAP_NS_PATHLEN and is written to by:
snprintf(nspath, ONTAP_NS_PATHLEN, "%s%s%s%s", ontap_vol,
vol_name, "/", ns_name);
Required bytes:
- ontap_vol is a constant char pointer, set to "/vol/", so 5 bytes
- vol_name's size is ONTAP_LABEL_LEN, which is 260, deducting the null-byte for termination makes 259 required bytes
- "/" is 1 byte
- ns_name's size is also ONTAP_LABEL_LEN, which is 260, deducting the null-byte for termination makes 259 required bytes
- the final null-byte: 1
That makes in total 5 + 259 + 1 + 259 + 1 = 525 required bytes
--- plugins/netapp/netapp-nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
plugins/netapp/netapp-nvme.c +1 -1
@@ -35,7 +35,7 @@#define ONTAP_C2_LOG_ID 0xC2#define ONTAP_C2_LOG_SIZE 4096#define ONTAP_LABEL_LEN 260 -#define ONTAP_NS_PATHLEN 520 +#define ONTAP_NS_PATHLEN 525enum {NNORMAL ,
Signature · 1 line
2.16.4
PATCH 1/1 nvme-cli: Increase size of ONTAP namespace path variable
Quoted 15 lines · Simon Schricker
nspath's size is
ONTAP_NS_PATHLENand is written to by:snprintf(nspath,
ONTAP_NS_PATHLEN, "%s%s%s%s",ontap_vol,vol_name, "/", ns_name);Required bytes:
-
ontap_volis a constant char pointer, set to "/vol/", so 5 bytes
- vol_name's size isONTAP_LABEL_LEN, which is 260, deducting the null-byte for termination makes 259 required bytes
- "/" is 1 byte
- ns_name's size is alsoONTAP_LABEL_LEN, which is 260, deducting the null-byte for termination makes 259 required bytes
- the final null-byte: 1
Quoted 1 line
That makes in total 5 + 259 + 1 + 259 + 1 = 525 required bytes
Applied, thanks.