Thread (7 messages) 7 messages, 2 authors, 2023-07-07

Re: [PATCH -next 1/2] md: don't quiesce in mddev_suspend()

From: Song Liu <song@kernel.org>
Date: 2023-07-07 09:07:02
Also in: lkml

On Wed, Jun 28, 2023 at 2:29 PM Yu Kuai [off-list ref] wrote:
Hi,

在 2023/06/28 9:29, Yu Kuai 写道:
quoted
From: Yu Kuai <redacted>

Some levels doesn't implement "pers->quiesce", for example
raid0_quiesce() is empty, and now that all levels will drop 'active_io'
until io is done, wait for 'active_io' to be 0 is enough to make sure all
normal io is done, and percpu_ref_kill() for 'active_io' will make sure
no new normal io can be dispatched. There is no need to call
"pers->quiesce" anymore from mddev_suspend().
Just found that this patch actually prevent null_ptr_deref in some cases
that "pers->quiesce" is NULl for some personalities, and caller of
mddev_suspend() doesn't check this. For example, suspend_lo_store()
checks "pers->quiesce" is not NULL before calling mddev_suspend(), while
suspend_hi_store() doesn't.
Let's refactor the code so that suspend_lo_store() and suspend_hi_store()
share code for this logic.

Thanks,
Song
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help