Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9594501rwd; Wed, 21 Jun 2023 09:15:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4I/vTfT0763Ao/gREL59vbyjqaqfWlclVdQ+6PGj5coS31nn7zFHvapQcJkRdsBlwW0YF8 X-Received: by 2002:a05:6870:e1c3:b0:1a6:9b66:9ebd with SMTP id g3-20020a056870e1c300b001a69b669ebdmr8058461oab.30.1687364142048; Wed, 21 Jun 2023 09:15:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687364141; cv=none; d=google.com; s=arc-20160816; b=rUQqu563JiUAO/8Frp25Q9wE3p0R3r2MOlpxDBqt78sjerrzjzmggWIG6PjFzM1vcz BliEeoXGw7LfFG0DDWJM8w2vYvg2pOF0g7NHHhnTlwpI1Pd15ke01dH0Koj2iYKiYkae 9VzRQf2Poa1RntkCXDyCHLoL/Pdqj5sJDytCu4NrssMo6XWjL/s+pdewqQJW0/g33vX0 xER3I89gDhLu6qdVZtfwTJF1Nu3Z8kWH4W/OU5t8oHGqVEJBaQwb082Yj3G5byQNaAyJ KKYrefzMgGWYpkoTFGMifZyynpSqpm+3/bABFAQIT5PJHItfnPrHbH/F09bY7L3MrJnB TytA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=G5Mcef6zMkNz9FKaMVVsQpbKPOPdZ24sc4KU/lOwhoA=; b=t9HX8oc4GoyLM9Es9NMaH37v/plnxUlCx349gg3J47etm6IDW+yX6lCkRR7VlsMytD mOkzjNFowsWL98OmT60fY+jVU2sNCXViSbwBDDS2cL4YFkJx9nugJOiVcgSOLCoZ0TIP pEUKTlHMbTq+YaJ3KZb+CyVKYTTit43m3YTyve3ueevzYVRiUsaQCYFuXSwDEuih27fm qxUIxLrMA2iGIsLed3OzNCpqtCDL8xuatXxH+GJ2mrgsfDJA9xWTdHUkokVagYCFrJPn n1GnLwjPpCd/tCfP8Jl8WKXhO5w+wd3PRA9FhdhnLwqyc2gBD0R4ytWePHkcqBaMFETY xYzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t13-20020a654b8d000000b00542b2e4c96bsi4403133pgq.475.2023.06.21.09.15.29; Wed, 21 Jun 2023 09:15:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233294AbjFUPrR (ORCPT + 99 others); Wed, 21 Jun 2023 11:47:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232254AbjFUPrQ (ORCPT ); Wed, 21 Jun 2023 11:47:16 -0400 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5003BC; Wed, 21 Jun 2023 08:47:15 -0700 (PDT) Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1b52bf6e669so47781795ad.2; Wed, 21 Jun 2023 08:47:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687362435; x=1689954435; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=G5Mcef6zMkNz9FKaMVVsQpbKPOPdZ24sc4KU/lOwhoA=; b=Bi/cXZWeZgWMODnp89bAt8fNFY8oQ4OLLzKrznbVOLQnLvoLjTMSMZS9xlAdJM4Yil 2tUFAlgT9tERxr196lRy3dXaO3CCKOsw0NgHGmHPKG5074D5ffWD2ODkK49bP8erhHaM HsV8auPVLV4sLHXvKLIBT0//rpX9V/mhkT/mJV2cgHPqpTSZvlF6NNRCbgq6eHfnxCDJ vsMjmFv5EYeRELE6XJqeZhRuidsuf5AVvjAso70JdY0ru/l3kmuYEfyyNfZsi8WB5enM tdF/HHyjP53GuBgezZOnYZhh5VjhVQvaUvUHaKVTdNiNzHqEaSwKEGUpSW6XvV0zDoPj yIcw== X-Gm-Message-State: AC+VfDwx2b3j2wNtVJM71Fn5Hd7yGE3xnDERXs6i4oofqGRVp5AlDA9j b5ypiSgrD0yBEz6ky8qkZawK1IlbZco= X-Received: by 2002:a17:903:2682:b0:1b1:9d14:1537 with SMTP id jf2-20020a170903268200b001b19d141537mr13780419plb.55.1687362435057; Wed, 21 Jun 2023 08:47:15 -0700 (PDT) Received: from ?IPV6:2620:15c:211:201:9bb2:be1e:34e3:7c45? ([2620:15c:211:201:9bb2:be1e:34e3:7c45]) by smtp.gmail.com with ESMTPSA id d5-20020a170902cec500b001b54d064a4bsm3629752plg.259.2023.06.21.08.47.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Jun 2023 08:47:14 -0700 (PDT) Message-ID: <93834519-c945-94a7-f1f8-7bf85bf86dd5@acm.org> Date: Wed, 21 Jun 2023 08:47:10 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] scsi/sg: don't grab scsi host module reference Content-Language: en-US To: Yu Kuai , hch@lst.de, chaitanyak@nvidia.com, shinichiro.kawasaki@wdc.com, dgilbert@interlog.com, jejb@linux.ibm.com, martin.petersen@oracle.com, yukuai3@huawei.com, axboe@kernel.dk Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com, yangerkun@huawei.com References: <20230621160111.1433521-1-yukuai1@huaweicloud.com> From: Bart Van Assche In-Reply-To: <20230621160111.1433521-1-yukuai1@huaweicloud.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/21/23 09:01, Yu Kuai wrote: > From: Yu Kuai > > In order to prevent request_queue to be freed before cleaning up > blktrace debugfs entries, commit db59133e9279 ("scsi: sg: fix blktrace > debugfs entries leakage") use scsi_device_get(), however, > scsi_device_get() will also grab scsi module reference and scsi module > can't be removed. > > It's reported that blktests can't unload scsi_debug after block/001: > > blktests (master) # ./check block > block/001 (stress device hotplugging) [failed] > +++ /root/blktests/results/nodev/block/001.out.bad 2023-06-19 > Running block/001 > Stressing sd > +modprobe: FATAL: Module scsi_debug is in use. > > Fix this problem by grabbing request_queue reference directly, so that > scsi host module can still be unloaded while request_queue will be > pinged by sg device. pinged -> pinned Otherwise this patch looks good to me. Bart.