From 95c9e91a8a72165c5382efbfd2ac4736357af113 Mon Sep 17 00:00:00 2001 From: Shaohua Li Date: Thu, 19 Jan 2012 09:20:10 +0100 Subject: [PATCH] --- yaml --- r: 287550 b: refs/heads/master c: 05c30b9551f1904d9950ad0d28e65fc4ff3c8a8e h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/block/blk-core.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 0d57e80531c0..eb1888023700 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: df0793abb929e66606fa25f3875ff1b89de5ad32 +refs/heads/master: 05c30b9551f1904d9950ad0d28e65fc4ff3c8a8e diff --git a/trunk/block/blk-core.c b/trunk/block/blk-core.c index e6c05a97ee2b..636702575118 100644 --- a/trunk/block/blk-core.c +++ b/trunk/block/blk-core.c @@ -872,13 +872,15 @@ static struct request *get_request(struct request_queue *q, int rw_flags, spin_unlock_irq(q->queue_lock); /* create icq if missing */ - if (unlikely(et->icq_cache && !icq)) + if ((rw_flags & REQ_ELVPRIV) && unlikely(et->icq_cache && !icq)) { icq = ioc_create_icq(q, gfp_mask); + if (!icq) + goto fail_icq; + } - /* rqs are guaranteed to have icq on elv_set_request() if requested */ - if (likely(!et->icq_cache || icq)) - rq = blk_alloc_request(q, icq, rw_flags, gfp_mask); + rq = blk_alloc_request(q, icq, rw_flags, gfp_mask); +fail_icq: if (unlikely(!rq)) { /* * Allocation failed presumably due to memory. Undo anything