From patchwork Wed Dec 27 03:22:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Snitzer X-Patchwork-Id: 10133347 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 7D4876023A for ; Wed, 27 Dec 2017 03:23:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 708FA2DB5B for ; Wed, 27 Dec 2017 03:23:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6524B2DB66; Wed, 27 Dec 2017 03:23: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 22DD62DB5B for ; Wed, 27 Dec 2017 03:23:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751320AbdL0DXJ (ORCPT ); Tue, 26 Dec 2017 22:23:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50772 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751225AbdL0DXI (ORCPT ); Tue, 26 Dec 2017 22:23:08 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9795D4E909; Wed, 27 Dec 2017 03:23:08 +0000 (UTC) Received: from localhost (ovpn-112-18.rdu2.redhat.com [10.10.112.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 94E0D600CC; Wed, 27 Dec 2017 03:23:05 +0000 (UTC) From: Mike Snitzer To: axboe@kernel.dk, hch@lst.de, keith.busch@intel.com Cc: emilne@redhat.com, james.smart@broadcom.com, hare@suse.de, Bart.VanAssche@wdc.com, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, dm-devel@redhat.com Subject: [for-4.16 PATCH v2 1/5] block: establish request failover callback Date: Tue, 26 Dec 2017 22:22:53 -0500 Message-Id: <20171227032257.8182-2-snitzer@redhat.com> In-Reply-To: <20171227032257.8182-1-snitzer@redhat.com> References: <20171227032257.8182-1-snitzer@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 27 Dec 2017 03:23:08 +0000 (UTC) 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 All requests allocated from a request_queue with this callback set can failover their requests during completion. This callback is expected to use the blk_steal_bios() interface to transfer a request's bios back to an upper-layer bio-based request_queue. This will be used by both NVMe multipath and DM multipath. Without it DM multipath cannot get access to NVMe-specific error handling that NVMe core provides in nvme_complete_rq(). Signed-off-by: Mike Snitzer --- include/linux/blkdev.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 8089ca17db9a..f45f5925e100 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -278,6 +278,7 @@ typedef int (lld_busy_fn) (struct request_queue *q); typedef int (bsg_job_fn) (struct bsg_job *); typedef int (init_rq_fn)(struct request_queue *, struct request *, gfp_t); typedef void (exit_rq_fn)(struct request_queue *, struct request *); +typedef void (failover_rq_fn)(struct request *); enum blk_eh_timer_return { BLK_EH_NOT_HANDLED, @@ -423,6 +424,11 @@ struct request_queue { exit_rq_fn *exit_rq_fn; /* Called from inside blk_get_request() */ void (*initialize_rq_fn)(struct request *rq); + /* + * Callback to failover request's bios back to upper layer + * bio-based request_queue using blk_steal_bios(). + */ + failover_rq_fn *failover_rq_fn; const struct blk_mq_ops *mq_ops;