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

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

 



On 3/30/21 3:43 PM, Zhao Heming 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.

*** env ***
kvm-qemu VM 2C1G with 2 iscsi luns
kernel should be non-preempt

*** script ***

about trigger 1 time with 10 tests

```
1  node1="15sp3-mdcluster1"
2  node2="15sp3-mdcluster2"
3
4  mdadm -Ss
5  ssh ${node2} "mdadm -Ss"
6  wipefs -a /dev/sda /dev/sdb
7  mdadm -CR /dev/md0 -b clustered -e 1.2 -n 2 -l mirror /dev/sda \
    /dev/sdb --assume-clean
8
9  for i in {1..100}; do
10    echo ==== $i ====;
11
12    echo "test  ...."
13    ssh ${node2} "mdadm -A /dev/md0 /dev/sda /dev/sdb"
14    sleep 1
15
16    echo "clean  ....."
17    ssh ${node2} "mdadm -Ss"
18 done
```


the non-clustered test script. (again: run on non-preempt kernel)

```
#!/bin/bash

mdadm -Ss
wipefs -a /dev/sda /dev/sdb
mdadm -CR /dev/md0 -b internal -e 1.2 -n 2 -l mirror /dev/sda /dev/sdb  --assume-clean
sleep 5
mdadm -Ss

for i in {1..200}; do
    echo ==== $i ====;

    echo "test  ...."
    mdadm -A /dev/md0 /dev/sda /dev/sdb
    sleep 1

    echo "clean  ....."
    mdadm -Ss
done
```

the value N on "/sys/module/md_mod/parameters/create_on_open" is useless.

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