[PATCH] blkmapd: Skip the SCSI ID if the 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.

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

Signed-off-by: Kinglong Mee <kinglongmee@xxxxxxxxx>
---
 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

--
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