From patchwork Wed Jan 24 09:14:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Kuai X-Patchwork-Id: 191442 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp870125dyi; Wed, 24 Jan 2024 01:22:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IGqegxa2+w3Y3AVsfpuwu/J5HPd3OXZeftWzqlIZDHlLkHg9Dcj/KIiTiFUYBV+bxmgPKR9 X-Received: by 2002:a05:620a:f94:b0:783:32f4:1f1a with SMTP id b20-20020a05620a0f9400b0078332f41f1amr7249984qkn.136.1706088162355; Wed, 24 Jan 2024 01:22:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706088162; cv=pass; d=google.com; s=arc-20160816; b=YpXf7lg9jaioFSWLrZtrA9jn+nFou/h9tcR05qNB9ifqmjk2q4+FVJYuDWKnuVf6vc EKCitgCdkvrnivBrpDMBMZgRTkOu2T06Z3W/wjrbUsk/i5Te8KitagptJU87LGVNP5u2 2AL5b1HMnYyBO4kOn5dDDN3/rIR+doNEfA8XqHOIroobiZ0Hp4njCee43lUDeQ62JRd/ wFEdp+tC59N1JMNmGkw4BxTqlLzw2TeenVrIcsbp3Nyxsx6ZZPbRxfrGTH1OdGrZ7JKY sOjT75QKy/W2NVVWHcO0b0QFsx9DkCPMH6X8VeQbvWkrverOWkBBeYKyHs4/Ol3dNmKN rdCQ== 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=AItaH+Dvpe2z2f/WBLecqK90leEegMvMUd4eA1AvCso=; fh=SaJ9rWjnsGFI+7ibUS2Ywr9D7BSRvW01ZC90UJpOFqs=; b=CaJ3NXjvow5IcJCsx7TNTdIkzr9Pj4rak0IMqlpjD/h20Zaw/BtaPvM4jqbumb8LN/ QSnAQgvq/Tc09a65yrr9IRAEFgYQkJE06z42JuTKxa6xgbxITNoMdi3GsVucUabdQ5SQ zF4C2B7353VnGcNO/hQ6DTUE+rnBckFa1kcNKSczm9w/bwXVFAO28DUff3yZSRE8Qtbb jOcBhx38voXQQky0ZWjHn6+8pTfhwla2jmgnnVSEkA1hBy6TSGuNMqZ2GUzqsjGQRqgr Asg/I74RbMSho1CCYHbn2f5eBB0AsmPzu3FacSzdITmZky37Gdg4B5fDfmbxfJqCEKky Ywzw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-36701-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36701-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bl24-20020a05620a1a9800b0078334705d14si10684122qkb.311.2024.01.24.01.22.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 01:22:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36701-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-36701-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36701-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 226CE1C24602 for ; Wed, 24 Jan 2024 09:22:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6B30D1A27D; Wed, 24 Jan 2024 09:20:52 +0000 (UTC) Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) (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 8544417C95; Wed, 24 Jan 2024 09:20:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.35 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706088050; cv=none; b=KxRegma7OwY6+ek1ruU3ytnod+zElFpWprgFX19cenkkDw3GYMv8VxlhZeLXYUBYDTTn0To8MPr7GyPmAJu+lgTeMZCzo4BEgL/beHKOua39zF4RwF4aEwrKD0CMZqttuUAcCvVHYGgZaNh91D4x57HoiS+Xk3L3DQLLBrAdwWc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706088050; c=relaxed/simple; bh=khR8VN0nW3AZEac17bucoey0NPJ0wJECbGw6pkiHPS8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CebzQo3+cG0VjBvj3ezO2bmegCUABISm6QHMguDa5Yf/etvJOhlGQu8svIZbRT3bq2Xeq9JP8za3qUNrJrNPOVba+AV9gkwP1eG50N6eI8c/XJ/QW4SjLBWoP8ereZeOs5BGeMT8hElY7RXUL8LuPSxdfIKz99/rjjwPNHPHn9I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4TKdgW1cgJz1Q85S; Wed, 24 Jan 2024 17:19:03 +0800 (CST) Received: from kwepemm600009.china.huawei.com (unknown [7.193.23.164]) by mail.maildlp.com (Postfix) with ESMTPS id BF5EF1A0171; Wed, 24 Jan 2024 17:20:32 +0800 (CST) Received: from huawei.com (10.175.104.67) by kwepemm600009.china.huawei.com (7.193.23.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 24 Jan 2024 17:18:25 +0800 From: Yu Kuai To: , , , , , , , , , , , CC: , , , , Subject: [PATCH v2 08/11] dm-raid: remove mddev_suspend/resume() Date: Wed, 24 Jan 2024 17:14:18 +0800 Message-ID: <20240124091421.1261579-9-yukuai3@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240124091421.1261579-1-yukuai3@huawei.com> References: <20240124091421.1261579-1-yukuai3@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600009.china.huawei.com (7.193.23.164) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788963100981165343 X-GMAIL-MSGID: 1788963100981165343 dm_suspend() already make sure that no new IO can be issued and will wait for all dispatched IO to be done. There is no need to call mddev_suspend() to make sure that again. Signed-off-by: Yu Kuai --- drivers/md/dm-raid.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index 6b6c011d9f69..f1637cf88559 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -3241,7 +3241,7 @@ static int raid_ctr(struct dm_target *ti, unsigned int argc, char **argv) rs->md.in_sync = 1; /* Has to be held on running the array */ - mddev_suspend_and_lock_nointr(&rs->md); + mddev_lock_nointr(&rs->md); /* Keep array frozen until resume. */ md_frozen_sync_thread(&rs->md); @@ -3825,11 +3825,9 @@ static void raid_postsuspend(struct dm_target *ti) { struct raid_set *rs = ti->private; - if (!test_and_set_bit(RT_FLAG_RS_SUSPENDED, &rs->runtime_flags)) { + if (!test_and_set_bit(RT_FLAG_RS_SUSPENDED, &rs->runtime_flags)) /* Writes have to be stopped before suspending to avoid deadlocks. */ md_stop_writes(&rs->md); - mddev_suspend(&rs->md, false); - } } static void attempt_restore_of_faulty_devices(struct raid_set *rs) @@ -4085,7 +4083,7 @@ static void raid_resume(struct dm_target *ti) mddev->ro = 0; mddev->in_sync = 0; md_unfrozen_sync_thread(mddev); - mddev_unlock_and_resume(mddev); + mddev_unlock(mddev); } }