Message ID | 20240127074754.2380890-2-yukuai1@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-41092-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2395:b0:106:343:edcb with SMTP id gw21csp365720dyb; Fri, 26 Jan 2024 23:53:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IHP8KIKLKf74kwHABjUbjpbvI1wgB5VTSfeDkX519lxUYE8hDrOkX+zc4rx2wTbn1BgVPAW X-Received: by 2002:a05:6808:17a2:b0:3bd:a0d5:d4f8 with SMTP id bg34-20020a05680817a200b003bda0d5d4f8mr2284885oib.28.1706341992735; Fri, 26 Jan 2024 23:53:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706341992; cv=pass; d=google.com; s=arc-20160816; b=WIcFihitJKPFLNjqWc8xrret76yhhKa0Ot60FNzd+LDYUlJ9Z3pgKnZkKC58DBtM3R WRjcPGd4i9OiOLoaGrKibsRfiGB7wfYlW+qrMKyhoebh8KTW06oOIFnkogh1xFIhJCwD r65J3AEYn+EhWU1Eg6fOiraIg2AqE2UaZc3qUxdUozi+rWaRHFk5O3LPoAiApNY+QCds TxiR3EWmv19bPHHKVqO3Q6MzzPa35spTMwNNZjg1YFhV2MN0njs7YhecGhJOpE2apmvS g7Satoh0hhDR/esxugUavncnYyobe5hGbnypwWqpjnGS+MiuitOFDqNlmwyqPxA/oP4x OMsA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=dBaWySK1O6HNfOrqRqopNpWnbd2nAQFt9nqs3kj8Nq8=; fh=FtirvJJ13L8gehLQ375a0lCTkAroffAi0JfnF40Fa78=; b=iyA1aF6n42Guw3KOoYo3PiCarkQ+nIpuNN8DORg5bC5yPe0mIs+Ufg7I7uYkL+yPVq k3HrdpO4pPMHRysinBYaqEhzXMrppU2mpt1Fm/2trOwB8W4T8MNDmZyL+ru/KjAGEZwd HoA0G4gUlN8p5rOwWYwpFAr+PFFrvE1gy+i9Ln95IVIZs4ekqmGfFjqVwROLKTYKFLd3 XifqO8/bjGBoo3j67/jFvj4aE+w6PKi/POWCQ5/KnseaOquAvNi81rCmCfM27Rgdjsaa yAdwYhZ5VwsROXms1icvHh7Yz/Eusz/7jMzizBkV2cIUAOQOlv6fdYmip7e907JsCUy0 2baw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-41092-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41092-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id ka26-20020a056a00939a00b006dddedb26f8si2511984pfb.240.2024.01.26.23.53.12 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 23:53:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41092-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-41092-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41092-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id F26CDB2305D for <ouuuleilei@gmail.com>; Sat, 27 Jan 2024 07:52:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FF501E883; Sat, 27 Jan 2024 07:52:22 +0000 (UTC) Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 067FE1E863; Sat, 27 Jan 2024 07:52:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706341940; cv=none; b=Vio5yHi83aSGuM+oE9d+racQxMP7qIoZvHxxAgbeKuNXIDJ5hEiQRsKXrg7sqls7h6nu322FmIf1EO1T1FeMonwdqR2rgXCRlApvEL0Zc7c6P0qFIvrrkC907rIBjmqRcm2YZ4kAhidFZfwtp6WgHOQSYpKZ+7ULRUYQ35lNy+s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706341940; c=relaxed/simple; bh=niaIFrprWvPwC2Lv0RN5Cl1tFCytXopzeriQpGSoAMg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qFRDTBVoE2525IgNMXavt/T5RD7hWZow3k7lzuIgrztcmT38UwqrkGiEtl3CTDnJvAX8Be/lkTmwYhXWBYY/Vvc2cfx65PKfWn/vmMI8SeO9PpeDtNaIwHL/ctdqF9eirtHwz9uZ8nqIKadQwuQ2a+73SWbqae/YEwyUdpQLBIs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4TMRbv6BxQz4f3jLw; Sat, 27 Jan 2024 15:52:11 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id D86CE1A016E; Sat, 27 Jan 2024 15:52:15 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP1 (Coremail) with SMTP id cCh0CgDHlxAetrRlWjeACA--.31980S5; Sat, 27 Jan 2024 15:52:04 +0800 (CST) From: Yu Kuai <yukuai1@huaweicloud.com> To: mpatocka@redhat.com, heinzm@redhat.com, xni@redhat.com, agk@redhat.com, snitzer@kernel.org, dm-devel@lists.linux.dev, song@kernel.org, yukuai3@huawei.com, jbrassow@f14.redhat.com, neilb@suse.de, shli@fb.com, akpm@osdl.org Cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, yukuai1@huaweicloud.com, yi.zhang@huawei.com, yangerkun@huawei.com Subject: [PATCH v3 01/12] md: don't ignore suspended array in md_check_recovery() Date: Sat, 27 Jan 2024 15:47:43 +0800 Message-Id: <20240127074754.2380890-2-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240127074754.2380890-1-yukuai1@huaweicloud.com> References: <20240127074754.2380890-1-yukuai1@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: cCh0CgDHlxAetrRlWjeACA--.31980S5 X-Coremail-Antispam: 1UD129KBjvJXoWxJryDAF43ArW7JrWrZr1xGrg_yoW8ZFy7pa yIkF1YyrWjyFZ7Aa4qka4UZa4rAr1jqrW5AFy3u34rCa4fKw43CrWYgFyDXF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145203697 X-GMAIL-MSGID: 1789229261145203697 |
Series |
dm-raid: fix v6.7 regressions
|
|
Commit Message
Yu Kuai
Jan. 27, 2024, 7:47 a.m. UTC
From: Yu Kuai <yukuai3@huawei.com> mddev_suspend() never stop sync_thread, hence it doesn't make sense to ignore suspended array in md_check_recovery(), which might cause sync_thread can't be unregistered. After commit f52f5c71f3d4 ("md: fix stopping sync thread"), following hang can be triggered by test shell/integrity-caching.sh: 1) suspend the array: raid_postsuspend mddev_suspend 2) stop the array: raid_dtr md_stop __md_stop_writes stop_sync_thread set_bit(MD_RECOVERY_INTR, &mddev->recovery); md_wakeup_thread_directly(mddev->sync_thread); wait_event(..., !test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) 3) sync thread done: md_do_sync set_bit(MD_RECOVERY_DONE, &mddev->recovery); md_wakeup_thread(mddev->thread); 4) daemon thread can't unregister sync thread: md_check_recovery if (mddev->suspended) return; -> return directly md_read_sync_thread clear_bit(MD_RECOVERY_RUNNING, &mddev->recovery); -> MD_RECOVERY_RUNNING can't be cleared, hence step 2 hang; This problem is not just related to dm-raid, fix it by ignoring suspended array in md_check_recovery(). And follow up patches will improve dm-raid better to frozen sync thread during suspend. Reported-by: Mikulas Patocka <mpatocka@redhat.com> Closes: https://lore.kernel.org/all/8fb335e-6d2c-dbb5-d7-ded8db5145a@redhat.com/ Fixes: 68866e425be2 ("MD: no sync IO while suspended") Fixes: f52f5c71f3d4 ("md: fix stopping sync thread") Signed-off-by: Yu Kuai <yukuai3@huawei.com> --- drivers/md/md.c | 3 --- 1 file changed, 3 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c index 2266358d8074..07b80278eaa5 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -9469,9 +9469,6 @@ static void md_start_sync(struct work_struct *ws) */ void md_check_recovery(struct mddev *mddev) { - if (READ_ONCE(mddev->suspended)) - return; - if (mddev->bitmap) md_bitmap_daemon_work(mddev);