Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5395752rwl; Tue, 21 Mar 2023 18:34:29 -0700 (PDT) X-Google-Smtp-Source: AK7set8gP9Gfv/9PXV5SOi60MMHHdd7P81oVe75e4alyWqOwDDzLZ7IfrX5dPulhsqANbZxdzeTd X-Received: by 2002:a05:6402:27c7:b0:500:3fd0:25b5 with SMTP id c7-20020a05640227c700b005003fd025b5mr6181940ede.2.1679448868968; Tue, 21 Mar 2023 18:34:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679448868; cv=none; d=google.com; s=arc-20160816; b=uuxN1Ed/Jqjz/ugd4m3WphNpXKnA8ckez/gxJIic2SAVEj7pNDK8dwdiK2pPdIVU6R wCS0rPP1hx5Zx583pKLe6bGN7q25lE09Szal0Vzad8xCBURw/bK+gj/4zB2nHrnoiT5h EU+CEB7ko2i2yQKreRcR6vV/y8ALRGo/+lXmRMHxlZZbpq5R843ESTUOAZBAjs83eeHu 2Ce0Q01nEHRk6/mMcXWentZqnwIx9uQU+o2/FxKQloHNHz9LoZXwawoiCvYjEkVj1k/d v79QnlsO55AAyJRmkGNeVVGSthWA2W+JHD5Y3TY0SdQuoHyJSdukEF8GwqqwuZJcOelX svqQ== 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=2n3luRHbGzT8CJ2xGMQRE8MfHdxI3UZfjCo/ZlsrlmE=; b=gmrpyyUVOyV3cjmGjzywhqg/e84OlhcnWo42mXRSD5oT/3fGcD+6igsPqGZ8lRBBh4 QdblgDYhVB8kFChdxhzvK0ST4InTalaQGxmOoCiALznsefqAAhFe2esUaqlvvKCqoMrw KSV2zwBJ1a18nvsQuFI0D73l1BeIwI0VIonOOeIUTnXfyUjTyaiOsHHZmhypEwrzkpO5 /5pw6wS+EBOer2x6Lz8NKU1y3/g9IDICIE4GtqzLCNw9jDNUIEavWUUFyXRg02RbCB8d O0EAC2rqnKiPF9ckR8pRz8F78QWfHeLifVfbQqsP6b1C1F62sLpriIMBMcxFoEi14tnO amYA== 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 bc18-20020a056402205200b004ab9fed6acesi14530375edb.384.2023.03.21.18.33.53; Tue, 21 Mar 2023 18:34:28 -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 S229796AbjCVB0S (ORCPT + 99 others); Tue, 21 Mar 2023 21:26:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbjCVB0Q (ORCPT ); Tue, 21 Mar 2023 21:26:16 -0400 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C66830289; Tue, 21 Mar 2023 18:26:13 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4Ph9m12s6sz4f3wYK; Wed, 22 Mar 2023 09:26:09 +0800 (CST) Received: from [10.174.176.73] (unknown [10.174.176.73]) by APP3 (Coremail) with SMTP id _Ch0CgBnFCIvWRpkXohdFQ--.57798S3; Wed, 22 Mar 2023 09:26:08 +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, "yukuai (C)" References: <20230217022200.3092987-1-yukuai1@huaweicloud.com> From: Yu Kuai Message-ID: Date: Wed, 22 Mar 2023 09:26:07 +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: _Ch0CgBnFCIvWRpkXohdFQ--.57798S3 X-Coremail-Antispam: 1UD129KBjvJXoW7tr43tr1fCw18ZF13tF4rGrg_yoW8Xw1xpF Z7XFs8Xr4DCw17Ca4UJ3Z7G3W5J3s7ZrWrGr13WryIka98Wr1YgFWkt39xXa92qrZ0kr1q 9r1kJrWxZFyfCrJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9F14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4U JVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gc CE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E 2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJV W8JwACjcxG0xvEwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lFIxGxcIEc7CjxVA2Y2ka 0xkIwI1lc7I2V7IY0VAS07AlzVAYIcxG8wCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7x kEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E 67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCw CI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6rW3Jr0E 3s1lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcS sGvfC2KfnxnUUI43ZEXa7VUbXdbUUUUUU== 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_PASS 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/21 19:43, Ming Lei 写道: > On Fri, Feb 17, 2023 at 10:21:58AM +0800, Yu Kuai wrote: >> From: Yu Kuai >> >> Changes from RFC: >> - remove the patch to factor out GD_NEED_PART_SCAN >> >> Yu Kuai (2): >> block: Revert "block: Do not reread partition table on exclusively >> open device" >> block: fix scan partition for exclusively open device again > > 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. And I verify this with following test: 1) mdadm -CR /dev/md0 -l 1 -n 2 /dev/sda /dev/sdb -e 1.0 2) sgdisk -n 0:0:+100MiB /dev/md0 3) mdadm -S /dev/md0 # scan partitions of sda 4) blockdev --rereadpt /dev/sda Then sda1 is created. I'm not sure how to fix this yet???? Thanks, Kuai > > Follows the script, which isn't 100% triggered, but still easy. > > #create level 1 with 2 devices, meta 1.0 > mdadm -CR /dev/md0 -l 1 -n 2 /dev/sda /dev/sdb -e 1.0 > > #create partition 0, start from 0 sector, size 100MiB > sgdisk -n 0:0:+100MiB /dev/md0 > > #observe partitions > cat /proc/partitions > > #stop the array > mdadm -S /dev/md0 > > #re-assemble > mdadm -A /dev/md0 /dev/sda /dev/sdb > cat /proc/partitions > > > Thanks, > Ming > > . >