[PATCH v3] blkmapd: Skip the SCSI ID if data length is zero

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In vmware linux, the iscsi device contains more than one SCSI ID, 
and the second one's data length is zero.

If there are two iSCSI devices with the second SCSI ID's data length
is zero, the first iSCSI device will record with an invalid SCSI ID
as zero length, the second one will be treat as the first one for
the SCSI ID is zero length too.

It means the only the first iSCSI device is exist in blkmapd's cache,
the request for the second iSCSI device will failed as,

"blkmapd: Could not find disk for device" and,
"bl_resolve_deviceid failed to decode device: 2".

v2, update commit log
v3, add a comment in the code

Signed-off-by: Kinglong Mee <kinglongmee@xxxxxxxxx>
---
 utils/blkmapd/device-inq.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/utils/blkmapd/device-inq.c b/utils/blkmapd/device-inq.c
index 6b56b67..60fe2d3 100644
--- a/utils/blkmapd/device-inq.c
+++ b/utils/blkmapd/device-inq.c
@@ -198,6 +198,10 @@ struct bl_serial *bldev_read_serial(int fd, const char *filename)
 		dev_id = (struct bl_dev_id *)&(dev_root->data[pos]);
 		pos += (dev_id->len + devid_len);
 
+		/* Needs an SCSI ID with unique date not zero length */
+		if (!dev_id->len)
+			continue;
+
 		if ((dev_id->ids & 0xf) < current_id)
 			continue;
 		switch (dev_id->ids & 0xf) {
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux