lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 20 Jan 2024 18:37:33 +0800
From: Yu Kuai <yukuai1@...weicloud.com>
To: mpatocka@...hat.com,
	dm-devel@...ts.linux.dev,
	msnitzer@...hat.com,
	heinzm@...hat.com,
	song@...nel.org,
	yukuai3@...wei.com
Cc: linux-raid@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	yukuai1@...weicloud.com,
	yi.zhang@...wei.com,
	yangerkun@...wei.com
Subject: [PATCH RFC 4/5] md: revert commit fa2bbff7b0b4 ("md: synchronize flush io with array reconfiguration") for dm-raid

From: Yu Kuai <yukuai3@...wei.com>

This commit is used to fix a problem for md/raid, due to rdev lifetime
in conf is different from the array. However, on the one hand, the
management of rdev is completely different from dm-raid; on the other
hand, this commit breaks dm-raid and the test shell/integrity-caching.sh
will hang.

The root cause of the hang is still not clear yet, however, let's revert
the commit for dm-raid to prevent regression first. We can decide what
to do after figuring out the root cause.

Fixes: fa2bbff7b0b4 ("md: synchronize flush io with array reconfiguration")
Signed-off-by: Yu Kuai <yukuai3@...wei.com>
---
 drivers/md/md.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index ba45c7be3dbe..7db749ba7e60 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -544,7 +544,8 @@ static void md_end_flush(struct bio *bio)
 
 	if (atomic_dec_and_test(&mddev->flush_pending)) {
 		/* The pair is percpu_ref_get() from md_flush_request() */
-		percpu_ref_put(&mddev->active_io);
+		if (mddev->gendisk)
+			percpu_ref_put(&mddev->active_io);
 
 		/* The pre-request flush has finished */
 		queue_work(md_wq, &mddev->flush_work);
@@ -640,7 +641,8 @@ bool md_flush_request(struct mddev *mddev, struct bio *bio)
 		 * concurrently.
 		 */
 		WARN_ON(percpu_ref_is_zero(&mddev->active_io));
-		percpu_ref_get(&mddev->active_io);
+		if (mddev->gendisk)
+			percpu_ref_get(&mddev->active_io);
 		mddev->flush_bio = bio;
 		bio = NULL;
 	}
-- 
2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ