From patchwork Tue Oct 18 13:57:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 616381 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57F13C43217 for ; Tue, 18 Oct 2022 13:57:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229998AbiJRN5m (ORCPT ); Tue, 18 Oct 2022 09:57:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230020AbiJRN5j (ORCPT ); Tue, 18 Oct 2022 09:57:39 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2506CD0182; Tue, 18 Oct 2022 06:57:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=2O0+kVa1PjbazyStYtpeTghJkhPX4oZ74tmjFAj5Rao=; b=aagk1VjbkVsBPoocJusgiQc2bn /oQgv1W38mXFsqNI1jSHDScFwnGgNYYY77omhNgo+/+t7dk9RrjA/aFaN3+3hoo7nDSHJXAzxtX+9 9NM/EAKj4IfcKFiALNRRtdzvPWskGvR6gAcUM0xNaDwFbxWcjXRpS6mpStUKeH7PDR7pDwmfjZkXT gR/pL79rkzRpFENs81NnFHMLLrSubTRc8hIi8FMyC35l1rxJTKz0pIkyoNwixdFZdSik1J76jetxw UdHrIVGgaq/Epia8B7XaWD0FFF9chdlMTcGrLGvtUKkmCVWZaZw8HQevRps+S4AHjH9xB4TKV0cMa 4qhYzB9Q==; Received: from [2001:4bb8:199:ad84:3a05:173d:d0f5:e725] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1okn63-007C79-TW; Tue, 18 Oct 2022 13:57:32 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Hector Martin , Sven Peter , Keith Busch , Sagi Grimberg , "Martin K. Petersen" , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org Subject: [PATCH 2/4] scsi: remove an extra queue reference Date: Tue, 18 Oct 2022 15:57:18 +0200 Message-Id: <20221018135720.670094-3-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221018135720.670094-1-hch@lst.de> References: <20221018135720.670094-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Now that blk_mq_destroy_queue does not release the queue reference, there is no need for a second queue reference to be held by the scsi_device. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg --- drivers/scsi/scsi_scan.c | 1 - drivers/scsi/scsi_sysfs.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 5d27f5196de6f..0a95fa787fdf4 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -344,7 +344,6 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, sdev->request_queue = q; q->queuedata = sdev; __scsi_init_queue(sdev->host, q); - WARN_ON_ONCE(!blk_get_queue(q)); depth = sdev->host->cmd_per_lun ?: 1; diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 1214c6f07bc64..c95177ca6ed26 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -1478,7 +1478,6 @@ void __scsi_remove_device(struct scsi_device *sdev) mutex_unlock(&sdev->state_mutex); blk_mq_destroy_queue(sdev->request_queue); - blk_put_queue(sdev->request_queue); kref_put(&sdev->host->tagset_refcnt, scsi_mq_free_tags); cancel_work_sync(&sdev->requeue_work);