summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-09-01 14:38:32 +0300
committerJens Axboe <axboe@kernel.dk>2021-10-18 23:50:21 +0300
commit94f3cd7d832c28681f1dea54b4dd8606e5e2bc75 (patch)
tree3752d011c614186998442663f46e498cba04364e /drivers/md
parent51238e7fbd6182e36dbc093c92ae93142c57c0f5 (diff)
downloadlinux-94f3cd7d832c28681f1dea54b4dd8606e5e2bc75.tar.xz
md: extend disks_mutex coverage
disks_mutex is intended to serialize md_alloc. Extended it to also cover the kobject_uevent call and getting the sysfs dirent to help reducing error handling complexity. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index e04a23dc46bf..946bbedf5dcf 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5725,12 +5725,12 @@ static int md_alloc(dev_t dev, char *name)
error = 0;
}
abort:
- mutex_unlock(&disks_mutex);
if (!error && mddev->kobj.sd) {
kobject_uevent(&mddev->kobj, KOBJ_ADD);
mddev->sysfs_state = sysfs_get_dirent_safe(mddev->kobj.sd, "array_state");
mddev->sysfs_level = sysfs_get_dirent_safe(mddev->kobj.sd, "level");
}
+ mutex_unlock(&disks_mutex);
mddev_put(mddev);
return error;
}