From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1311C4708F for ; Wed, 2 Jun 2021 15:19:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB41F613B1 for ; Wed, 2 Jun 2021 15:19:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232105AbhFBPVR (ORCPT ); Wed, 2 Jun 2021 11:21:17 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:60906 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232267AbhFBPU2 (ORCPT ); Wed, 2 Jun 2021 11:20:28 -0400 Received: from relay2.suse.de (unknown [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id D3F9033D21; Wed, 2 Jun 2021 15:18:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1622647124; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=DSGpUrJ/743MPuhxvT/nqi8w3p5GPMaeKeFBM44/gmo=; b=MdK4gYIAuzMyR2E4NvhFyziJMVS0Lz98HxeKXgkdNdpXwdetZdS/rJffcruMSrxpF6hChN ofeJSVSyGaDOGK2oA/vVezY1ktroIfUPP/WhxdIHRUGrm8yzyjpt+w6AyblAEkAPbjOV3B CI3cfLJ+HEswMRieUviEy4qA9pE6uC8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1622647124; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=DSGpUrJ/743MPuhxvT/nqi8w3p5GPMaeKeFBM44/gmo=; b=Pl3UpoZVohInFxwF79o5kXXnbcq7gN/B1oEeVjDou3PAyQk2wubz0Hc2j8d2pFEOYxkb/G FFVMuCPDjd6CSgCw== Received: by relay2.suse.de (Postfix, from userid 51) id D01DCA3E3C; Wed, 2 Jun 2021 16:03:44 +0000 (UTC) Received: from adalid.arch.suse.de (adalid.arch.suse.de [10.161.8.13]) by relay2.suse.de (Postfix) with ESMTP id 05B6AA548A; Wed, 2 Jun 2021 12:34:45 +0000 (UTC) Received: by adalid.arch.suse.de (Postfix, from userid 17828) id EB041516FAFD; Wed, 2 Jun 2021 14:34:44 +0200 (CEST) From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Daniel Wagner Subject: [PATCH] nvme: reset disk to the mpath node also when requeuing Date: Wed, 2 Jun 2021 14:34:29 +0200 Message-Id: <20210602123429.103935-1-dwagner@suse.de> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit ce86dad222e9 ("nvme-multipath: reset bdev to ns head when failover") moved the reset code where the bio is added to the requeue_list for the failover path. But it left the original bio_set_dev() in nvme_requeue_work(). Let's move the bio_set_dev() where we add the bio to the requeue_list and avoid the double setting in case of the failover path. And this makes the code more consistent. Signed-off-by: Daniel Wagner --- drivers/nvme/host/multipath.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index 127a17b4c13d..df07fc2ad7bc 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -324,6 +324,7 @@ static blk_qc_t nvme_ns_head_submit_bio(struct bio *bio) dev_warn_ratelimited(dev, "no usable path - requeuing I/O\n"); spin_lock_irq(&head->requeue_lock); + bio_set_dev(bio, head->disk->part0); bio_list_add(&head->requeue_list, bio); spin_unlock_irq(&head->requeue_lock); } else { @@ -435,11 +436,6 @@ static void nvme_requeue_work(struct work_struct *work) next = bio->bi_next; bio->bi_next = NULL; - /* - * Reset disk to the mpath node and resubmit to select a new - * path. - */ - bio_set_dev(bio, head->disk->part0); submit_bio_noacct(bio); } } -- 2.29.2