Skip to content

Commit 229f412

Browse files
committed
Merge tag 'md-7.0-20260202' of git://git.kernel.org/pub/scm/linux/kernel/git/mdraid/linux into for-7.0/block
Pull MD fixes from Yu Kuai: "Bug Fixes: - Fix return value of mddev_trylock (Xiao Ni) - Fix memory leak in raid1_run() (Zilin Guan) Maintainers: - Add Li Nan as mdraid reviewer (Li Nan)" * tag 'md-7.0-20260202' of git://git.kernel.org/pub/scm/linux/kernel/git/mdraid/linux: MAINTAINERS: Add Li Nan as md/raid reviewer md: fix return value of mddev_trylock md/raid1: fix memory leak in raid1_run()
2 parents 5314d25 + b36844f commit 229f412

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24239,6 +24239,7 @@ F: include/linux/property.h
2423924239
SOFTWARE RAID (Multiple Disks) SUPPORT
2424024240
M: Song Liu <song@kernel.org>
2424124241
M: Yu Kuai <yukuai@fnnas.com>
24242+
R: Li Nan <linan122@huawei.com>
2424224243
L: linux-raid@vger.kernel.org
2424324244
S: Supported
2424424245
Q: https://patchwork.kernel.org/project/linux-raid/list/

drivers/md/md.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,8 +735,8 @@ static inline int mddev_trylock(struct mddev *mddev)
735735
int ret;
736736

737737
ret = mutex_trylock(&mddev->reconfig_mutex);
738-
if (!ret && test_bit(MD_DELETED, &mddev->flags)) {
739-
ret = -ENODEV;
738+
if (ret && test_bit(MD_DELETED, &mddev->flags)) {
739+
ret = 0;
740740
mutex_unlock(&mddev->reconfig_mutex);
741741
}
742742
return ret;

drivers/md/raid1.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3236,6 +3236,7 @@ static int raid1_run(struct mddev *mddev)
32363236
if (!mddev_is_dm(mddev)) {
32373237
ret = raid1_set_limits(mddev);
32383238
if (ret) {
3239+
md_unregister_thread(mddev, &conf->thread);
32393240
if (!mddev->private)
32403241
raid1_free(mddev, conf);
32413242
return ret;

0 commit comments

Comments
 (0)