From patchwork Mon Dec 18 15:30:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 18244 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1324836dyi; Mon, 18 Dec 2023 07:34:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IE0z4CWATc/nG4L9NacAeHtnCZwhoFOPUgaX3Zlot0KwiGDTW1JD72FrkqS1QQGtVCilOYN X-Received: by 2002:a05:6870:858d:b0:1fb:75a:c43e with SMTP id f13-20020a056870858d00b001fb075ac43emr15236222oal.103.1702913642500; Mon, 18 Dec 2023 07:34:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702913642; cv=none; d=google.com; s=arc-20160816; b=P8Vf86VynQhLSnpUi4T3yRlVTkqbNFGVAaeuDW0Lrd6z712+h0u1e1rB8khF4f4K3Y p2bHQakAmWQc095Dimhw+ZI521ypIeYL9Tpg8e7UufbDEob5WEIDdGsSnQto58g6mcUQ iPSJj3Z+sHjnzcWpBlDUeu4cDJnRf4NoSGfo7mMg30fhnT5dMfgMD5zveFFac5xA2nnq /KltSMjN2m1FyzLFrhV6bp7jbMt/PXxtVowKmoop/6hIUXP5rjEYbuEyT5Xbz7fPKlKv tOHLwn9YWHJqtEPT7xTxmdQc0T1Np9zFQL6ZtxX0yr2UAKL9ZqdyhhC6kJM4a8q0UVwq CaSg== ARC-Message-Signature: i=1; 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:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=njLtLC3itym9NrsTnjVi0xLEc93Pwe0Q5O8AXSr4XSM=; fh=3QIVKsEmsld8rvcEkMSr/XDw53o2lrGJeYcvS7FhzFk=; b=K2OxpPGDkBK20Hpsju+5tZOGw6dNrTBHl0vXZ3fImgXjcV0FJylp7SRoBEplt76873 FAhLbK1DuPNysdnab2J2BLtjz1kHyhSLcixz/9CAfUEtGLrIiEdyPDiMev4yESuY1bQ9 EV4Lcn+qW4xbiIEOneFHjFF/BwhZBbDhrkKVgsmOWRFnI11AAVL1U0msHoyTB76a4Cno 6yRZattHoi4o50geqQi7yua1CShbG7jPsSLy17LhIvUR5sN1obNkyPZ0MdqKQ7ZD5006 jLuOELhJPfNrxnTkhsEPPbYKVRceTWmKfky3hCnXp5eUZa7Y995uBADzA1wwWENtvTcY Leow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=AUFeoXIO; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=AUFeoXIO; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel+bounces-3938-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3938-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id cm12-20020a05622a250c00b0042548ac376fsi24330004qtb.718.2023.12.18.07.34.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 07:34:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3938-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=AUFeoXIO; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=AUFeoXIO; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel+bounces-3938-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3938-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 392EB1C245AB for ; Mon, 18 Dec 2023 15:34:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5ED6442383; Mon, 18 Dec 2023 15:33:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="AUFeoXIO"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="/moo3VJ6"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="AUFeoXIO"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="/moo3VJ6" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 3C38B3D54B for ; Mon, 18 Dec 2023 15:33:36 +0000 (UTC) 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 [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-out1.suse.de (Postfix) with ESMTPS id 62ADF21F8C; Mon, 18 Dec 2023 15:33:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1702913614; 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; bh=njLtLC3itym9NrsTnjVi0xLEc93Pwe0Q5O8AXSr4XSM=; b=AUFeoXIO1HdHPLnHu4g7wm4ibAq19ZvIzhAZDtj9G4QuAA8r9yNxi3rpcj2EvHp+lwV8YS iRFxT8c+Y7nH7Z2AAwr6kOqcFYl0o/WR5R9tPANiMMtMCI2B45mPLN9IT+sskp29OJzhXY eDEoBZyg6GXgV/ayRwhbeGOnpSzZbok= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1702913614; 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; bh=njLtLC3itym9NrsTnjVi0xLEc93Pwe0Q5O8AXSr4XSM=; b=/moo3VJ6kR7me9WED5q1w9xpkYI6qcxDve4Sx4CJ4vKP1ezwjdxVt8siVzFkeqt7DJhBeU IxFDXoRgRsaMSiAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1702913614; 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; bh=njLtLC3itym9NrsTnjVi0xLEc93Pwe0Q5O8AXSr4XSM=; b=AUFeoXIO1HdHPLnHu4g7wm4ibAq19ZvIzhAZDtj9G4QuAA8r9yNxi3rpcj2EvHp+lwV8YS iRFxT8c+Y7nH7Z2AAwr6kOqcFYl0o/WR5R9tPANiMMtMCI2B45mPLN9IT+sskp29OJzhXY eDEoBZyg6GXgV/ayRwhbeGOnpSzZbok= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1702913614; 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; bh=njLtLC3itym9NrsTnjVi0xLEc93Pwe0Q5O8AXSr4XSM=; b=/moo3VJ6kR7me9WED5q1w9xpkYI6qcxDve4Sx4CJ4vKP1ezwjdxVt8siVzFkeqt7DJhBeU IxFDXoRgRsaMSiAQ== 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 5240513BC8; Mon, 18 Dec 2023 15:33:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id vs5aE05mgGW7fAAAn2gu4w (envelope-from ); Mon, 18 Dec 2023 15:33:34 +0000 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Christoph Hellwig , Sagi Grimberg , Keith Busch , James Smart , Hannes Reinecke , Daniel Wagner Subject: [PATCH v3 00/17] enable nvmet-fc for blktests Date: Mon, 18 Dec 2023 16:30:48 +0100 Message-ID: <20231218153105.12717-1-dwagner@suse.de> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: * Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: X-Spam-Score: 0.71 X-Spamd-Result: default: False [0.71 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; 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]; BROKEN_CONTENT_TYPE(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.19)[-0.926]; RCPT_COUNT_SEVEN(0.00)[8]; MID_CONTAINS_FROM(1.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Flag: NO X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785634375349810773 X-GMAIL-MSGID: 1785634375349810773 Another update on getting nvmet-fc ready for blktests. The main change here is that I tried make sense of the ref count taking in nvmet-fc. When running blktests with the auto connect udev rule activated the additional connect attempt etc made nvmet-fc explode and choke everywhere. After a lot of poking and pondering I decided to change the rules who the ref counts are taken for the ctrl, association, target port and host port. This made a big difference and I am able to get blktests pass the tests. Also KASAN was reporting a lot of UAFs. There are still some problems left as I can still observe hangers when running blktests in a loop for a while. But it doesn't explode immediately so I consider this a win. Apropos KASAN, it still reports the problem from [1], so anyone who want to run this series needs to revert ee6fdc5055e9 ("nvme-fc: fix race between error recovery and creating association"). The first four patches are independent of the rest and could go in sooner. [1] https://lore.kernel.org/linux-nvme/hkhl56n665uvc6t5d6h3wtx7utkcorw4xlwi7d2t2bnonavhe6@xaan6pu43ap6/ changes: v3: - collected all patches into one series - updated ref counting in nvmet-fc v2: - added RBs - added new patches - https://lore.kernel.org/linux-nvme/20230620133711.22840-1-dwagner@suse.de/ v1: - https://lore.kernel.org/linux-nvme/20230615094356.14878-1-dwagner@suse.de/ Daniel Wagner (16): nvmet: report ioccsz and iorcsz for disc ctrl nvmet-fc: remove unnecessary bracket nvmet-trace: avoid dereferencing pointer too early nvmet-trace: null terminate device name string correctly nvmet-fcloop: Remove remote port from list when unlinking nvme-fc: Do not wait in vain when unloading module nvmet-fc: Release reference on target port nvmet-fc: untangle cross refcounting objects nvmet-fc: free queue and assoc directly nvmet-fc: hold reference on hostport match nvmet-fc: remove null hostport pointer check nvmet-fc: do not tack refs on tgtports from assoc nvmet-fc: abort command if when there is binding nvmet-fc: free hostport after release reference to tgtport nvmet-fc: avoid deadlock on delete association path nvmet-fc: take ref count on tgtport before delete assoc drivers/nvme/host/fc.c | 20 +++-- drivers/nvme/target/discovery.c | 13 +++ drivers/nvme/target/fc.c | 153 ++++++++++++++++++-------------- drivers/nvme/target/fcloop.c | 7 +- drivers/nvme/target/trace.c | 6 +- drivers/nvme/target/trace.h | 33 ++++--- 6 files changed, 135 insertions(+), 97 deletions(-)