diff options
author | Ming Lei <tom.leiming@gmail.com> | 2017-02-14 10:29:00 -0500 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2017-02-15 14:23:24 -0500 |
commit | 10273170fd5602d8090b1312e66ad4746ab02c94 (patch) | |
tree | fabf2633960f4fdbbc1a6963c3fe2011577c42b4 /drivers/md/md.c | |
parent | c18a1e09008de7d8bd82b046d38a88f4285d53f9 (diff) |
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 <hch@lst.de>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 13020e5c8cc0..137a1fe124e8 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -5228,8 +5228,11 @@ int md_run(struct mddev *mddev) | |||
5228 | sysfs_notify_dirent_safe(rdev->sysfs_state); | 5228 | sysfs_notify_dirent_safe(rdev->sysfs_state); |
5229 | } | 5229 | } |
5230 | 5230 | ||
5231 | if (mddev->bio_set == NULL) | 5231 | if (mddev->bio_set == NULL) { |
5232 | mddev->bio_set = bioset_create(BIO_POOL_SIZE, 0); | 5232 | mddev->bio_set = bioset_create(BIO_POOL_SIZE, 0); |
5233 | if (!mddev->bio_set) | ||
5234 | return -ENOMEM; | ||
5235 | } | ||
5233 | 5236 | ||
5234 | spin_lock(&pers_lock); | 5237 | spin_lock(&pers_lock); |
5235 | pers = find_pers(mddev->level, mddev->clevel); | 5238 | pers = find_pers(mddev->level, mddev->clevel); |