Message ID | 20240131085112.21668-10-dwagner@suse.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-46076-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1758456dyb; Wed, 31 Jan 2024 01:02:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IHq9i1h/OaSWABAzYZ284NM7I9J5hwsqJmxX7e4VCGpQ/WESbAyfBC5zII1X4jj6ZmrIyc2 X-Received: by 2002:ac8:5cd1:0:b0:42a:894d:8dd8 with SMTP id s17-20020ac85cd1000000b0042a894d8dd8mr862680qta.21.1706691723887; Wed, 31 Jan 2024 01:02:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706691723; cv=pass; d=google.com; s=arc-20160816; b=aE1fuozjI7Tikin1GbSQ9ZVPBKwLw5zDK47IjpvXjEqSDODIwYRFN9simeq8cSK4pw D1YiG2yUy5n15IpqaqxLeg2ho7d4OeDOnPI1DVnYEXKw6MbZR9ULdRTQDXnHPwDskE3h 5ZJlgc+w4f4mVchv2ArVXQTmVVRjLkcuEZv9oaUzQenwoPzcRXMqEvzCinfIVrrjU4Ul OrZ3YZwK6lHOnv1mD24qx1XqE68kLiPleV2Cl4wHVJ+mxUUcv52QVkhuLqAq1jN37ZNZ in7wlFEKSppfCtoxJTnVO0AbQMiqa8VmFcucLC42xfIoGhyl8cF3OlQzlKDaVn2caeqD gypQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-signature :dkim-signature:dkim-signature; bh=NwD69Rb4Ovy/rg6BuDZUolwj46uS8Nqdj2ffUDESYmI=; fh=FM6lpdM6W+gcBIDICsPK5O0zMLZlgMnSyEgW3iAspMs=; b=hpNvxyIT+oaRcHp52ahCSwcwxUopGtx5jv1OV9cTjX7osq7uXjtORq0J7EL7sUzfFG a9xPySZqZ16bILOkAc7FSksoUxnHlzCTelSE4p9WoRLMo2A4lDrRCpuIYZHlNVeEiBsc /pkQD4obt7hIBtzevBy/yqTQN41YVwdEgXZCLfD6ZPfi/CNaZMKUY01v0WTHg9WOndlM tPeP4DReNn2v6lpKYIzhkMHRK6QO3CaASixmM8dbv3gfvcB0sKxXuwt+J7eXba7Iqxqh oFps/IkuFDiq82aZWaKA2Xj3wfA0W+r89fFXINYUTuGtqPk+xhawTGBr8KalNNcgglAA o6HQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="qBJYU/tI"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="qBJYU/tI"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-46076-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46076-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de X-Forwarded-Encrypted: i=1; AJvYcCXwHEK7e4nIWanFBa6A6j5LNNbsCLJ8L5ypDGFECsaIQlO8BgzbCCJXhFRCBa/NuGlAfL5hef8e3pc4ghKkVVsnj5qdww== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id t16-20020a05622a149000b0042ab13b5782si4201685qtx.95.2024.01.31.01.02.03 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 01:02:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46076-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="qBJYU/tI"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="qBJYU/tI"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-46076-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46076-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9BF2B1C20CA8 for <ouuuleilei@gmail.com>; Wed, 31 Jan 2024 09:02:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8FF018287E; Wed, 31 Jan 2024 08:51:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="qBJYU/tI"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="uI5ABNFF"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="qBJYU/tI"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="uI5ABNFF" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A80D879DA4 for <linux-kernel@vger.kernel.org>; Wed, 31 Jan 2024 08:51:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706691090; cv=none; b=bMxJ23n4IucNm3hVlmzj/t2C6DMXKKaPRxxBK/4kWCSgT4YGCiOe93XXKuzZZADPGaP0U2VYyLw7TO4DwQA2YGReOo7ldsnxRLpofAZOx2Q73HINZutXk6aH7An59T6KqxhQJRkQ2YBj/g9g1Ln23AKNExQXswKlvK8VeSvdqZ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706691090; c=relaxed/simple; bh=coe/c0JKdSouUfLh6dzFg4/7jsYn8i3YdtJ4V6+eiMs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jA5KkJ6sbwuXOp6Oo1qgaaVW/EaRhEFXhSWV+eAicyTjqEymltg3D77YWWCs63zRFPeEOUK1w3TM+YWiWXBL1gp13vHWqMF8PF4XeOW3ANcHEUOTOoSgW/iI3lB3kcO5t5ykCQm5quzK94kHF0IqT6g2/VC9Tv/xUq82Fh0gwf0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=qBJYU/tI; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=uI5ABNFF; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=qBJYU/tI; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=uI5ABNFF; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 03F221FD0A; Wed, 31 Jan 2024 08:51:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706691087; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NwD69Rb4Ovy/rg6BuDZUolwj46uS8Nqdj2ffUDESYmI=; b=qBJYU/tI6j44El8T38dpMPmQFBHQ7EV+uE73VMBvrYlvgInoeeMOhk/IPLrLu8AqVA6a4n gb1e50BqDnsl5RSbhSOGukyuA4Fl1eW5Rhp4yxiO1DUJLmwKLKvlKzKxU/rEDiAjPq2GsW s78FDYPTS8e+pHQuOTiAEfqfJVt6/+g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706691087; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NwD69Rb4Ovy/rg6BuDZUolwj46uS8Nqdj2ffUDESYmI=; b=uI5ABNFFvxjGkzFXZmBy6BLnb78DDdvMbwLRHoomuwcUdrhh++C8RkPRJj7TDKbtbkacjW MldXcc7gZBA39IAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706691087; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NwD69Rb4Ovy/rg6BuDZUolwj46uS8Nqdj2ffUDESYmI=; b=qBJYU/tI6j44El8T38dpMPmQFBHQ7EV+uE73VMBvrYlvgInoeeMOhk/IPLrLu8AqVA6a4n gb1e50BqDnsl5RSbhSOGukyuA4Fl1eW5Rhp4yxiO1DUJLmwKLKvlKzKxU/rEDiAjPq2GsW s78FDYPTS8e+pHQuOTiAEfqfJVt6/+g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706691087; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NwD69Rb4Ovy/rg6BuDZUolwj46uS8Nqdj2ffUDESYmI=; b=uI5ABNFFvxjGkzFXZmBy6BLnb78DDdvMbwLRHoomuwcUdrhh++C8RkPRJj7TDKbtbkacjW MldXcc7gZBA39IAg== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id E54E5132FA; Wed, 31 Jan 2024 08:51:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 9PmSNg4KumWYHAAAn2gu4w (envelope-from <dwagner@suse.de>); Wed, 31 Jan 2024 08:51:26 +0000 From: Daniel Wagner <dwagner@suse.de> To: James Smart <james.smart@broadcom.com> Cc: Keith Busch <kbusch@kernel.org>, Christoph Hellwig <hch@lst.de>, Hannes Reinecke <hare@suse.de>, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Daniel Wagner <dwagner@suse.de> Subject: [PATCH v5 09/12] nvmet-fc: abort command when there is no binding Date: Wed, 31 Jan 2024 09:51:09 +0100 Message-ID: <20240131085112.21668-10-dwagner@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240131085112.21668-1-dwagner@suse.de> References: <20240131085112.21668-1-dwagner@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="qBJYU/tI"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=uI5ABNFF X-Spamd-Result: default: False [-1.52 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DWL_DNSWL_HI(-3.50)[suse.de:dkim]; BROKEN_CONTENT_TYPE(1.50)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; RCPT_COUNT_SEVEN(0.00)[7]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-2.71)[98.74%] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: 03F221FD0A X-Spam-Level: X-Spam-Score: -1.52 X-Spam-Flag: NO X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789595981323208503 X-GMAIL-MSGID: 1789595981323208503 |
Series |
enable nvmet-fc for blktests
|
|
Commit Message
Daniel Wagner
Jan. 31, 2024, 8:51 a.m. UTC
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: Hannes Reinecke <hare@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Daniel Wagner <dwagner@suse.de> --- drivers/nvme/target/fc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c index fe3246024836..c80b8a066fd1 100644 --- a/drivers/nvme/target/fc.c +++ b/drivers/nvme/target/fc.c @@ -1099,6 +1099,9 @@ nvmet_fc_alloc_target_assoc(struct nvmet_fc_tgtport *tgtport, void *hosthandle) int idx; bool needrandom = true; + if (!tgtport->pe) + return NULL; + assoc = kzalloc(sizeof(*assoc), GFP_KERNEL); if (!assoc) return NULL; @@ -2514,8 +2517,9 @@ 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) - fod->req.port = tgtport->pe->port; + if (!tgtport->pe) + goto transport_error; + fod->req.port = tgtport->pe->port; /* clear any response payload */ memset(&fod->rspiubuf, 0, sizeof(fod->rspiubuf));