]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
nvme-cli: Increase size of ONTAP namespace path variable
authorSimon Schricker <sschricker@suse.de>
Tue, 16 Apr 2019 13:27:40 +0000 (06:27 -0700)
committerKeith Busch <keith.busch@intel.com>
Wed, 17 Apr 2019 22:43:32 +0000 (16:43 -0600)
commitfefedba848578c83ccefcb9be0b71f13e9913481
treefd7829c7b1d2396da4c842414ae3c904d67892f5
parentb4d682e8b1795b513cd1ed208c11a1d7bf527ab1
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

Signed-off-by: Simon Schricker <sschricker@suse.de>
plugins/netapp/netapp-nvme.c