From: Kinglong Mee <kinglongmee@gmail.com>
To: Steve Dickson <SteveD@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
kinglongmee@gmail.com
Subject: [PATCH v4] blkmapd: Skip the SCSI ID if data length is zero
Date: Tue, 14 Jul 2015 22:11:19 +0800 [thread overview]
Message-ID: <55A51887.1050605@gmail.com> (raw)
In-Reply-To: <20150714071537.GB31117@infradead.org>
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>
---
utils/blkmapd/device-inq.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/utils/blkmapd/device-inq.c b/utils/blkmapd/device-inq.c
index 6b56b67..5c258bd 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 buggy targets (e.g. VMWare) 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) {
--
2.4.3
next prev parent reply other threads:[~2015-07-14 14:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-12 23:57 [PATCH] blkmapd: Skip the SCSI ID if the data length is zero Kinglong Mee
2015-07-13 6:42 ` Christoph Hellwig
2015-07-13 8:24 ` [PATCH v2] blkmapd: Skip the SCSI ID if " Kinglong Mee
2015-07-13 9:01 ` Christoph Hellwig
2015-07-13 9:11 ` Kinglong Mee
2015-07-13 9:59 ` [PATCH v3] " Kinglong Mee
2015-07-14 7:15 ` Christoph Hellwig
2015-07-14 14:11 ` Kinglong Mee [this message]
2015-07-14 14:54 ` [PATCH v4] " Steve Dickson
2015-07-14 18:06 ` Steve Dickson
2015-07-14 14:35 ` [PATCH v3] " Steve Dickson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55A51887.1050605@gmail.com \
--to=kinglongmee@gmail.com \
--cc=SteveD@redhat.com \
--cc=hch@infradead.org \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox