Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp999024rdb; Wed, 24 Jan 2024 01:24:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IHjjRt0LSGfYOWtL2+1RaCe3maWDaC1vsm8mKGD3fWCEzvjvMRk32ayy545cWFHcJns4a4D X-Received: by 2002:a05:6870:b015:b0:203:b957:e0bc with SMTP id y21-20020a056870b01500b00203b957e0bcmr3060364oae.116.1706088255600; Wed, 24 Jan 2024 01:24:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706088255; cv=pass; d=google.com; s=arc-20160816; b=Xem82a3wgRpdaIt42xNRdSWDejxYw+Wx5OzhEUr1sJ0s6lNWAizlLpqj2s09e1oCww Wn1WQDmJyEZ2T23yRenGq8WWNxHlMAfIVJZ/cG7AZ7yCtMt65LEK0eePx0Ne46d0s9EZ dH88EQclOiC+K28cYTK7FOCaeUZLrOVUcVkJRVCFvTFMWfB/C5R9tXtfyB6suiWCqGth zVvDgkLxbTxGIdlkJ7n5S4cznNrHPgx4kyU3s/MhT2H9t7pGb69k/qTqAeZgoz9Bxa9r wVPB8xGkdQbf1n73DUXAq+xsJ29u70nl1a0Ilf5eZrA+srCpz7LHDLhKB6RYqVg8viNq m1LA== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36701-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 27-20020a63145b000000b005d14ca08256si2989546pgu.819.2024.01.24.01.24.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 01:24:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36701-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36701-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 565872903C7 for ; Wed, 24 Jan 2024 09:22:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62F8E182DB; Wed, 24 Jan 2024 09:20:51 +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 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600009.china.huawei.com (7.193.23.164) 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); } } -- 2.39.2