Message ID | 20230527101851.3266500-2-linan666@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp248795vqr; Sat, 27 May 2023 03:33:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7iylzt55E1pvN9/6Up3BNuJsqVmUWKL0Hae/5OP8xY/DBmsZYw3V2A/q+rwx9WeXXGG69G X-Received: by 2002:a17:903:22cd:b0:1aa:f6e9:4cb3 with SMTP id y13-20020a17090322cd00b001aaf6e94cb3mr5819349plg.52.1685183580244; Sat, 27 May 2023 03:33:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685183580; cv=none; d=google.com; s=arc-20160816; b=XnBcYToA/RY/DzpaY8CWspcFrqI7AHtjT/Wr7vUu/0Hbfx6C0coiigVqip+IhOCv+z cGsNT3XmhRYWbaUYbEP0wQtMqxZ0TxQ+3ESAu434fidlmjHLiD4aFQUirryu4i4nUEy+ N8St+c7cH6gnPH1tKY1tmi3ufzpEX/VgXW8wsdZj5K/qpgdBqTNxryRS5O24O9GoW9qF CTt4iUaVUaxvFIlKV2oBWHxfW2wfiBayTrLEi/n888onMnVddFbzDECLkVL1jf2DtkcI f5bcLjbadce9Wzy1UIs6oQd4viM1/w5ICwPx3IYyw3CNeLZgwr5f61cOZsUhmh1WRJl0 puSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=iUAHskhjjB1WhWDcLy6iOzy3f6vQ2OOlFwRPJ540HM8=; b=T/a7egZOJwQJpLFDavDHGQgiE4t0kqSSMmD8Mb5aRs3F5bX+TvCfUeDbXKiOYmmikI 0WiDos4sTcQO05OoWt5o0v7Q+Ow/4W3eI9/02Ml3zdSso8WQrFJyeHbivOuzp0dFoseZ C6F4hHoCa0WZ722f7mjZvl8PjvRxQOLrcWzIi9BmW5m8LNHIhFIwgxfzP9xb1HE47Kkp +Rp+dOr36P0rnMKme0kQIXzQr7UZ/JiXG2XAisz4FV6Gj1mmCvz8WGDShyBpncHXvh5U Wk7w9Bo63lA7eYAjOxAzuRKvvE6ektolIDYDybvwtUwmLd/c8HC8XM0EwcheWP0sbIrR a2YA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d12-20020a170903230c00b001ac83d28c39si6691073plh.234.2023.05.27.03.32.48; Sat, 27 May 2023 03:33:00 -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 S232206AbjE0KUm (ORCPT <rfc822;zhanglyra.2023@gmail.com> + 99 others); Sat, 27 May 2023 06:20:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232105AbjE0KUf (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 27 May 2023 06:20:35 -0400 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62DAB116; Sat, 27 May 2023 03:20:33 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4QSyV45NLdz4f3tNp; Sat, 27 May 2023 18:20:28 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP4 (Coremail) with SMTP id gCh0CgBH_rFr2XFkGW9JKQ--.57203S5; Sat, 27 May 2023 18:20:29 +0800 (CST) From: linan666@huaweicloud.com To: song@kernel.org Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, linan122@huawei.com, yukuai3@huawei.com, yi.zhang@huawei.com, houtao1@huawei.com, yangerkun@huawei.com Subject: [PATCH] md/raid10: clean up md_add_new_disk() Date: Sat, 27 May 2023 18:18:51 +0800 Message-Id: <20230527101851.3266500-2-linan666@huaweicloud.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230527101851.3266500-1-linan666@huaweicloud.com> References: <20230527101851.3266500-1-linan666@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgBH_rFr2XFkGW9JKQ--.57203S5 X-Coremail-Antispam: 1UD129KBjvJXoW7AF4fJw4DXw1xWrWxJFWUurg_yoW8Jw15pF Z3tF9xCwn5CF1UWw4kXFWjga4rJ3ZF9rs5KF1xJ348ZasrXr4UWa1rKFZIqryDXFyfA3Z0 vF9rJ34DXa4kuF7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUPKb4IE77IF4wAFF20E14v26ryj6rWUM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUGw A2048vs2IY020Ec7CjxVAFwI0_JFI_Gr1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV W8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6rxl6s0DM2vYz4IE04k24VAvwVAKI4IrM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrV ACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWU JVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lw4CEc2x0rVAKj4xxMx kF7I0En4kS14v26r1q6r43MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4U MI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67 AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0 cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z2 80aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8Jr0_Cr1UYxBIdaVFxhVjvjDU 0xZFpf9x07jbYFAUUUUU= X-CM-SenderInfo: polqt0awwwqx5xdzvxpfor3voofrz/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767043058245250663?= X-GMAIL-MSGID: =?utf-8?q?1767043058245250663?= |
Series |
md/raid10: clean up md_add_new_disk()
|
|
Commit Message
Li Nan
May 27, 2023, 10:18 a.m. UTC
From: Li Nan <linan122@huawei.com> Commit 1a855a060665 ("md: fix bug with re-adding of partially recovered device.") only add device which is set to In_sync. But it let devices without metadata cannot be added when they should be. Commit bf572541ab44 ("md: fix regression with re-adding devices to arrays with no metadata") fix the above issue, it set device without metadata to In_sync when add new disk. However, after commit f466722ca614 ("md: Change handling of save_raid_disk and metadata update during recovery.") deletes changes of the first patch, setting In_sync for devcie without metadata is meanless because the flag will be cleared soon and will not be used during this period. Clean it up. Signed-off-by: Li Nan <linan122@huawei.com> --- drivers/md/md.c | 1 - 1 file changed, 1 deletion(-)
Comments
在 2023/05/27 18:18, linan666@huaweicloud.com 写道: > From: Li Nan <linan122@huawei.com> > > Commit 1a855a060665 ("md: fix bug with re-adding of partially recovered > device.") only add device which is set to In_sync. But it let devices > without metadata cannot be added when they should be. > > Commit bf572541ab44 ("md: fix regression with re-adding devices to arrays > with no metadata") fix the above issue, it set device without metadata to > In_sync when add new disk. > > However, after commit f466722ca614 ("md: Change handling of save_raid_disk > and metadata update during recovery.") deletes changes of the first patch, > setting In_sync for devcie without metadata is meanless because the flag > will be cleared soon and will not be used during this period. Clean it up. LGME, feel free to add: Reviewed-by: Yu Kuai <yukuai3@huawei.com> > > Signed-off-by: Li Nan <linan122@huawei.com> > --- > drivers/md/md.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/md/md.c b/drivers/md/md.c > index 8e344b4b3444..e5b67b2d2166 100644 > --- a/drivers/md/md.c > +++ b/drivers/md/md.c > @@ -6733,7 +6733,6 @@ int md_add_new_disk(struct mddev *mddev, struct mdu_disk_info_s *info) > if (info->state & (1<<MD_DISK_SYNC) && > info->raid_disk < mddev->raid_disks) { > rdev->raid_disk = info->raid_disk; > - set_bit(In_sync, &rdev->flags); > clear_bit(Bitmap_sync, &rdev->flags); > } else > rdev->raid_disk = -1; >
On Sun, May 28, 2023 at 12:49 AM Yu Kuai <yukuai1@huaweicloud.com> wrote: > > 在 2023/05/27 18:18, linan666@huaweicloud.com 写道: > > From: Li Nan <linan122@huawei.com> > > > > Commit 1a855a060665 ("md: fix bug with re-adding of partially recovered > > device.") only add device which is set to In_sync. But it let devices > > without metadata cannot be added when they should be. > > > > Commit bf572541ab44 ("md: fix regression with re-adding devices to arrays > > with no metadata") fix the above issue, it set device without metadata to > > In_sync when add new disk. > > > > However, after commit f466722ca614 ("md: Change handling of save_raid_disk > > and metadata update during recovery.") deletes changes of the first patch, > > setting In_sync for devcie without metadata is meanless because the flag > > will be cleared soon and will not be used during this period. Clean it up. > > LGME, feel free to add: > > Reviewed-by: Yu Kuai <yukuai3@huawei.com> > > > > Signed-off-by: Li Nan <linan122@huawei.com> Applied to md-next. Thanks, Song
diff --git a/drivers/md/md.c b/drivers/md/md.c index 8e344b4b3444..e5b67b2d2166 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -6733,7 +6733,6 @@ int md_add_new_disk(struct mddev *mddev, struct mdu_disk_info_s *info) if (info->state & (1<<MD_DISK_SYNC) && info->raid_disk < mddev->raid_disks) { rdev->raid_disk = info->raid_disk; - set_bit(In_sync, &rdev->flags); clear_bit(Bitmap_sync, &rdev->flags); } else rdev->raid_disk = -1;