Received: by 2002:a05:7412:8d06:b0:f9:332d:97f1 with SMTP id bj6csp24987rdb; Mon, 18 Dec 2023 08:01:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IHAYhrZV1djd+6n2IaQZ6oQAKUtCJ0Plk79WIDhkmsx22rBrOV9psfLCMQjdC6zsTX1arHL X-Received: by 2002:a05:620a:2946:b0:77e:fba3:58ed with SMTP id n6-20020a05620a294600b0077efba358edmr20345271qkp.126.1702915297504; Mon, 18 Dec 2023 08:01:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702915297; cv=none; d=google.com; s=arc-20160816; b=V3VJAAmnU3tGUYSYjLA5uTvQgywv8nr1uXYQPXKUMctWlGmqhz68oCbAWvKvXdQo3V 2cWRHhzPyyGlC6wTTtqZnWhry6VmxKNXmc0NGfziXgPE3b0m7fHLL1k/fUG3mSdV7+uy VfwCgt83LlraJXR4VG51zwGYoH7Jo+BVwAEx73ihaFoBmk2pO/S+HiDqNg6J7X681eiE Q+X4qnTJJNOhRzxftcmHxkkAEOzsZyTeI1GLfjLOdJXPdp2nbYzWHPqpbfCkRAAFUZYu wXCo9Z6qzVDGeE0Crz2I4U3U61TQdDj7sFcQp17TtdCRRpbhuui7zEoxPVm+3GGh3cQ0 VMcA== 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:references:in-reply-to:message-id :date:subject:cc:to:from; bh=HR1hPaZ08JIcimayKpCp+hCqsw6yOAyawjKcFadv8pA=; fh=3QIVKsEmsld8rvcEkMSr/XDw53o2lrGJeYcvS7FhzFk=; b=S5cj9/icClWftN/3AvBQWLL9cUMZ8/lFfcf9J3446v/nMCm1nlT0+uOU/gO13SVfeL cPzyYH5Gz6bI8444HC5Fv9WuG05IokdhQ+v3+Kf+93glbDS2BjSaRvuLzzXItCqmoT5G 2H2gsGZPbl7NuHN9aXTMMUtshYb5qvxcd3ycMbf4SJdOChIThK+k015F4rsVhAiHT143 b8PRw6Hd9+Q7UuGg0t2I75F5jtV/f7mOCPr4Jv2Lw3B4Y877WBzYxQriikww0YIRMAH8 H4E4vq0PIn5AaTey1sGaR/KS9deeWtWr/ITvytcQ0gmuQByY+D8tqPs6y2w7x3X5fSxs BvxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-4009-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4009-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bi35-20020a05620a31a300b0077dbbbf53a6si19757211qkb.557.2023.12.18.08.01.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 08:01:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4009-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; spf=pass (google.com: domain of linux-kernel+bounces-4009-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4009-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (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 421D41C255BF for ; Mon, 18 Dec 2023 16:01:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 439623D57F; Mon, 18 Dec 2023 16:00:39 +0000 (UTC) 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 7F2863D57B for ; Mon, 18 Dec 2023 16:00:37 +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 [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-out1.suse.de (Postfix) with ESMTPS id C824421FC5; Mon, 18 Dec 2023 16:00:35 +0000 (UTC) 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 B426E13BC8; Mon, 18 Dec 2023 16:00:35 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id Gld1KqNsgGWzAwAAn2gu4w (envelope-from ); Mon, 18 Dec 2023 16:00:35 +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 12/16] nvmet-fc: do not tack refs on tgtports from assoc Date: Mon, 18 Dec 2023 16:31:00 +0100 Message-ID: <20231218153105.12717-13-dwagner@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218153105.12717-1-dwagner@suse.de> References: <20231218153105.12717-1-dwagner@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Level: X-Spam-Level: Authentication-Results: smtp-out1.suse.de; none X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Score: -4.00 X-Rspamd-Queue-Id: C824421FC5 X-Spam-Flag: NO The association life time is tight to the life time of the target port. That means we do not take extra a refcount when creating a association. Signed-off-by: Daniel Wagner --- drivers/nvme/target/fc.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c index c243085d6f42..47cecc8c72b2 100644 --- a/drivers/nvme/target/fc.c +++ b/drivers/nvme/target/fc.c @@ -1109,12 +1109,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; @@ -1144,8 +1141,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_free(&tgtport->assoc_cnt, idx); out_free_assoc: @@ -1182,7 +1177,6 @@ nvmet_fc_target_assoc_free(struct kref *ref) dev_info(tgtport->dev, "{%d:%d} Association freed\n", tgtport->fc_target_port.port_num, assoc->a_id); - nvmet_fc_tgtport_put(tgtport); kfree(assoc); } -- 2.43.0