Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp662629pxj; Wed, 2 Jun 2021 08:22:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnoS2YAXgO0Eo8nAEasbUUC7CMUFHuXoDYT1uHX+ww3bnPaDNYYitykwnw+Fbv4rH7z6pH X-Received: by 2002:aa7:c787:: with SMTP id n7mr39090459eds.309.1622647332840; Wed, 02 Jun 2021 08:22:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622647332; cv=none; d=google.com; s=arc-20160816; b=X1el4MWqPa9iKk/jRbLIJcD+G9ztOWwhVRR0YqDL+sMxsaPTELJI0ZZ+MZtODqpIrv h+Lbx7wgzSNvsqxGjqKblzvXuP5Ia8KeRnXpupF0lOcWU5XxWeQEh31ZNsdn5b6Oqdri DcLzHMaehWccpUswLge547wuUEcIh/NK04skdQpTuzwJzg9m6Hx5aRvycKTujzjoBr9w kGAly1c77t+uVcy7w3d3v9Q3a/hvpSwaDoRpZ6m1KbHP6qhNcAdbb+Zxvxzr9Bp8dPvk cfJq4DLqi7bFZEDH73qCB8JTWi61FMLHx7LDljvcGjMMd5dIxU/jdcWSb2+sdJIds23b uVIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=DSGpUrJ/743MPuhxvT/nqi8w3p5GPMaeKeFBM44/gmo=; b=dXbQfc8x/CMKHV2eHsuPcZQ19Q4ADqmJT8dA5t8OaEXBSie+hM19AjiokkiUKuI80p F7Io8PDkP6BdOcuvXWJdO18wOel0ChT9DEiJL3qdtkqFQLNUeScOmKqcirF0z0DUD35F 6OPbS2axUHC2N/GIFyTHOGrBhDo9U2+aL8Ql+eNM5ucQpofCNlFyLHKLODITegawwmoK Q026h5/pKQCOA3AcOx9Gic+WIWGsmK4k8JeD61cBk/jL0XL9FgnkiVVYzaPiMxogV7oA 1sX9qp+PdOYhgIesNq4MAXZkDxbVZFTUKaxoxUZCitSV8OtCZLQ6JNiGVthxs0As1Fza 39Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=MdK4gYIA; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=Pl3UpoZV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l16si138256ejd.23.2021.06.02.08.21.48; Wed, 02 Jun 2021 08:22:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=MdK4gYIA; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=Pl3UpoZV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232344AbhFBPVN (ORCPT + 99 others); Wed, 2 Jun 2021 11:21:13 -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