Commit 10b2c6ae authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Li Lingfeng
Browse files

md: do not return existing mddevs from mddev_find_or_alloc

mainline inclusion
from mainline-v5.13-rc1
commit 0d809b38
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8O6NL
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0d809b3837a0bede8f58a67e303e339585777bf4



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

Instead of returning an existing mddev, just for it to be discarded
later directly return -EEXIST.  Rename the function to mddev_alloc now
that it doesn't find an existing mddev.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarSong Liu <song@kernel.org>

Conflicts:
  Commit 4ad5f208 ("md: Flush workqueue md_rdev_misc_wq in md_alloc()")
  add flushing md_rdev_misc_wq in md_alloc().
Signed-off-by: default avatarLi Lingfeng <lilingfeng3@huawei.com>
parent 6c6292c2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment