Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1578378 > unrolled thread

[PATCH v1 3/5] md: fail if mddev->bio_set can't be created

Started byMing Lei <tom.leiming@gmail.com>
First post2017-02-10 12:00 +0100
Last post2017-02-13 14:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [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

#1578378 — [PATCH v1 3/5] md: fail if mddev->bio_set can't be created

FromMing Lei <tom.leiming@gmail.com>
Date2017-02-10 12:00 +0100
Subject[PATCH v1 3/5] md: fail if mddev->bio_set can't be created
Message-ID<t9h5M-2lX-15@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1579794

FromChristoph Hellwig <hch@infradead.org>
Date2017-02-13 14:50 +0100
Message-ID<tapaV-4mz-7@gated-at.bofh.it>
In reply to#1578378
Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

but this really needs to be patch 2 in this series.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web