summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2015-07-14 14:03:33 -0400
committerSteve Dickson <steved@redhat.com>2015-07-14 14:04:45 -0400
commitb13027f442e3bbb5f52a1facaa486f36b6d4d751 (patch)
tree95518f5e2e6794e0944ba6eb049ca9afce9526d4
parent2f8a60200f4cc599bb421eb22de3212488d28701 (diff)
downloadnfs-utils-b13027f442e3bbb5f52a1facaa486f36b6d4d751.tar.gz
nfs-utils-b13027f442e3bbb5f52a1facaa486f36b6d4d751.tar.xz
nfs-utils-b13027f442e3bbb5f52a1facaa486f36b6d4d751.zip
blkmapd: Skip the SCSI ID if data length is zero
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 comments v3, add a comment in the code v4, update comment as Christoph's suggestion Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--utils/blkmapd/device-inq.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/utils/blkmapd/device-inq.c b/utils/blkmapd/device-inq.c
index 6b56b67..0062a8f 100644
--- a/utils/blkmapd/device-inq.c
+++ b/utils/blkmapd/device-inq.c
@@ -198,6 +198,13 @@ 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);
+ /* Some targets export zero length EVPD pages,
+ * skip them to not confuse the device id
+ * cache.
+ */
+ if (!dev_id->len)
+ continue;
+
if ((dev_id->ids & 0xf) < current_id)
continue;
switch (dev_id->ids & 0xf) {