mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
md: fail if mddev->bio_set can't be created
The current behaviour is to fall back to allocate bio from 'fs_bio_set', that isn't a correct way because it might cause deadlock. So this patch simply return failure if mddev->bio_set can't be created. Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Shaohua Li <[email protected]>
This commit is contained in:
parent
c18a1e0900
commit
10273170fd
1 changed files with 4 additions and 1 deletions
|
|
@ -5228,8 +5228,11 @@ int md_run(struct mddev *mddev)
|
|||
sysfs_notify_dirent_safe(rdev->sysfs_state);
|
||||
}
|
||||
|
||||
if (mddev->bio_set == NULL)
|
||||
if (mddev->bio_set == NULL) {
|
||||
mddev->bio_set = bioset_create(BIO_POOL_SIZE, 0);
|
||||
if (!mddev->bio_set)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
spin_lock(&pers_lock);
|
||||
pers = find_pers(mddev->level, mddev->clevel);
|
||||
|
|
|
|||
Loading…
Reference in a new issue