diff mbox series

[2/2] md: Double free io_acct_set bioset

Message ID 20220512092109.41606-3-xni@redhat.com (mailing list archive)
State Accepted, archived
Headers show
Series md: reshape from raid0 to raid10 panic | expand

Commit Message

Xiao Ni May 12, 2022, 9:21 a.m. UTC
Now io_acct_set is alloc and free in personality. Remove the codes that
free io_acct_set in md_free and md_stop.

Fixes: 0c031fd37f69 (md: Move alloc/free acct bioset in to personality)
Signed-off-by: Xiao Ni <xni@redhat.com>
---
 drivers/md/md.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Song Liu May 12, 2022, 4:26 p.m. UTC | #1
On Thu, May 12, 2022 at 2:21 AM Xiao Ni <xni@redhat.com> wrote:
>
> Now io_acct_set is alloc and free in personality. Remove the codes that
> free io_acct_set in md_free and md_stop.
>
> Fixes: 0c031fd37f69 (md: Move alloc/free acct bioset in to personality)
> Signed-off-by: Xiao Ni <xni@redhat.com>

Applied the set to md-next. Changed the subject of 2/2 as
 md: *fix* double free of io_acct_set bioset

Thanks,
Song

> ---
>  drivers/md/md.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 53787a32166d..91c6cb3da470 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -5598,8 +5598,6 @@ static void md_free(struct kobject *ko)
>
>         bioset_exit(&mddev->bio_set);
>         bioset_exit(&mddev->sync_set);
> -       if (mddev->level != 1 && mddev->level != 10)
> -               bioset_exit(&mddev->io_acct_set);
>         kfree(mddev);
>  }
>
> @@ -6285,8 +6283,6 @@ void md_stop(struct mddev *mddev)
>         __md_stop(mddev);
>         bioset_exit(&mddev->bio_set);
>         bioset_exit(&mddev->sync_set);
> -       if (mddev->level != 1 && mddev->level != 10)
> -               bioset_exit(&mddev->io_acct_set);
>  }
>
>  EXPORT_SYMBOL_GPL(md_stop);
> --
> 2.32.0 (Apple Git-132)
>
diff mbox series

Patch

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 53787a32166d..91c6cb3da470 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5598,8 +5598,6 @@  static void md_free(struct kobject *ko)
 
 	bioset_exit(&mddev->bio_set);
 	bioset_exit(&mddev->sync_set);
-	if (mddev->level != 1 && mddev->level != 10)
-		bioset_exit(&mddev->io_acct_set);
 	kfree(mddev);
 }
 
@@ -6285,8 +6283,6 @@  void md_stop(struct mddev *mddev)
 	__md_stop(mddev);
 	bioset_exit(&mddev->bio_set);
 	bioset_exit(&mddev->sync_set);
-	if (mddev->level != 1 && mddev->level != 10)
-		bioset_exit(&mddev->io_acct_set);
 }
 
 EXPORT_SYMBOL_GPL(md_stop);