Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3632854imu; Mon, 28 Jan 2019 08:09:43 -0800 (PST) X-Google-Smtp-Source: ALg8bN4Y87+OKqYlzYBEBOMMoxZEBI+MNyRQZrFkR/3Ur3QB241ZRqA7ic81S2R4JZTmMRCM/i1O X-Received: by 2002:a62:39cb:: with SMTP id u72mr22384329pfj.223.1548691783854; Mon, 28 Jan 2019 08:09:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548691783; cv=none; d=google.com; s=arc-20160816; b=dOpzoXpP4znX/3kASsFlWVCN6XsqiATOY+fSyO2qjqWcoWAsd8QwO1sHek/TBMvELN E7HS7JWA8at0KMkWUsNcFEYsoI9z0L2zfBd7j3xt1GNvUdExc/tJphaDkjhC9DY3sLux 8FFDxMSqVab+JwX/x+u9izt6xTkwLrZSNZb6mD5tZZKAZ+YPMBlwQ6dpM2VulYIC2LYw RPjf7jAs3CaAaePOwiB9uiP0Gd0I6qWo1/JqlYNVazxNPlEMCcMQ/Uby5gFvbZitl2L+ sELccNqIacksRevp3SmbhPWOqQpWiy1rQt4eSkRzfLgv1wYXxDDE0RQQ02zKWurItMz5 8O5g== 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=nQQjV5/g4atGYN6Y4pdu+YwwllrN8QxjFPVFOa/FcAU=; b=P5o9GwJihPxFh2BrtMTbUfecJE1vlVvMl0QLmBJnbRE9yH1pXUdvIPowkr2rAU27+Y IYCm8bFts9r6+DZJ3tgezKc7aMH7yM8rv6H/qDWkEvK155C591QmCoAVHeXwV6cNMlFb 916eylVWUh48w9g6kmOPkiVRTq7w8736AsUgyLX0g/iFXMxf8LyOH9fqT8THgx7SiEhT NuOi4FadRT6cKp8l7PdxnR6j10Ha35vgsueKzbaHBqd++XpAkQuDRh9Bj+jnTxEbNGbb n/khGDnVvOOq++8dO1wRwAHGpYbfJfMPfZJKTtcfNh5MKavGBKmth32tQLiXOcfBOBae 8Zjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HKvSw2ev; 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 u6si18390122pfb.92.2019.01.28.08.09.27; Mon, 28 Jan 2019 08:09:43 -0800 (PST) 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=HKvSw2ev; 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 S1731709AbfA1QI1 (ORCPT + 99 others); Mon, 28 Jan 2019 11:08:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:60174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730751AbfA1QIZ (ORCPT ); Mon, 28 Jan 2019 11:08:25 -0500 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 A4D4B2147A; Mon, 28 Jan 2019 16:08:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691704; bh=1GNSsI60a8mvqH9VimS34CW2kW3JPVzBAnvrcVg7Zso=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HKvSw2ev/bvgCy9qSIR0+AMJt4vuEq2thZImxs6NmxH9yTOkCMyeIjqpU5pxW40rs I4vUA3eaLNJxPRcDtmB7xcI/RKSntey3E0qfqy7tbzf59c3i3aUE8O729/knebmtC5 FaWRbINgBtpn3hT0UFqaVpfg1IOTtceEgoB2NPaw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dave Carroll , Don Brace , "Martin K . Petersen" , Sasha Levin , esc.storagedev@microsemi.com, linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 191/258] scsi: smartpqi: correct volume status Date: Mon, 28 Jan 2019 10:58:17 -0500 Message-Id: <20190128155924.51521-191-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 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: Dave Carroll [ Upstream commit 7ff44499bafbd376115f0bb6b578d980f56ee13b ] - fix race condition when a unit is deleted after an RLL, and before we have gotten the LV_STATUS page of the unit. - In this case we will get a standard inquiry, rather than the desired page. This will result in a unit presented which no longer exists. - If we ask for LV_STATUS, insure we get LV_STATUS Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Dave Carroll Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/smartpqi/smartpqi_init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 58eb0d31d8d9..3781e8109dd7 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -1184,6 +1184,9 @@ static void pqi_get_volume_status(struct pqi_ctrl_info *ctrl_info, if (rc) goto out; + if (vpd->page_code != CISS_VPD_LV_STATUS) + goto out; + page_length = offsetof(struct ciss_vpd_logical_volume_status, volume_status) + vpd->page_length; if (page_length < sizeof(*vpd)) -- 2.19.1