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 D6541C6FA99 for ; Wed, 8 Mar 2023 01:15:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229997AbjCHBPs (ORCPT ); Tue, 7 Mar 2023 20:15:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229750AbjCHBPq (ORCPT ); Tue, 7 Mar 2023 20:15:46 -0500 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14284A6758; Tue, 7 Mar 2023 17:15:45 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4PWZBN0qMXz4f3nTF; Wed, 8 Mar 2023 09:15:40 +0800 (CST) Received: from [10.174.178.159] (unknown [10.174.178.159]) by APP4 (Coremail) with SMTP id gCh0CgCH77K84QdkbQXLEw--.14490S3; Wed, 08 Mar 2023 09:15:41 +0800 (CST) Message-ID: Date: Wed, 8 Mar 2023 09:15:40 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH-next v2 Resend] scsi: fix use-after-free problem in scsi_remove_target To: Bart Van Assche , jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, zhongjinghua@huaweicloude.com, yi.zhang@huawei.com, yukuai3@huawei.com References: <20230306121636.3183761-1-zhongjinghua@huaweicloud.com> From: zhongjinghua In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-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zUUUUU X-CM-SenderInfo: x2kr0wpmlqwxtxd6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for you adevice. Jinghua 在 2023/3/8 6:35, Bart Van Assche 写道: > On 3/6/23 04:16, Zhong Jinghua wrote: >> +            /* >> +             * If the reference count is already zero, skip this >> +             * target is safe  because scsi_target_destroy() >> +             * will wait until the host lock has been released >> +             * before freeing starget. >> +             */ > > The above comment has grammatical issues and is confusing. I think the > comment that I suggested was much better than the above. > > Bart. >