]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
md-cluster: fix rmmod issue when md_cluster convert bitmap to none
authorZhao Heming <heming.zhao@suse.com>
Mon, 20 Jul 2020 18:08:53 +0000 (02:08 +0800)
committerSong Liu <songliubraving@fb.com>
Wed, 22 Jul 2020 00:30:37 +0000 (17:30 -0700)
commitedee9dfe51b77ad6532a1014a7be91b2a423bc37
tree17bd346200afb8da9403d838be6be97e09e1f3c9
parent7c9d5c54fb72d92fe3fd7d3a3eb58b5200e454c4
md-cluster: fix rmmod issue when md_cluster convert bitmap to none

update_array_info misses calling module_put when removing cluster bitmap.

steps to reproduce:
```
node1 # mdadm -C /dev/md0 -b clustered -e 1.2 -n 2 -l mirror /dev/sda
/dev/sdb
mdadm: array /dev/md0 started.
node1 # lsmod | egrep "dlm|md_|raid1"
md_cluster             28672  1
dlm                   212992  14 md_cluster
configfs               57344  2 dlm
raid1                  53248  1
md_mod                176128  2 raid1,md_cluster
node1 # mdadm -G /dev/md0 -b none
node1 # lsmod | egrep "dlm|md_|raid1"
md_cluster             28672  1 <== should be zero
dlm                   212992  9 md_cluster
configfs               57344  2 dlm
raid1                  53248  1
md_mod                176128  2 raid1,md_cluster
node1 # mdadm -G /dev/md0 -b clustered
node1 # lsmod | egrep "dlm|md_|raid1"
md_cluster             28672  2 <== increase
dlm                   212992  14 md_cluster
configfs               57344  2 dlm
raid1                  53248  1
md_mod                176128  2 raid1,md_cluster
node1 # mdadm -G /dev/md0 -b none
node1 # mdadm -G /dev/md0 -b clustered
node1 # lsmod | egrep "dlm|md_|raid1"
md_cluster             28672  3 <== increase
dlm                   212992  14 md_cluster
configfs               57344  2 dlm
raid1                  53248  1
md_mod                176128  2 raid1,md_cluster
```

Reviewed-by: NeilBrown <neilb@suse.de>
Signed-off-by: Zhao Heming <heming.zhao@suse.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
drivers/md/md.c