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=-9.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,T_DKIMWL_WL_HIGH,USER_AGENT_GIT autolearn=unavailable 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 6F2EDC43219 for ; Thu, 2 May 2019 15:34:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 324E020449 for ; Thu, 2 May 2019 15:34:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556811249; bh=BZ7m/WjVfm5vLO2WjcqXbMk+q18pxu9+ZouJHyseVis=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=1twZftEaUX11LrZcHn77EtoBb24zBZKPLakBH1uJAY/X2BJOVWw8uzuyR4XqtSw6d vQLhksJfmGKvZQToLIP/MedVBcEy9UF/6/p5+Q5Oy31yAiWnm4zUP8KuWT47gNrLv9 wrKndjlpgN0tinWgGvQAvP3H2AbIzJ9uthutxL/k= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729167AbfEBPc0 (ORCPT ); Thu, 2 May 2019 11:32:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:52008 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728705AbfEBPcZ (ORCPT ); Thu, 2 May 2019 11:32:25 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4ED1120675; Thu, 2 May 2019 15:32:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556811144; bh=BZ7m/WjVfm5vLO2WjcqXbMk+q18pxu9+ZouJHyseVis=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ADNanTN9OTpgrOK8QzMhz3CyGExlg+U+I8HwzVgwFtSUxot4ptXIjWZSpTIMrDnuO PMf0vnCt8pLibNC141dASYmo26RoPc4FxGI4ptI0q8BtnutzUPFPKq5v0+FcPOci5X mU2oWCq3Xy4RqEUff7wSRMZ0yCI42MIiAH4tWGh8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin George , Gargi Srinivas , Hannes Reinecke , Christoph Hellwig , "Sasha Levin (Microsoft)" Subject: [PATCH 5.0 091/101] nvme-multipath: relax ANA state check Date: Thu, 2 May 2019 17:21:33 +0200 Message-Id: <20190502143345.957245446@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190502143339.434882399@linuxfoundation.org> References: <20190502143339.434882399@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org [ Upstream commit cc2278c413c3a06a93c23ee8722e4dd3d621de12 ] When undergoing state transitions I/O might be requeued, hence we should always call nvme_mpath_set_live() to schedule requeue_work whenever the nvme device is live, independent on whether the old state was live or not. Signed-off-by: Martin George Signed-off-by: Gargi Srinivas Signed-off-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin (Microsoft) --- drivers/nvme/host/multipath.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index b9fff3b8ed1b..23da7beadd62 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -366,15 +366,12 @@ static inline bool nvme_state_is_live(enum nvme_ana_state state) static void nvme_update_ns_ana_state(struct nvme_ana_group_desc *desc, struct nvme_ns *ns) { - enum nvme_ana_state old; - mutex_lock(&ns->head->lock); - old = ns->ana_state; ns->ana_grpid = le32_to_cpu(desc->grpid); ns->ana_state = desc->state; clear_bit(NVME_NS_ANA_PENDING, &ns->flags); - if (nvme_state_is_live(ns->ana_state) && !nvme_state_is_live(old)) + if (nvme_state_is_live(ns->ana_state)) nvme_mpath_set_live(ns); mutex_unlock(&ns->head->lock); } -- 2.19.1