]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-fcloop: verify wwnn and wwpn format
authorDongli Zhang <dongli.zhang@oracle.com>
Tue, 26 May 2020 04:21:18 +0000 (21:21 -0700)
committerChristoph Hellwig <hch@lst.de>
Wed, 8 Jul 2020 14:16:17 +0000 (16:16 +0200)
commit2f2b75d4a29a44d30da67f7266c8bb2bf0ddee85
tree243b384595d73287efe7ba5afd09b44c9f737666
parentf570a11b09467941fbc34874ccf11d827fc7de79
nvme-fcloop: verify wwnn and wwpn format

The nvme host and target verify the wwnn and wwpn format via
nvme_fc_parse_traddr(). For instance, it is required that the length of
wwnn to be either 21 ("nn-0x") or 19 (nn-).

Add this verification to nvme-fcloop so that the input should always be in
hex and the length of input should always be 18.

Otherwise, the user may use e.g. 0x2 to create fcloop local port, while
0x0000000000000002 is required for nvme host and target. This makes the
requirement of format confusing.

Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/fcloop.c