linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neil@brown.name>
To: linux-raid@vger.kernel.org
Cc: Zhao Heming <heming.zhao@suse.com>,
	neilb@suse.com, jes@trained-monkey.org
Subject: Re: [PATCH v4 2/2] md-cluster: fix rmmod issue when md_cluster convert bitmap to none
Date: Mon, 20 Jul 2020 09:26:36 +1000	[thread overview]
Message-ID: <87h7u3w0gj.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <1595156920-31427-3-git-send-email-heming.zhao@suse.com>

[-- Attachment #1: Type: text/plain, Size: 2290 bytes --]

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@suse.com>
> ---
>  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@suse.de>

Thanks,
NeilBrown


>  			}
>  			mddev_suspend(mddev);
> -- 
> 2.25.0

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2020-07-19 23:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-19 11:08 [PATCH v4 0/2] md_cluster: bugs fix Zhao Heming
2020-07-19 11:08 ` [PATCH v4 1/2] md-cluster: fix safemode_delay value when converting to clustered bitmap Zhao Heming
2020-07-19 23:24   ` NeilBrown
2020-07-20 16:03     ` heming.zhao
2020-07-19 11:08 ` [PATCH v4 2/2] md-cluster: fix rmmod issue when md_cluster convert bitmap to none Zhao Heming
2020-07-19 23:26   ` NeilBrown [this message]
2020-07-20 15:27     ` heming.zhao
2020-07-19 13:46 ` [PATCH v4 0/2] md_cluster: bugs fix heming.zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h7u3w0gj.fsf@notabene.neil.brown.name \
    --to=neil@brown.name \
    --cc=heming.zhao@suse.com \
    --cc=jes@trained-monkey.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).