Skip to content

Commit cd586d2

Browse files
committed
Merge branch 'md-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into block-5.15
Pull MD fix from Song. * 'md-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: md: fix a lock order reversal in md_alloc
2 parents 858560b + 7df835a commit cd586d2

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

drivers/md/md.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5700,10 +5700,6 @@ static int md_alloc(dev_t dev, char *name)
57005700
disk->flags |= GENHD_FL_EXT_DEVT;
57015701
disk->events |= DISK_EVENT_MEDIA_CHANGE;
57025702
mddev->gendisk = disk;
5703-
/* As soon as we call add_disk(), another thread could get
5704-
* through to md_open, so make sure it doesn't get too far
5705-
*/
5706-
mutex_lock(&mddev->open_mutex);
57075703
add_disk(disk);
57085704

57095705
error = kobject_add(&mddev->kobj, &disk_to_dev(disk)->kobj, "%s", "md");
@@ -5718,7 +5714,6 @@ static int md_alloc(dev_t dev, char *name)
57185714
if (mddev->kobj.sd &&
57195715
sysfs_create_group(&mddev->kobj, &md_bitmap_group))
57205716
pr_debug("pointless warning\n");
5721-
mutex_unlock(&mddev->open_mutex);
57225717
abort:
57235718
mutex_unlock(&disks_mutex);
57245719
if (!error && mddev->kobj.sd) {

0 commit comments

Comments
 (0)