Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp594164rdh; Wed, 7 Feb 2024 14:03:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXVs92C5xaCAdD3XCKOZIdO80pFBlfe13sVvO5G00wSG+stBG64IEWf9vkEy7QvAb0AMLC5Ph7cLCzAyznTmkkzcXEcWn/YAl7BqyHkZg== X-Google-Smtp-Source: AGHT+IHfw7RFH4ds2+kissjlja4EzyTL/Tbf+CA+tcI5hIMpme5GtA+1qG3o9RTzBcWLToa+Ufv1 X-Received: by 2002:a05:6214:c6a:b0:68c:88a4:3fdd with SMTP id t10-20020a0562140c6a00b0068c88a43fddmr7902927qvj.27.1707343386236; Wed, 07 Feb 2024 14:03:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707343386; cv=pass; d=google.com; s=arc-20160816; b=WbNK6NJkG/DjIIHLjQspHeRNOI/Q3CyySGUsgf82KN1Kuq1izgi8mR1HpqJcvnxJc5 o2p7Vmbt//yQLcaHlp69Q97CA2qTLobPfOc0bDvGtnSL44kAR9UXXpK0IGVGqw5Es/Mo H/uXWAmIFsfmBKD62B8BbRJ1pNxkUmaT1MANf3CsUSAq7WcdQSYuNyBDDnyZdIcY/P0o qGW2jL7AsH7fGv2Qfp4yaDUXFnDtXVBoPF2zu+Cr0LmSAulFnyEemv4e/legWeZZrDaW RY+CtzeT1LOcmdIdC2s5eLiI6Y2Pdc6BYNg4EmNtuqQEzbg5sanGCwPDCNCZNfmqen0V uPJA== 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; bh=JJysPI4Dke5oSXkk/rBXtMZVX/8MT+TfDD6txgTUSnE=; fh=XEACI8kBN6cZth4Q99Tne14rdvDxoSUSov02YUQ+7zI=; b=y3dYPx3NF2EssE0uRnvmXU5WS2BnMfy8UeYKJqcIQrHQHWJNj7Pv6IlOfQ/crugbjU Hhd0Ay5kD1qlpY0S5rsbVPY2cHYCY48zkR6qDqdkChc+5I6zdMdwx1YfwnDQb9ljsUnB Uph7MZz9m4CLq59ZjBoSevW55G7Ttqzs/JHxJnytF+ixhfRVj9LDJTufvufMuiaEhyQP C+XgLv5cc+Q+5dryjPF1XS4JF/mDdvLgZ5D0s88lsVsDmruDe10y2BhE+DGnEoPFb0G7 GLgl2qqSE2xJPn+tJOxot07xuSPr9lOc5X0ee+I7XOCVONo5IIEUNrl4roRtpe/9NK8H ct6w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rqGgRgZi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-57215-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57215-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCUrNUEzVXYbA1XcZXq46orSZsqAgjCEf7TwHTu2wZfth0OtUm9M7OkPm7abfInt0I52pdRWpdAaXfbU9viJA/ZM2z1V9vG9Fp76Vogxvg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id di2-20020ad458e2000000b0068c886a3260si1935336qvb.480.2024.02.07.14.03.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 14:03:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57215-linux.lists.archive=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=@kernel.org header.s=k20201202 header.b=rqGgRgZi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-57215-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57215-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 009EE1C24A85 for ; Wed, 7 Feb 2024 22:03:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FE9E143674; Wed, 7 Feb 2024 21:27:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rqGgRgZi" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 524EF143661; Wed, 7 Feb 2024 21:27:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707341245; cv=none; b=ExU/J9Z0sSnMafhv0J/PVaxSGzJDWvtOfcKwZ2rAJ8xO2QRvpZt1nC2KCOxT7cgPqJDUiFtIU99TLLuTorGLLwsTFxA3Vgph3sBJoSXv+T4ZUOkYIiK8msPt4n+oT9vwV4vgmzLdQgCWxcoS+CtoQTO3KYrXpBE18r8oKAq/17o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707341245; c=relaxed/simple; bh=QOfzfBWnSePPrn3EU/czqjpW8X2ZbStvoN5lzrDArKM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jyvmzaJiL1hkOOIxNzBaxpIK+kwhkAi3+m7q8b5TKJDBNhpUsGiuOncBPFEoTu1sPrWtnPhZYrkN0UTJiI4ozKz4xjv95c3IER+VoYRSnfC4aXqiZdmBT+tRge3fFiBeNJ6JZCk0BYNiCJYK+xBjk1hB7V5eYHDhJ09ZT4BtWXY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rqGgRgZi; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7C21C43394; Wed, 7 Feb 2024 21:27:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707341245; bh=QOfzfBWnSePPrn3EU/czqjpW8X2ZbStvoN5lzrDArKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rqGgRgZiFF7NOR55bEjMMgxIC5FY+6mPPpK8Wd7NhVkN8VgilQlLOO4RuAPCp11tB j/kHl31U7cnfKgYlvcIFwvhuI6vdGH8sgZbx+NlIQr4u5SRytYA8Su7J3l5LymEaHZ QiCAk4JisXokGU8jqvc2d2Ul/sY7wUf+tWjGvRQj/UrnDbL4GOXHofGCP1uLf9L+KJ X+oOW/Mou0SftLETm1pTf8z8fsCOtMIe4wQ/quaTqgmNPfQOIOVp9vPv6Id4pO1WrO AziBPjY5eGy5BKpZ7ezSmyuv2hmsuz57N3u0czl/wiEq2SXv0FDCAI84JpfOj9bZwa QjMOySDjK4pqQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Daniel Wagner , Hannes Reinecke , Christoph Hellwig , Keith Busch , Sasha Levin , james.smart@broadcom.com, sagi@grimberg.me, kch@nvidia.com, linux-nvme@lists.infradead.org Subject: [PATCH AUTOSEL 5.10 13/16] nvmet-fc: do not tack refs on tgtports from assoc Date: Wed, 7 Feb 2024 16:26:53 -0500 Message-ID: <20240207212700.4287-13-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240207212700.4287-1-sashal@kernel.org> References: <20240207212700.4287-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.10.209 Content-Transfer-Encoding: 8bit From: Daniel Wagner [ Upstream commit 1c110588dd95d21782397ff3cbaa55820b4e1fad ] The association life time is tied to the life time of the target port. That means we should not take extra a refcount when creating a association. Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Daniel Wagner Signed-off-by: Keith Busch Signed-off-by: Sasha Levin --- drivers/nvme/target/fc.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c index 18a64a4fd8da..ebbc513682e1 100644 --- a/drivers/nvme/target/fc.c +++ b/drivers/nvme/target/fc.c @@ -1110,12 +1110,9 @@ nvmet_fc_alloc_target_assoc(struct nvmet_fc_tgtport *tgtport, void *hosthandle) if (idx < 0) goto out_free_assoc; - if (!nvmet_fc_tgtport_get(tgtport)) - goto out_ida; - assoc->hostport = nvmet_fc_alloc_hostport(tgtport, hosthandle); if (IS_ERR(assoc->hostport)) - goto out_put; + goto out_ida; assoc->tgtport = tgtport; assoc->a_id = idx; @@ -1145,8 +1142,6 @@ nvmet_fc_alloc_target_assoc(struct nvmet_fc_tgtport *tgtport, void *hosthandle) return assoc; -out_put: - nvmet_fc_tgtport_put(tgtport); out_ida: ida_simple_remove(&tgtport->assoc_cnt, idx); out_free_assoc: -- 2.43.0