Skip to content
Snippets Groups Projects
Commit be08a107 authored by Zhao Heming's avatar Zhao Heming Committed by Yang Yingliang
Browse files

md: md_open returns -EBUSY when entering racing area


stable inclusion
from linux-4.19.191
commit 5db6e4c5c1284cec6720afe27f202a3dca697def

--------------------------------

commit 6a4db2a60306eb65bfb14ccc9fde035b74a4b4e7 upstream.

commit d3374825 ("md: make devices disappear when they are no longer
needed.") introduced protection between mddev creating & removing. The
md_open shouldn't create mddev when all_mddevs list doesn't contain
mddev. With currently code logic, there will be very easy to trigger
soft lockup in non-preempt env.

This patch changes md_open returning from -ERESTARTSYS to -EBUSY, which
will break the infinitely retry when md_open enter racing area.

This patch is partly fix soft lockup issue, full fix needs mddev_find
is split into two functions: mddev_find & mddev_find_or_alloc. And
md_open should call new mddev_find (it only does searching job).

For more detail, please refer with Christoph's "split mddev_find" patch
in later commits.

Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 69d5e5ca
No related branches found
No related tags found
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment