Yu Kuai a705b11b35 md/raid5-cache: fix a deadlock in r5l_exit_log()
Commit b13015af94cf ("md/raid5-cache: Clear conf->log after finishing
work") introduce a new problem:

// caller hold reconfig_mutex
r5l_exit_log
 flush_work(&log->disable_writeback_work)
			r5c_disable_writeback_async
			 wait_event
			  /*
			   * conf->log is not NULL, and mddev_trylock()
			   * will fail, wait_event() can never pass.
			   */
 conf->log = NULL

Fix this problem by setting 'config->log' to NULL before wake_up() as it
used to be, so that wait_event() from r5c_disable_writeback_async() can
exist. In the meantime, move forward md_unregister_thread() so that
null-ptr-deref this commit fixed can still be fixed.

Fixes: b13015af94cf ("md/raid5-cache: Clear conf->log after finishing work")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20230708091727.1417894-1-yukuai1@huaweicloud.com
Signed-off-by: Song Liu <song@kernel.org>
2023-08-15 09:37:27 -07:00
..
2023-07-11 09:23:20 +02:00
2023-07-06 22:25:06 -07:00
2023-07-03 12:56:23 -07:00
2023-06-29 11:00:17 -07:00
2023-07-06 09:56:53 -07:00
2023-06-29 08:09:31 -06:00
2023-07-03 15:38:26 -07:00
2023-06-29 16:03:58 -07:00
2023-07-06 09:48:31 -07:00
2023-07-11 09:23:20 +02:00
2023-07-14 13:19:54 +10:00
2023-07-12 11:56:22 -07:00
2023-07-03 12:56:23 -07:00
2023-07-08 12:28:00 -07:00
2023-07-03 12:56:23 -07:00
2023-06-29 15:28:33 -07:00
2023-07-03 11:26:05 -07:00
2023-07-05 10:42:32 -07:00
2023-07-06 10:06:04 -07:00
2023-07-03 10:55:04 -07:00
2023-06-28 14:02:03 -07:00
2023-06-29 14:58:26 -07:00
2023-07-05 21:38:13 -07:00
2023-07-13 00:05:52 +02:00
2023-06-29 15:22:19 -07:00
2023-07-05 12:55:06 -07:00
2023-07-06 19:20:23 -07:00
2023-07-03 17:03:05 -07:00
2023-06-29 15:22:19 -07:00
2023-07-03 10:43:10 -07:00
2023-07-15 08:51:02 -07:00
2023-07-05 10:42:32 -07:00
2023-06-29 15:22:19 -07:00
2023-07-03 15:38:26 -07:00
2023-06-30 15:22:09 -07:00
2023-07-03 15:38:26 -07:00
2023-07-03 11:31:01 -07:00
2023-07-13 13:39:36 -07:00