From patchwork Mon Feb 13 16:04:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Goldwyn Rodrigues X-Patchwork-Id: 9570199 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 47FD86045D for ; Mon, 13 Feb 2017 16:05:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CBD41FF29 for ; Mon, 13 Feb 2017 16:05:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31B2A2711E; Mon, 13 Feb 2017 16:05:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD1AF1FF29 for ; Mon, 13 Feb 2017 16:05:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752828AbdBMQFI (ORCPT ); Mon, 13 Feb 2017 11:05:08 -0500 Received: from mx2.suse.de ([195.135.220.15]:48203 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752770AbdBMQFH (ORCPT ); Mon, 13 Feb 2017 11:05:07 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CB010AB9A for ; Mon, 13 Feb 2017 16:05:05 +0000 (UTC) From: Goldwyn Rodrigues To: linux-block@vger.kernel.org Cc: Goldwyn Rodrigues Subject: [PATCH] blk-mq: Call bio_io_error if request returned is NULL Date: Mon, 13 Feb 2017 10:04:54 -0600 Message-Id: <20170213160454.30869-1-rgoldwyn@suse.de> X-Mailer: git-send-email 2.10.2 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Goldwyn Rodrigues If blk_mq_map_request returns NULL, bio_endio() function is not called. Call bio_io_error() in case request returned is NULL. Signed-off-by: Goldwyn Rodrigues --- block/blk-mq.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 81caceb..7cd8912 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1286,8 +1286,10 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) return BLK_QC_T_NONE; rq = blk_mq_map_request(q, bio, &data); - if (unlikely(!rq)) + if (unlikely(!rq)) { + bio_io_error(bio); return BLK_QC_T_NONE; + } cookie = blk_tag_to_qc_t(rq->tag, data.hctx->queue_num); @@ -1381,8 +1383,10 @@ static blk_qc_t blk_sq_make_request(struct request_queue *q, struct bio *bio) request_count = blk_plug_queued_count(q); rq = blk_mq_map_request(q, bio, &data); - if (unlikely(!rq)) + if (unlikely(!rq)) { + bio_io_error(bio); return BLK_QC_T_NONE; + } cookie = blk_tag_to_qc_t(rq->tag, data.hctx->queue_num);