On Sun, Jul 19 2020, Zhao Heming wrote: > 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 > ``` > > Signed-off-by: Zhao Heming <heming.zhao@xxxxxxxx> > --- > drivers/md/md.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/md/md.c b/drivers/md/md.c > index e20f1d5a5261..ca791387e54d 100644 > --- a/drivers/md/md.c > +++ b/drivers/md/md.c > @@ -7363,6 +7363,7 @@ static int update_array_info(struct mddev *mddev, mdu_array_info_t *info) > > mddev->bitmap_info.nodes = 0; > md_cluster_ops->leave(mddev); > + module_put(md_cluster_mod); > mddev->safemode_delay = DEFAULT_SAFEMODE_DELAY; I would make this a call to "md_cluster_stop()", and move the reset of ->safemode_delay" in there, but either way this is correct and needed. Reviewed-by: NeilBrown <neilb@xxxxxxx> Thanks, NeilBrown > } > mddev_suspend(mddev); > -- > 2.25.0
Attachment:
signature.asc
Description: PGP signature