Package: blktap / 2.0.90-3

fix-calling-io_setup.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Description: Fix failing to call io_setup with EINVAL
 Tapdisk fails to start and exit's silently after failing
 to detect current kernel version. This happens only on newer
 kernel versions missing sublevel field.

Author: Nanakos Chrysostomos <nanakos@wired-net.gr>
Bug-Debian: https://bugs.debian.org/760504


--- blktap-2.0.90.orig/drivers/tapdisk-utils.c
+++ blktap-2.0.90/drivers/tapdisk-utils.c
@@ -254,8 +254,12 @@ int tapdisk_linux_version(void)
 		return -errno;
 
 	n = sscanf(uts.release, "%u.%u.%u", &version, &patchlevel, &sublevel);
-	if (n != 3)
-		return -ENOSYS;
+	if (n != 3) {
+		n = sscanf(uts.release, "%u.%u", &version, &patchlevel);
+		if (n != 2)
+			return -ENOSYS;
+		sublevel = 0;
+	}
 
 	return KERNEL_VERSION(version, patchlevel, sublevel);
 }