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: Wed, 28 Feb 2024 20:44:13 +0800
From: Yu Kuai <yukuai1@...weicloud.com>
To: Xiao Ni <xni@...hat.com>, Yu Kuai <yukuai1@...weicloud.com>,
 mpatocka@...hat.com, heinzm@...hat.com, blazej.kucman@...ux.intel.com,
 agk@...hat.com, snitzer@...nel.org, dm-devel@...ts.linux.dev,
 song@...nel.org, neilb@...e.de, shli@...com, akpm@...l.org
Cc: linux-kernel@...r.kernel.org, linux-raid@...r.kernel.org,
 yi.zhang@...wei.com, yangerkun@...wei.com, "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH v5 04/14] md: don't register sync_thread for reshape
 directly

Hi,

在 2024/02/28 20:07, Xiao Ni 写道:
> I have a question here. Is it the reason sync_thread can't run 
> md_do_sync because kthread_should_stop, so it doesn't have the chance to 
> set MD_RECOVERY_DONE? Why creating sync thread in md_check_recovery 
> doesn't have this problem? Could you explain more about this?

raid10_run() only register sync_thread, without calling
md_wakeup_thread() to set the bit 'THREAD_WAKEUP', md_do_sync() will not
be executed.

raid5 defines 'pers->start' hence md_start() will call
md_wakeup_thread().

md_start_sync() will always call md_wakeup_thread() hence there is no
such problem.

BTW, this patch fix the same problem as you mentioned in your other
thread:

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 2266358d8074..54790261254d 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4904,6 +4904,7 @@ static void stop_sync_thread(struct mddev *mddev, 
bool locked, bool check_seq)
  	 * never happen
  	 */
  	md_wakeup_thread_directly(mddev->sync_thread);
+	md_wakeup_thread(mddev->sync_thread);
  	if (work_pending(&mddev->sync_work))
  		flush_work(&mddev->sync_work);

However, I think the one to register sync_thread is responsible to wake
it up.

Thanks,
Kuai


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ