Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2676944rwb; Wed, 30 Nov 2022 09:24:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf4V1OuptwjNEu+sfy6DbchtwuDmmDYUDO8sSGZFC25u0fCgR1LVN/nnShGCk8AbJkm1tPL2 X-Received: by 2002:a17:906:3385:b0:7a2:b352:a0d3 with SMTP id v5-20020a170906338500b007a2b352a0d3mr52039443eja.399.1669829093338; Wed, 30 Nov 2022 09:24:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669829093; cv=none; d=google.com; s=arc-20160816; b=eMiMMb+UaKr9MQGqd9YTr2PKk+KNPsmfrjv86Ny7MX99I8bvQtQ8yl1tFzzrJWpfB/ tMUzseOd72DkTji5vjVI84ePDJk7YGzaoEMyYF9FxbV8i7d0RR90LjARXrZJWlhI7UKq qJFfNzreXi6IsZN4WkGBMgU1OzMpEOjxT2BfLmaAk1oGGBJo16Da0+g1F+byXdxvk9VZ AkC/EffHvhXkT69lFEwyjO+G9U8gEueaVtLCPdAgPaLK4s9CgylV+4xO0rcdbjMWrxOD T5u41p2dZwuBJ8d7cODsprr7ayc3tovifaKh7mguNMg/Rjo+mc3hg/+o38ZMNr6R215Q aM0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZBaZLAQcwXpgoc/wypFSnGvG1ormvMqRTKZGjeGBWso=; b=wEkApx1rLyTH2iv65cVwK/LSaeDZihUnV0uVH5abBEdnI+5sBWH1fSR/C3FH0wbbzR XV7o0ODWZnPrZHMc6VXzSRvr2JYDpZ8RMiPSsOQ9c0zmZdQI2GfwUSbKvqvViQimQWhw 8HFmTTyc7A+lRYlcYQwS71Txn7inxOoLrjgIQK9JaXZ5JsbwVr6Fjix408RIppclv+UY SXdsNZAFY7kwtWIUscUa6JHSfhJ92fdFTGXnvZEQkd1BXmduZe5LpI5FEYJXtqxV83PC rOli+IC6WwRFD7P1LNkmaYz/nuKK9cBtCCfk3ksnO24cCVzuA6ryT6+4p7qO781cypLX XwMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=YftUeZ3e; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z6-20020a1709067e4600b007ad945aa04asi1458395ejr.678.2022.11.30.09.24.32; Wed, 30 Nov 2022 09:24:53 -0800 (PST) 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; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=YftUeZ3e; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230103AbiK3P77 (ORCPT + 83 others); Wed, 30 Nov 2022 10:59:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230116AbiK3P7z (ORCPT ); Wed, 30 Nov 2022 10:59:55 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39E432D76C; Wed, 30 Nov 2022 07:59:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ZBaZLAQcwXpgoc/wypFSnGvG1ormvMqRTKZGjeGBWso=; b=YftUeZ3edM8lh3hLMLYkvoIm89 BxMFibmnOQOwhtduBbuDosrHkBE1rrJvFUHUECFI5o7XPdRF5WPEl7+mVzRrOal09xRXlmNITBVqw wDuXPsFsczEXCNNxYsTurNDni9una+CM6XGZ+3nX1BxOhaqajdhwzizSzo+zJjx2RzW6TqS/kW4M7 k+y7qxo2sIKMwObnqvc1CqSN7I7dXBwWkH+2jwuxQv8T18OtJfYRAb9dAkZu6rfmnY6RFhMcUNcUV HGEBNnZG1PekSCXVo73TulcJwICZTck1WBGvPHO5HvYywy/1lalyQ+InzvyjuI4VoTrdtSl8aIm4+ Q1m2xNMQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0PUr-000E2B-I7; Wed, 30 Nov 2022 15:59:41 +0000 Date: Wed, 30 Nov 2022 07:59:41 -0800 From: Christoph Hellwig To: Yu Kuai Cc: Christoph Hellwig , Li Nan , tj@kernel.org, josef@toxicpanda.com, axboe@kernel.dk, cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com, "yukuai (C)" Subject: Re: [PATCH -next 8/8] block: fix null-pointer dereference in ioc_pd_init Message-ID: References: <20221128154434.4177442-1-linan122@huawei.com> <20221128154434.4177442-9-linan122@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham 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 Wed, Nov 30, 2022 at 09:32:58AM +0800, Yu Kuai wrote: > > No, that now means it is removed to later. You need to add proper > > synchronization. > > . > > > > Can you explain a bit more? Maybe I'm being noob, here disk is about to > be freed, and I can think of any contention. Right now we need synchronization with e.g. open_mutex and a check for a dead disk, which I suggst to add insted of creating a lifetime imbalance.