Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2840002yba; Mon, 22 Apr 2019 14:03:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3s2JUv0F6zREHcKd/foqn5Z/qWo5na+SntNwZ1RjDwk9tUnj0Ub6lKprl3xsJXeHcBgO4 X-Received: by 2002:a63:c605:: with SMTP id w5mr20441760pgg.355.1555966991423; Mon, 22 Apr 2019 14:03:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555966991; cv=none; d=google.com; s=arc-20160816; b=ATLoPBVpjNPltiucuPDDcpLHd2wDMzjTej5wNYlEQJInzkhZHIx8vfWmWqSoyzY4sB YbAMmY3LDhz/gBnCbXpDR8z0HkGbQS9Bf9gkvcVxbxcsYZxQY8QtynA7pZ/ZVnSZoTmS 1S/fvioadJWkkOZYUyDdTRz4hPasmrfzwKYtT3236Ht0eIxLtquEM2dbqgrsLdZhkekI YMEXAphzWpKcGeHezOTfw8//m/v6LCCVLJoqJGQV1EGE/O5uudcz7jFN3mNwhiJ4lg3q qC5uWhkK+B/6iiXtEMuDHzdLJVmVKVXC4M0HfTYVt3lUcFCTEGzhs6pPjUCgJxWSXt9p QyZg== 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=T9/DUcTIeYCScP4xjTpIlcqx7O9YHxpYkJAHESMTjB8=; b=KKxlUzXWr9WHBVtcCJ+jmwZp9RUb6Nc+s3hxvuj3VVoFguxhlytSLamJ8SeGe1OR+a +RNToCKMlOkADed0lf3MAjrJ2T58y33ShSCPdhmgN7bDjFujtknsLDQkkG3bVkxtQm+m 8+LXZszg2vi9ZxvIv06bEzLpprtp/r7uS34e6GC65YxHpD5lFYO5QrixSKK1mX1jfZbv ULI6gDqbelk6qlDdQVrVSHHgVVtEEWWkbh4btN3uWn4wvAEvyklTq7xhp/1qHtv6h9LS tEF1EPdQ5zNXeid12p1S2jyU/0A92IwJgXxeWwJon702R1405nvY4nXzdVtCSRQdL2D2 fP1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kh2rEdQ1; 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 92si13628777pld.383.2019.04.22.14.02.55; Mon, 22 Apr 2019 14:03:11 -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=kh2rEdQ1; 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 S1729624AbfDVTo5 (ORCPT + 99 others); Mon, 22 Apr 2019 15:44:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:46266 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729612AbfDVTo4 (ORCPT ); Mon, 22 Apr 2019 15:44:56 -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 A9452218B0; Mon, 22 Apr 2019 19:44:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555962295; bh=auA7qvc7fCxnhXc78AYK6rx6+Cn/ERShntnbtiRRI/Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kh2rEdQ13KcW/y7QYpf+Kc03Uz+jg6gml1l663ZdREbyNAsFs3hD7V3B8UCwJbCDK JHZ3fDFA2P+HLz2bja0IH2Dug4bDCfejaTwnWiaSLO55zjCMZRTuZ4ibQQGvwt8kBp nFIEFfbXmTgmfUy/+J7RYUI0n0NczVIWPglVp/SM= 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 5.0 88/98] nvme-multipath: relax ANA state check Date: Mon, 22 Apr 2019 15:41:55 -0400 Message-Id: <20190422194205.10404-88-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190422194205.10404-1-sashal@kernel.org> References: <20190422194205.10404-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 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