Re: [PATCH] md: don't create mddev in md_open

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/1/21 6:46 AM, Song Liu wrote:
On Tue, Mar 30, 2021 at 12:43 AM Zhao Heming <heming.zhao@xxxxxxxx> wrote:

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.

... ...

Signed-off-by: Zhao Heming <heming.zhao@xxxxxxxx>
---
  drivers/md/md.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 21da0c48f6c2..730d8570ad6d 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -734,7 +734,7 @@ void mddev_init(struct mddev *mddev)
  }
  EXPORT_SYMBOL_GPL(mddev_init);

-static struct mddev *mddev_find(dev_t unit)
+static struct mddev *mddev_find(dev_t unit, bool create)

"create" is added but never used? Wrong version?

Thanks,
Song



ooh, sorry, I wrote code and tested on SUSE sles15-sp3 & tumbleweed.
Then differed and merged code on upstream branch, missed 2 line.
Please see v2 patch.

Thanks,
heming




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux