Received: by 2002:ac8:156:0:b0:3e0:cd10:60c8 with SMTP id f22csp1688428qtg; Tue, 21 Mar 2023 21:05:31 -0700 (PDT) X-Google-Smtp-Source: AK7set+zh4pKCTT0lvCzEJ9BWmfs7kPgbkrzZqESdFwPy3kls+PfS324PjLOOZXP0eyFbdxzsJxJ X-Received: by 2002:a17:90b:1b10:b0:23f:46a5:248e with SMTP id nu16-20020a17090b1b1000b0023f46a5248emr2099281pjb.44.1679457931316; Tue, 21 Mar 2023 21:05:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679457931; cv=none; d=google.com; s=arc-20160816; b=uZm/cN56LgZZnaY9F6JAyliWT6fg4dASlGJSxGt0jWazFhTGKHVwmtxji9S6xXrGKd hUwt7tYW87uEQVpUvNkiG6V/Bpa0Vpsu+JTEXeemZZns+j4n1TODThjl9sAWqTlw4hiN xO2IWJW0glc33NZaqD6Cd+/gPJDIahUbcl3Duf+gikk4nzc90cTO03MEz+Z499jxCsFu owSodhFhdAIX3H4wyvCMFWbLpe2Yka/uQU9WJB5Djvgz/zOqFWTopWXfxX1GfIAtIHYU 3sTbEOFkqsUbFIb2sAMUfeQk8KeeCsgsKGdeA6kP6Sv8q4G9342a41dkUJ4Vt2ckwVWy 6QxQ== 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 :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=Iury8WROljdNDyAHninwDdaVCl81V33ORc2OKSQtz8U=; b=t55J0xlAeUBuz5NiduzuBsk1tJig3/PA1eEn+UFy6eGsjJ1z9KS8z2rVJotCVcVsE7 38Thv6UsKPsqM7cInMRQztSm0t7lR9EmgQPhxtbORVQmoJWfOxHGqoJThZqkdb7MW/AJ WE2ss7E3ULI6PSzR4pAq24VwFTkPNETo8QNaUo8qMIhcZis5RQuaA0tpx6xpSHqGTw5K lw4A0WlGO5Jd4geat61wYsHYSMWG5r3zWItlRjLDMzoXAlLD6ppK+Djl16KRQ4iUy6l5 NdHzWivO2f40k5YV+fEoKjFdaUVLd94jIDO+eEiJDDC5uzvuSO0Dd/mZc96Yf1TWlfky 71dQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y1-20020a17090a600100b0023b3da3ffc2si19849682pji.138.2023.03.21.21.05.19; Tue, 21 Mar 2023 21:05:31 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230417AbjCVECT (ORCPT + 99 others); Wed, 22 Mar 2023 00:02:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230414AbjCVEBt (ORCPT ); Wed, 22 Mar 2023 00:01:49 -0400 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A99864DE0E; Tue, 21 Mar 2023 21:00:52 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4PhFBN2cr1z4f3mKt; Wed, 22 Mar 2023 12:00:44 +0800 (CST) Received: from [10.174.176.73] (unknown [10.174.176.73]) by APP3 (Coremail) with SMTP id _Ch0CgDHcyFqfRpki+pjFQ--.44895S3; Wed, 22 Mar 2023 12:00:43 +0800 (CST) Subject: Re: [PATCH -next 0/2] block: fix scan partition for exclusively open device again To: Ming Lei , Yu Kuai Cc: jack@suse.cz, hare@suse.de, hch@infradead.org, axboe@kernel.dk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com, yangerkun@huawei.com, Changhui Zhong , "yukuai (C)" References: <20230217022200.3092987-1-yukuai1@huaweicloud.com> <5facd7c1-fa90-99ff-bd08-cdf67fe6c1ab@huaweicloud.com> From: Yu Kuai Message-ID: <28ee8ba9-fa42-d3bb-d3c4-44d7e77c64be@huaweicloud.com> Date: Wed, 22 Mar 2023 12:00:42 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID: _Ch0CgDHcyFqfRpki+pjFQ--.44895S3 X-Coremail-Antispam: 1UD129KBjvJXoW7ZF47WryfZF15tFykZw4Utwb_yoW8Cr1fpF WxGa13JF4DJryYkw1Iqw17GFW5Kw4xZry5WFyUGr10k3s0vr98trZ7t3yq9r9Fqr1UGw1Y 9F15JFn3Xa4jyaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9014x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4U JVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gc CE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E 2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJV W8JwACjcxG0xvEwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lFIxGxcIEc7CjxVA2Y2ka 0xkIwI1lc7I2V7IY0VAS07AlzVAYIcxG8wCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7x kEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E 67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCw CI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r4j6FyU MIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIda VFxhVjvjDU0xZFpf9x0JUdHUDUUUUU= X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=0.0 required=5.0 tests=NICE_REPLY_A,SPF_HELO_NONE, SPF_NONE autolearn=unavailable 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 Hi, 在 2023/03/22 11:38, Ming Lei 写道: >>>>>> Hi Yu kuai, >>>>>> >>>>>> Looks the original issue starts to re-appear now with the two patches: >>>>>> >>>>>> https://lore.kernel.org/linux-block/20221130135344.2ul4cyfstfs3znxg@quack3/ >>>>>> >>>>>> >>>>>> And underlying disk partition and raid partition can be observed at the >>>>>> same time. >>>>>> >>>>>> Can you take a look? >>>>> Yes, thanks for the report. I realize that sda1 adn sdb1 is created >>>>> while raid open sda and sdb excl, and I think this problem should exist >>>>> before this patchset. >>>> >>>> Looks not reproduced before applying your two patches, that is >>>> exactly what Jan >>>> tried to fix with 36369f46e917 ("block: Do not reread partition >>>> table on exclusively open device"). >>> >>> Hi, Ming >>> >>> I just tried your test with this patchset reverted, and I can still >>> reporduce the problem myself. >> >> Oops, I forgot to revert the first patch. It's right the problem can't >> be reporduced. >>> >>> raid only open this device excl, and disk_scan_partitions is not called: >>> >>> md_import_device >>>  blkdev_get_by_devo >>> >>> I need to add some debuginfo to figure out how GD_NEED_PART_SCAN is set >>> for sda after raid is stopped. And this should explain why sda1 is >>> created. >> >> I found how GD_NEED_PART_SCAN is set now, in patch 2, this is set before >> bd_prepare_to_claim, so preciously faild part scan will still set this >> bit, and following patch shold fix this problem: > > Just run quick test, the issue won't be reproduced with your patch, and > the change looks rational too, > > Reviewed-by: Ming Lei > Thanks for the test and review, I just do some additional change to clear GD_NEED_PART_SCAN, I will send a patch, can you take a look? Kuai > > Thanks, > Ming > > . >