Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1578378
| From | Ming Lei <tom.leiming@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v1 3/5] md: fail if mddev->bio_set can't be created |
| Date | 2017-02-10 12:00 +0100 |
| Message-ID | <t9h5M-2lX-15@gated-at.bofh.it> (permalink) |
| References | <t9h5M-2lX-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
drivers/md/md.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 4c1b82defa78..3425c2b779a6 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5270,8 +5270,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);
--
2.7.4
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH v1 3/5] md: fail if mddev->bio_set can't be created Ming Lei <tom.leiming@gmail.com> - 2017-02-10 12:00 +0100 Re: [PATCH v1 3/5] md: fail if mddev->bio_set can't be created Christoph Hellwig <hch@infradead.org> - 2017-02-13 14:50 +0100
csiph-web