Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3136289rwd; Mon, 29 May 2023 06:16:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5CQaD9pqjtwW+DX0UtVyDXj1o7cNNIHG3VQF4khkTzbesZJ78cdAOSPE6SF5/MCKy66GqJ X-Received: by 2002:a05:6a20:938a:b0:110:2064:ecb with SMTP id x10-20020a056a20938a00b0011020640ecbmr9924858pzh.15.1685366199324; Mon, 29 May 2023 06:16:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685366199; cv=none; d=google.com; s=arc-20160816; b=e6eVazswpRrgy6sVYIW7OquoeG/Do59IHlTe/n5qXdE2C0UM7V4VJRqf0cp4eOsIbz E28+k3E5F+eLANxQRif0h4G4vpfyMWXXebAJDqeG6/wB/axzhblEIzY4Gd+sWBDa+Tmv h+/tr174fwicXC0wIVPLskg0Nsl9mQFmazm1AJ6CCF9I/zIJHusYvyt8rQLLjfX72isW tEGo+HmKuleKfm8jASDR0zy4p06xH76P3GggG7wdnnPsi9SFVMxhD0vkWdc1IQqb1nFO 4gINXCX7aZqcI6JD9D6WtBeLmEISWUlmW1jYcmnRjOwocOoz3wZ7dgEO0LGM3CJFrzH9 UupQ== 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:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=MG7c1/8iSWyT0WIhBJQ6xOxMY1eCdCQ887DyENiDDkQ=; b=YevjyHf3IHA474D5um/Q6KXo6MjVHA2S/8sV9feW2qj0pm95+DsiYj1g8zJXkDU4DC jK86iFm+d50fyiFNn8lmwe22EOcP3u903W6dDmp75gPOVIY91F32dp16wd6gqN2GxKC7 uMz5BGkdi5iPQYkCr+eM44QN2Y76hZaaN9myUnkD1rel+/yE2d5wQRZXP/7cseM+Hpbp i96gA21rpeQm00OKG+M3mM3cFv+PaMdLXuI/oLA/WLn5Qt+Xkjl54TuVkf6R+rhofujj ndNDay3jgiiwCO7d3C7rRDprWyoeye9+wTmwoDbXafgeawUCDbnXLSdxwKe0FQf79KfI 0kEQ== 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 b20-20020a637154000000b0053f21272796si3305275pgn.617.2023.05.29.06.16.24; Mon, 29 May 2023 06:16:39 -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 S229726AbjE2NPK (ORCPT + 99 others); Mon, 29 May 2023 09:15:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbjE2NPH (ORCPT ); Mon, 29 May 2023 09:15:07 -0400 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3D63F1; Mon, 29 May 2023 06:14:48 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4QVGGD3MmNz4f3prh; Mon, 29 May 2023 21:14:44 +0800 (CST) Received: from [10.174.179.247] (unknown [10.174.179.247]) by APP4 (Coremail) with SMTP id gCh0CgD3X7NDpXRkydjnKQ--.33661S3; Mon, 29 May 2023 21:14:45 +0800 (CST) Message-ID: Date: Mon, 29 May 2023 21:14:43 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH] md/raid10: prioritize adding disk to 'removed' mirror To: Yu Kuai , linan666@huaweicloud.com, song@kernel.org Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com, houtao1@huawei.com, yangerkun@huawei.com, "yukuai (C)" References: <20230527092007.3008856-1-linan666@huaweicloud.com> <45ee7cb9-6651-46a5-87a2-dd66532084d7@huaweicloud.com> From: Li Nan In-Reply-To: <45ee7cb9-6651-46a5-87a2-dd66532084d7@huaweicloud.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgD3X7NDpXRkydjnKQ--.33661S3 X-Coremail-Antispam: 1UD129KBjvJXoW7Kw4DCw15WF1xAw1rCF4xtFb_yoW8AF4Upr 40yw15KrWUJw1kKr1UGr1UJryrtrW8Jw4UJryUXFy7Cr45JryjqrWUXr4Y9r1DJrs3Jr15 t3W5Jrn8ZFy8GrDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvK14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4U JVW0owA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oV Cq3wAac4AC62xK8xCEY4vEwIxC4wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC 0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr 1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcVAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIF xwCYjI0SjxkI62AI1cAE67vIY487MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r 1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CE b7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0x vE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_WFyUJVCq3wCI 42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4UYxBIdaVFxh VjvjDU0xZFpf9x0JUQZ23UUUUU= X-CM-SenderInfo: polqt0awwwqx5xdzvxpfor3voofrz/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, MAY_BE_FORGED,NICE_REPLY_A,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 在 2023/5/29 21:00, Yu Kuai 写道: > Hi, > > 在 2023/05/27 17:20, linan666@huaweicloud.com 写道: >> From: Li Nan >> >> When add a new disk to raid10, it will traverse conf->mirror from start >> and find one of the following mirror to add: >>    1. mirror->rdev is set to WantReplacement and it have no replacement, >>       set new disk to mirror->replacement. >>    2. no mirror->rdev, set new disk to mirror->rdev. >> >> There is a array as below (sda is set to WantReplacement): >> >>      Number   Major   Minor   RaidDevice State >>         0       8        0        0      active sync set-A   /dev/sda >>         -       0        0        1      removed >>         2       8       32        2      active sync set-A   /dev/sdc >>         3       8       48        3      active sync set-B   /dev/sdd >> >> Use 'mdadm --add' to add a new disk to this array, the new disk will >> become sda's replacement instead of add to removed position, which is >> confusing for users. Meanwhile, after new disk recovery success, sda >> will be set to Faulty. >> >> Prioritize adding disk to 'removed' mirror is a better choice. In the >> above scenario, the behavior is the same as before, except sda will not >> be deleted. Before other disks are added, continued use sda is more >> reliable. >> > > I think this change make sense, however, it's better to do this for all > personality instead of just for raid10. > > Thanks, > Kuai raid5 is currently like this. If others are OK with this changes to raid10, I will modify raid1 later. -- Thanks, Nan