public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blkmapd: Skip the SCSI ID if the data length is zero
@ 2015-07-12 23:57 Kinglong Mee
  2015-07-13  6:42 ` Christoph Hellwig
  0 siblings, 1 reply; 11+ messages in thread
From: Kinglong Mee @ 2015-07-12 23:57 UTC (permalink / raw)
  To: Steve Dickson, linux-nfs@vger.kernel.org; +Cc: Christoph Hellwig, kinglongmee

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

blkmapd must skip it, otherwise, some device will be treat as the above one.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 utils/blkmapd/device-inq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/blkmapd/device-inq.c b/utils/blkmapd/device-inq.c
index 6b56b67..57fe7a3 100644
--- a/utils/blkmapd/device-inq.c
+++ b/utils/blkmapd/device-inq.c
@@ -198,7 +198,7 @@ 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);
 
-		if ((dev_id->ids & 0xf) < current_id)
+		if ((dev_id->ids & 0xf) < current_id || !dev_id->len)
 			continue;
 		switch (dev_id->ids & 0xf) {
 			/* We process SCSI ID with four ID cases: 0, 1, 2 and 3.
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-07-14 18:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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             ` [PATCH v4] " Kinglong Mee
2015-07-14 14:54               ` Steve Dickson
2015-07-14 18:06               ` Steve Dickson
2015-07-14 14:35             ` [PATCH v3] " Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox