Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2972116yba; Mon, 22 Apr 2019 16:55:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBXwxKAXnRYyLVQnvZgwAfP+c8vfKJaIUEKhoPii7x6mbKxUounbXOXeuZsuaLgNgecqbQ X-Received: by 2002:a62:a219:: with SMTP id m25mr23534415pff.197.1555977349425; Mon, 22 Apr 2019 16:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555977349; cv=none; d=google.com; s=arc-20160816; b=0NXmI9fjwFGhOT4aPNvIZcpc63uzNPYnJeuqqZFgox3dFKsppbroT3wTbTFWxjha5e anRveKcbE/kw7OiIqwz4NcUTfxXm41YwdFNnKLx6TV2W9sx6ft2gKluGTm+ScjBBCPPi QO+1vsgFA4qPxRfe1CkqkkTvY+Vu8OTvvy3rGPDgEUDM1Jkzt80dicn72J6ftfi5Z/1w vj+atilH5COksQJCt/3OdiNDz2AmCI9q/zheLmycG4PGVPZ4PURuZivTn/hsoOW0ZBwR 68vJImFpibYCpJ/hRQefSRKjlF9p2R7qyFeYWVPDeE403S5r9ve+CMfvoX7jqQPCOQEo fF7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qHyyE6DIKZeMPdJK6gLjwhvJLpQy+MjGlwru8Ht2TWM=; b=g97Nr3nbq0+AFNTsB/9MwTG1MBq7Cg5ltdXviEnD6WJYJ7LnMUuPFpr0DUytFgms77 0pom7wwz2E7nJYZ4W+Xg4d33L1Jm++5J2pkbcQrtYmfR/6UIY7TmQJrA2iPT6FnBsqB8 kEEHWCKw0N4+jRWXJWbsm+gpFWnOUb3WfVgYLQcajFfanN83FP1Zqqfj+WkoPveQNPE9 mTgbpmSqaSkAOHOO02bOBPh3EViXyUbN2RtZ/2FlpD7Rp9yK0/mjF/QNMg5/t5ppiA/u CltBGK57UwNUj4cVb2Eo/ao3oyuluHSeFN04pZ5t/in4ewHHhmwkGWQ5psdI5jE60SqE xe8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qOLtcF17; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c3si14281963plo.243.2019.04.22.16.55.34; Mon, 22 Apr 2019 16:55:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qOLtcF17; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731911AbfDVUAf (ORCPT + 99 others); Mon, 22 Apr 2019 16:00:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:49962 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730217AbfDVTrP (ORCPT ); Mon, 22 Apr 2019 15:47:15 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C6B9321906; Mon, 22 Apr 2019 19:47:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555962434; bh=bHUgYP+U7nbcyYBqraeuudEMBgsZuclqOTqty8qukew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qOLtcF173dvG0TjnYgw8htkGKXLDNXTBgFev5+4nz2gWj1n+e4/wlZh96UP5AaOxE 57fEsMjBG3Onc7HA5malVPjTtS7pD5nxo1v+TGUP2Ryrpzo2eN23m06aTXGf0CHfR6 wrf8XmSgn5r3K2Q2R9i/koKeJVvjilc8CGlNHbcg= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Martin George , Gargi Srinivas , Hannes Reinecke , Christoph Hellwig , Sasha Levin , linux-nvme@lists.infradead.org Subject: [PATCH AUTOSEL 4.19 62/68] nvme-multipath: relax ANA state check Date: Mon, 22 Apr 2019 15:45:10 -0400 Message-Id: <20190422194516.11634-62-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190422194516.11634-1-sashal@kernel.org> References: <20190422194516.11634-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martin George [ 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 da8f5ad30c71..260248fbb8fe 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -349,15 +349,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