Received: by 2002:ac8:156:0:b0:3e0:cd10:60c8 with SMTP id f22csp1683149qtg; Tue, 21 Mar 2023 20:51:22 -0700 (PDT) X-Google-Smtp-Source: AK7set/iRTTv70DxcAuaGPWW2Lp+GEWZTVF72JMeQDffRqllkT60F1qU31WRU2zwNjQfPl2+Orf5 X-Received: by 2002:a17:906:7e05:b0:8b2:8876:2a11 with SMTP id e5-20020a1709067e0500b008b288762a11mr5005908ejr.28.1679457082390; Tue, 21 Mar 2023 20:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679457082; cv=none; d=google.com; s=arc-20160816; b=zZMd4VujbPpBMxM19s8IaIWK/gnc7f1q4ay+6xPDMmCBnA5sO3jnFQmkYkLGUUwpjQ 3xoQcTUV1DrMO6JXw1nSjbbJODAMHzeZf4tb9lavPVDAi+4SPdJLXWdeprXdsPsGHyCa eSL9iS8BwuRpRExL+SKtKtQYrOycU+ZMZ88MdNSkUMupuyhqCayydl9dvNdYtnz/gBLd sg5JXhh5UgeJ8OFypT4TXQwP6+TVP98BjJJcBoVglX55pZ6KmWPmM+qzHESCGJz3kDV+ 6ghFKNsfsbXU8y3VZui6j8lAy/whD9pkaL08AABXXDKp/14JNbPfQKPnY5QRHWDQHMMI 16kQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=acAVed8CDBREmL9QLjhE79J05nR0HTJkM0a3n25AtZk=; b=NJo9l6+9D7xYRi7++VronVY6fCAhN81k4WI4ef2buyYQm5UJn4FfDxtNkLMzz8SVTI 3dWas71hVeJMXiy4Fd1B4K5ZFgC6LYxgH+RvnwUpTaaHPFBaR2rzX34h9zIMaHp5v39s xBZ7PbiJNKc0QoWSymfjgjDmtKGbCPsso2rELvKk8ZMxeeOp5b59UP7AsEZq8PerHlr/ vYnYnBpJCTFz2BD8w2ZTm1HpSrTEspPXXx84ZVBu+ZCawfMk8qJa5loBsfbB2XPM+z7c P0/VJravsR+cr56FeBqpDhddeMZmwUPZllOIG11j52+90D44zEmcocCU7thCk50GTf3n L0fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TV+ryhYi; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r13-20020aa7cfcd000000b00501d50c5d7csi4837466edy.417.2023.03.21.20.50.54; Tue, 21 Mar 2023 20:51:22 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TV+ryhYi; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230141AbjCVDjq (ORCPT + 99 others); Tue, 21 Mar 2023 23:39:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229783AbjCVDjp (ORCPT ); Tue, 21 Mar 2023 23:39:45 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEEC726C22 for ; Tue, 21 Mar 2023 20:38:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679456338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=acAVed8CDBREmL9QLjhE79J05nR0HTJkM0a3n25AtZk=; b=TV+ryhYil6/VVOTFMXtRmg9rMIWPvK3EWOLLiTdfUdt8xC5P7vRHimAyp3tBSDe8dochOg JXOEhUpihVdl7Zae1USD7Kf53naE6FHK7+f7ZChHLb7W1Ck5VP2XixAvHEu2TvMnpCmguQ Y0Em0v64T3phutn5+8O6F939NNtCU1o= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-387-sP62k0_iM_Gk_8g6MhmQQA-1; Tue, 21 Mar 2023 23:38:54 -0400 X-MC-Unique: sP62k0_iM_Gk_8g6MhmQQA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 44C0C101A54F; Wed, 22 Mar 2023 03:38:54 +0000 (UTC) Received: from ovpn-8-17.pek2.redhat.com (ovpn-8-17.pek2.redhat.com [10.72.8.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C60CA2027047; Wed, 22 Mar 2023 03:38:47 +0000 (UTC) Date: Wed, 22 Mar 2023 11:38:42 +0800 From: Ming Lei To: 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)" , ming.lei@redhat.com Subject: Re: [PATCH -next 0/2] block: fix scan partition for exclusively open device again Message-ID: References: <20230217022200.3092987-1-yukuai1@huaweicloud.com> <5facd7c1-fa90-99ff-bd08-cdf67fe6c1ab@huaweicloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,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 On Wed, Mar 22, 2023 at 10:15:30AM +0800, Yu Kuai wrote: > Hi, > > 在 2023/03/22 10:02, Yu Kuai 写道: > > Hi, > > > > 在 2023/03/22 9:34, Ming Lei 写道: > > > On Wed, Mar 22, 2023 at 09:26:07AM +0800, Yu Kuai wrote: > > > > 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. > > > > > > 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, Ming