Skip to contentSkip to conversation

nvme_fc: require target or discovery role for fc-nvme targets

PATCH New [email protected] 3 participants 3 messages May 5, 2017 – May 10, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme_fc: require target or discovery role for fc-nvme targets

From: James Smart <[email protected]>

In order to create an association, the remoteport must be serving either a target role or a discovery role.

Signed-off-by James Smart <james.smart at broadcom.com>
---
 drivers/nvme/host/fc.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/nvme/host/fc.c +6 -0
index 9993ff8d5656..e8f4cbdb9b5f 100644
@@ -2712,6 +2712,12 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
 	unsigned long flags;
 	int ret, idx;
 
+	if (!(rport->remoteport.port_role &
+		(FC_PORT_ROLE_NVME_DISCOVERY | FC_PORT_ROLE_NVME_TARGET))) {
+		ret = -EBADR;
+		goto out_fail;
+	}
+
 	ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL);
 	if (!ctrl) {
 		ret = -ENOMEM;
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 nvme_fc: require target or discovery role for fc-nvme targets

Quoted 7 lines · On 05/06/2017 01:13 AM, [email protected] wrote:

From: James Smart <jsmart2021 at gmail.com>

In order to create an association, the remoteport must be serving either a target role or a discovery role.

Signed-off-by James Smart <james.smart at broadcom.com>

---

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850