lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181214132115.21440-4-mironov.ivan@gmail.com>
Date:   Fri, 14 Dec 2018 18:21:12 +0500
From:   Ivan Mironov <mironov.ivan@...il.com>
To:     linux-scsi@...r.kernel.org, mironov.ivan@...il.com
Cc:     linux-kernel@...r.kernel.org, Don Brace <don.brace@...rosemi.com>,
        "James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        esc.storagedev@...rosemi.com
Subject: [PATCH 3/6] scsi: hpsa: Add/mask existing devices on rescan if visibility changes

Controller may be switched between RAID and HBA modes even without a
reboot.

When changing to HBA mode, it does some internal reset magic and
automatically removes any configured RAID arrays. Without this patch,
driver successfully detects disappearance of logical arrays, but does
not expose any physical disks.

Signed-off-by: Ivan Mironov <mironov.ivan@...il.com>
---
 drivers/scsi/hpsa.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index ee3d7c722a63..60f1f7949d8d 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -1541,6 +1541,14 @@ static inline int device_updated(struct hpsa_scsi_dev_t *dev1,
 	return 0;
 }
 
+static inline bool device_expose_changed(struct hpsa_scsi_dev_t *dev1,
+	struct hpsa_scsi_dev_t *dev2)
+{
+	if (dev1->expose_device != dev2->expose_device)
+		return true;
+	return false;
+}
+
 /* Find needle in haystack.  If exact match found, return DEVICE_SAME,
  * and return needle location in *index.  If scsi3addr matches, but not
  * vendor, model, serial num, etc. return DEVICE_CHANGED, and return needle
@@ -1569,6 +1577,8 @@ static int hpsa_scsi_find_entry(struct hpsa_scsi_dev_t *needle,
 			if (device_is_the_same(needle, haystack[i])) {
 				if (device_updated(needle, haystack[i]))
 					return DEVICE_UPDATED;
+				if (device_expose_changed(needle, haystack[i]))
+					return DEVICE_CHANGED;
 				return DEVICE_SAME;
 			} else {
 				/* Keep offline devices offline */
-- 
2.19.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ