Blame SOURCES/nfs-utils-1.3.0-blkmapd-loop.patch

64c563
commit c6b8191374d9ad064eb96423400a6314c2d0102e
64c563
Author: Kinglong Mee <kinglongmee@gmail.com>
64c563
Date:   Tue Jun 30 14:12:38 2015 -0400
64c563
64c563
    blkmapd: Fix infinite loop when reading serial
64c563
    
64c563
    If (dev_id->ids & 0xf) < current_id, must updates pos when continue.
64c563
    Otherwise an infinite loop.
64c563
    
64c563
    No other places use the pos value, just move to the top of while.
64c563
    
64c563
    Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
64c563
    Signed-off-by: Steve Dickson <steved@redhat.com>
64c563
64c563
diff --git a/utils/blkmapd/device-inq.c b/utils/blkmapd/device-inq.c
64c563
index c5bf71f..6b56b67 100644
64c563
--- a/utils/blkmapd/device-inq.c
64c563
+++ b/utils/blkmapd/device-inq.c
64c563
@@ -196,6 +196,8 @@ struct bl_serial *bldev_read_serial(int fd, const char *filename)
64c563
 
64c563
 	while (pos < (len - devid_len)) {
64c563
 		dev_id = (struct bl_dev_id *)&(dev_root->data[pos]);
64c563
+		pos += (dev_id->len + devid_len);
64c563
+
64c563
 		if ((dev_id->ids & 0xf) < current_id)
64c563
 			continue;
64c563
 		switch (dev_id->ids & 0xf) {
64c563
@@ -226,7 +228,6 @@ struct bl_serial *bldev_read_serial(int fd, const char *filename)
64c563
 		}
64c563
 		if (current_id == 3)
64c563
 			break;
64c563
-		pos += (dev_id->len + devid_len);
64c563
 	}
64c563
  out:
64c563
 	if (!serial_out)