Thread (4 messages) 4 messages, 3 authors, 2023-02-28

Re: [PATCH 5.10] md: Flush workqueue md_rdev_misc_wq in md_alloc()

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2023-02-28 18:37:15
Also in: stable

On Fri, Feb 24, 2023 at 02:52:09PM +0800, Hou Tao wrote:
From: David Sloan <redacted>

commit 5e8daf906f890560df430d30617c692a794acb73 upstream.

A race condition still exists when removing and re-creating md devices
in test cases. However, it is only seen on some setups.

The race condition was tracked down to a reference still being held
to the kobject by the rdev in the md_rdev_misc_wq which will be released
in rdev_delayed_delete().

md_alloc() waits for previous deletions by waiting on the md_misc_wq,
but the md_rdev_misc_wq may still be holding a reference to a recently
removed device.

To fix this, also flush the md_rdev_misc_wq in md_alloc().

Signed-off-by: David Sloan <redacted>
[logang@deltatee.com: rewrote commit message]
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Hou Tao <redacted>
---
Hi Greg,

We found the problem also exists on v5.10, so could you please pick it up
for v5.10 ?
Now queued up, thanks.

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help