]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
md: split mddev_find
authorChristoph Hellwig <hch@lst.de>
Sat, 3 Apr 2021 16:15:29 +0000 (18:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 08:49:26 +0000 (10:49 +0200)
commit6b64610ac25d00e11fb6e188f60f697ca40ce8dc
tree9e10796fdf40b88043c8b184104cffaaff355686
parent48e11f31c80e2e90d3df84a0a5bfbe9c71898953
md: split mddev_find

commit 65aa97c4d2bfd76677c211b9d03ef05a98c6d68e upstream.

Split mddev_find into a simple mddev_find that just finds an existing
mddev by the unit number, and a more complicated mddev_find that deals
with find or allocating a mddev.

This turns out to fix this bug reported by Zhao Heming.

----------------------------- snip ------------------------------
commit d3374825ce57 ("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.
drivers/md/md.c