diff options
author | Tejun Heo <tj@kernel.org> | 2009-04-15 15:10:27 +0200 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-04-22 08:35:10 +0200 |
commit | a9e9dc24bbc3e084450a22cf4fb82f5f5d4cbeea (patch) | |
tree | c6d18d969b76f61ebbfa777caf2706af5873a98f /fs/bio.c | |
parent | bio: fix bio_kmalloc() (diff) | |
download | linux-a9e9dc24bbc3e084450a22cf4fb82f5f5d4cbeea.tar.xz linux-a9e9dc24bbc3e084450a22cf4fb82f5f5d4cbeea.zip |
bio: use bio_kmalloc() in copy/map functions
Impact: remove possible deadlock condition
There is no reason to use mempool backed allocation for map functions.
Also, because kern mapping is used inside LLDs (e.g. for EH), using
mempool backed allocation can lead to deadlock under extreme
conditions (mempool already consumed by the time a request reached EH
and requests are blocked on EH).
Switch copy/map functions to bio_kmalloc().
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs/bio.c')
-rw-r--r-- | fs/bio.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -822,7 +822,7 @@ struct bio *bio_copy_user_iov(struct request_queue *q, return ERR_PTR(-ENOMEM); ret = -ENOMEM; - bio = bio_alloc(gfp_mask, nr_pages); + bio = bio_kmalloc(gfp_mask, nr_pages); if (!bio) goto out_bmd; @@ -946,7 +946,7 @@ static struct bio *__bio_map_user_iov(struct request_queue *q, if (!nr_pages) return ERR_PTR(-EINVAL); - bio = bio_alloc(gfp_mask, nr_pages); + bio = bio_kmalloc(gfp_mask, nr_pages); if (!bio) return ERR_PTR(-ENOMEM); @@ -1130,7 +1130,7 @@ static struct bio *__bio_map_kern(struct request_queue *q, void *data, int offset, i; struct bio *bio; - bio = bio_alloc(gfp_mask, nr_pages); + bio = bio_kmalloc(gfp_mask, nr_pages); if (!bio) return ERR_PTR(-ENOMEM); |