Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d338fb1 authored by Daniel Wagner's avatar Daniel Wagner Committed by Greg Kroah-Hartman
Browse files

nvmet-fc: abort command when there is no binding



[ Upstream commit 3146345c2e9c2f661527054e402b0cfad80105a4 ]

When the target port has not active port binding, there is no point in
trying to process the command as it has to fail anyway. Instead adding
checks to all commands abort the command early.

Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDaniel Wagner <dwagner@suse.de>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent ac524b7b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -796,6 +796,9 @@ nvmet_fc_alloc_target_assoc(struct nvmet_fc_tgtport *tgtport)
	int idx;
	bool needrandom = true;

	if (!tgtport->pe)
		return NULL;

	assoc = kzalloc(sizeof(*assoc), GFP_KERNEL);
	if (!assoc)
		return NULL;
@@ -2180,7 +2183,8 @@ nvmet_fc_handle_fcp_rqst(struct nvmet_fc_tgtport *tgtport,

	fod->req.cmd = &fod->cmdiubuf.sqe;
	fod->req.cqe = &fod->rspiubuf.cqe;
	if (tgtport->pe)
	if (!tgtport->pe)
		goto transport_error;
	fod->req.port = tgtport->pe->port;

	/* clear any response payload */