diff options
author | Jens Axboe <axboe@kernel.dk> | 2021-12-10 10:19:52 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-12-10 10:19:52 -0700 |
commit | a5c24552354ff1e35bb4022ebc0b791eb7882b04 (patch) | |
tree | 917fff6c999b47fd78b661b151e491da7851ed00 | |
parent | 091f06d91cbc8a51b63c26007e29baae49282b16 (diff) | |
parent | 07641b5f32f6991758b08da9b1f4173feeb64f2a (diff) | |
download | lwn-a5c24552354ff1e35bb4022ebc0b791eb7882b04.tar.gz lwn-a5c24552354ff1e35bb4022ebc0b791eb7882b04.zip |
Merge branch 'md-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into block-5.16
Pull MD fixes from Song.
* 'md-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md:
md: fix double free of mddev->private in autorun_array()
md: fix update super 1.0 on rdev size change
-rw-r--r-- | drivers/md/md.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 5111ed966947..41d6e2383517 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -2189,6 +2189,7 @@ super_1_rdev_size_change(struct md_rdev *rdev, sector_t num_sectors) if (!num_sectors || num_sectors > max_sectors) num_sectors = max_sectors; + rdev->sb_start = sb_start; } sb = page_address(rdev->sb_page); sb->data_size = cpu_to_le64(num_sectors); @@ -6270,7 +6271,8 @@ static void __md_stop(struct mddev *mddev) spin_lock(&mddev->lock); mddev->pers = NULL; spin_unlock(&mddev->lock); - pers->free(mddev, mddev->private); + if (mddev->private) + pers->free(mddev, mddev->private); mddev->private = NULL; if (pers->sync_request && mddev->to_remove == NULL) mddev->to_remove = &md_redundancy_group; |