* [PATCH] nvme-cli: Increase size of ONTAP namespace path variable
@ 2019-04-16 13:27 Simon Schricker
2019-04-17 22:46 ` Keith Busch
0 siblings, 1 reply; 2+ messages in thread
From: Simon Schricker @ 2019-04-16 13:27 UTC (permalink / raw)
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
Signed-off-by: Simon Schricker <sschricker at suse.de>
---
plugins/netapp/netapp-nvme.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/netapp/netapp-nvme.c b/plugins/netapp/netapp-nvme.c
index 2951311..aa5a94d 100644
--- a/plugins/netapp/netapp-nvme.c
+++ b/plugins/netapp/netapp-nvme.c
@@ -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 525
enum {
NNORMAL,
--
2.16.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] nvme-cli: Increase size of ONTAP namespace path variable
2019-04-16 13:27 [PATCH] nvme-cli: Increase size of ONTAP namespace path variable Simon Schricker
@ 2019-04-17 22:46 ` Keith Busch
0 siblings, 0 replies; 2+ messages in thread
From: Keith Busch @ 2019-04-17 22:46 UTC (permalink / raw)
On Tue, Apr 16, 2019@06:27:40AM -0700, Simon Schricker wrote:
> 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
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-04-17 22:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-16 13:27 [PATCH] nvme-cli: Increase size of ONTAP namespace path variable Simon Schricker
2019-04-17 22:46 ` Keith Busch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).