0b5e55
diff -up util-linux-2.23.2/libblkid/src/blkidP.h.kzak util-linux-2.23.2/libblkid/src/blkidP.h
0b5e55
--- util-linux-2.23.2/libblkid/src/blkidP.h.kzak	2014-03-28 15:11:18.334283704 +0100
0b5e55
+++ util-linux-2.23.2/libblkid/src/blkidP.h	2014-03-28 15:11:44.676551975 +0100
0b5e55
@@ -297,6 +297,9 @@ struct blkid_struct_cache
0b5e55
 /* old systems */
0b5e55
 #define BLKID_CACHE_FILE_OLD	"/etc/blkid.tab"
0b5e55
 
0b5e55
+#define BLKID_PROBE_OK	 0
0b5e55
+#define BLKID_PROBE_NONE 1
0b5e55
+
0b5e55
 #define BLKID_ERR_IO	 5
0b5e55
 #define BLKID_ERR_PROC	 9
0b5e55
 #define BLKID_ERR_MEM	12
0b5e55
diff -up util-linux-2.23.2/libblkid/src/partitions/aix.c.kzak util-linux-2.23.2/libblkid/src/partitions/aix.c
0b5e55
--- util-linux-2.23.2/libblkid/src/partitions/aix.c.kzak	2013-05-30 15:21:43.120591308 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/partitions/aix.c	2014-03-28 15:11:44.676551975 +0100
0b5e55
@@ -22,19 +22,17 @@ static int probe_aix_pt(blkid_probe pr,
0b5e55
 
0b5e55
 	if (blkid_partitions_need_typeonly(pr))
0b5e55
 		/* caller does not ask for details about partitions */
0b5e55
-		return 0;
0b5e55
+		return BLKID_PROBE_OK;
0b5e55
 
0b5e55
 	ls = blkid_probe_get_partlist(pr);
0b5e55
 	if (!ls)
0b5e55
-		goto err;
0b5e55
+		return BLKID_PROBE_NONE;
0b5e55
 
0b5e55
 	tab = blkid_partlist_new_parttable(ls, "aix", 0);
0b5e55
 	if (!tab)
0b5e55
-		goto err;
0b5e55
+		return -ENOMEM;
0b5e55
 
0b5e55
-	return 0;
0b5e55
-err:
0b5e55
-	return -1;
0b5e55
+	return BLKID_PROBE_OK;
0b5e55
 }
0b5e55
 
0b5e55
 /*
0b5e55
diff -up util-linux-2.23.2/libblkid/src/partitions/bsd.c.kzak util-linux-2.23.2/libblkid/src/partitions/bsd.c
0b5e55
--- util-linux-2.23.2/libblkid/src/partitions/bsd.c.kzak	2013-07-15 10:25:46.283049056 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/partitions/bsd.c	2014-03-28 15:11:44.677551986 +0100
0b5e55
@@ -113,20 +113,24 @@ static int probe_bsd_pt(blkid_probe pr,
0b5e55
 	blkid_partlist ls;
0b5e55
 	int i, nparts = BSD_MAXPARTITIONS;
0b5e55
 	unsigned char *data;
0b5e55
+	int rc = BLKID_PROBE_NONE;
0b5e55
 
0b5e55
 	if (blkid_partitions_need_typeonly(pr))
0b5e55
 		/* caller does not ask for details about partitions */
0b5e55
-		return 0;
0b5e55
+		return rc;
0b5e55
 
0b5e55
 	data = blkid_probe_get_sector(pr, BLKID_MAG_SECTOR(mag));
0b5e55
-	if (!data)
0b5e55
+	if (!data) {
0b5e55
+		if (errno)
0b5e55
+			rc = -errno;
0b5e55
 		goto nothing;
0b5e55
+	}
0b5e55
 
0b5e55
 	l = (struct bsd_disklabel *) data + BLKID_MAG_LASTOFFSET(mag);
0b5e55
 
0b5e55
 	ls = blkid_probe_get_partlist(pr);
0b5e55
 	if (!ls)
0b5e55
-		goto err;
0b5e55
+		goto nothing;
0b5e55
 
0b5e55
 	/* try to determine the real type of BSD system according to
0b5e55
 	 * (parental) primary partition */
0b5e55
@@ -152,8 +156,10 @@ static int probe_bsd_pt(blkid_probe pr,
0b5e55
 	}
0b5e55
 
0b5e55
 	tab = blkid_partlist_new_parttable(ls, name, BLKID_MAG_OFFSET(mag));
0b5e55
-	if (!tab)
0b5e55
-		goto err;
0b5e55
+	if (!tab) {
0b5e55
+		rc = -ENOMEM;
0b5e55
+		goto nothing;
0b5e55
+	}
0b5e55
 
0b5e55
 	if (le16_to_cpu(l->d_npartitions) < BSD_MAXPARTITIONS)
0b5e55
 		nparts = le16_to_cpu(l->d_npartitions);
0b5e55
@@ -189,18 +195,18 @@ static int probe_bsd_pt(blkid_probe pr,
0b5e55
 		}
0b5e55
 
0b5e55
 		par = blkid_partlist_add_partition(ls, tab, start, size);
0b5e55
-		if (!par)
0b5e55
-			goto err;
0b5e55
+		if (!par) {
0b5e55
+			rc = -ENOMEM;
0b5e55
+			goto nothing;
0b5e55
+		}
0b5e55
 
0b5e55
 		blkid_partition_set_type(par, p->p_fstype);
0b5e55
 	}
0b5e55
 
0b5e55
-	return 0;
0b5e55
+	return BLKID_PROBE_OK;
0b5e55
 
0b5e55
 nothing:
0b5e55
-	return 1;
0b5e55
-err:
0b5e55
-	return -1;
0b5e55
+	return rc;
0b5e55
 }
0b5e55
 
0b5e55
 
0b5e55
diff -up util-linux-2.23.2/libblkid/src/partitions/dos.c.kzak util-linux-2.23.2/libblkid/src/partitions/dos.c
0b5e55
--- util-linux-2.23.2/libblkid/src/partitions/dos.c.kzak	2013-07-30 10:39:26.205738229 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/partitions/dos.c	2014-03-28 15:13:23.220555797 +0100
0b5e55
@@ -53,10 +53,13 @@ static int parse_dos_extended(blkid_prob
0b5e55
 		uint32_t start, size;
0b5e55
 
0b5e55
 		if (++ct_nodata > 100)
0b5e55
-			return 0;
0b5e55
+			return BLKID_PROBE_OK;
0b5e55
 		data = blkid_probe_get_sector(pr, cur_start);
0b5e55
-		if (!data)
0b5e55
+		if (!data) {
0b5e55
+			if (errno)
0b5e55
+				return -errno;
0b5e55
 			goto leave;	/* malformed partition? */
0b5e55
+		}
0b5e55
 
0b5e55
 		if (!is_valid_mbr_signature(data))
0b5e55
 			goto leave;
0b5e55
@@ -99,7 +102,7 @@ static int parse_dos_extended(blkid_prob
0b5e55
 
0b5e55
 			par = blkid_partlist_add_partition(ls, tab, abs_start, size);
0b5e55
 			if (!par)
0b5e55
-				goto err;
0b5e55
+				return -ENOMEM;
0b5e55
 
0b5e55
 			blkid_partition_set_type(par, p->sys_type);
0b5e55
 			blkid_partition_set_flags(par, p->boot_ind);
0b5e55
@@ -123,9 +126,7 @@ static int parse_dos_extended(blkid_prob
0b5e55
 		cur_size = size;
0b5e55
 	}
0b5e55
 leave:
0b5e55
-	return 0;
0b5e55
-err:
0b5e55
-	return -1;
0b5e55
+	return BLKID_PROBE_OK;
0b5e55
 }
0b5e55
 
0b5e55
 static int probe_dos_pt(blkid_probe pr,
0b5e55
@@ -140,8 +141,11 @@ static int probe_dos_pt(blkid_probe pr,
0b5e55
 	uint32_t start, size, id;
0b5e55
 
0b5e55
 	data = blkid_probe_get_sector(pr, 0);
0b5e55
-	if (!data)
0b5e55
+	if (!data) {
0b5e55
+		if (errno)
0b5e55
+			return -errno;
0b5e55
 		goto nothing;
0b5e55
+	}
0b5e55
 
0b5e55
 	/* ignore disks with AIX magic number -- for more details see aix.c */
0b5e55
 	if (memcmp(data, BLKID_AIX_MAGIC_STRING, BLKID_AIX_MAGIC_STRLEN) == 0)
0b5e55
@@ -152,7 +156,7 @@ static int probe_dos_pt(blkid_probe pr,
0b5e55
 	 * either the boot sector of a FAT filesystem or a DOS-type
0b5e55
 	 * partition table.
0b5e55
 	 */
0b5e55
-	if (blkid_probe_is_vfat(pr)) {
0b5e55
+	if (blkid_probe_is_vfat(pr) == 1) {
0b5e55
 		DBG(LOWPROBE, blkid_debug("probably FAT -- ignore"));
0b5e55
 		goto nothing;
0b5e55
 	}
0b5e55
@@ -189,6 +193,8 @@ static int probe_dos_pt(blkid_probe pr,
0b5e55
 		return 0;
0b5e55
 
0b5e55
 	ls = blkid_probe_get_partlist(pr);
0b5e55
+	if (!ls)
0b5e55
+		goto nothing;
0b5e55
 
0b5e55
 	/* sector size factor (the start and size are in the real sectors, but
0b5e55
 	 * we need to convert all sizes to 512 logical sectors
0b5e55
@@ -198,7 +204,7 @@ static int probe_dos_pt(blkid_probe pr,
0b5e55
 	/* allocate a new partition table */
0b5e55
 	tab = blkid_partlist_new_parttable(ls, "dos", BLKID_MSDOS_PT_OFFSET);
0b5e55
 	if (!tab)
0b5e55
-		goto err;
0b5e55
+		return -ENOMEM;
0b5e55
 
0b5e55
 	id = dos_parttable_id(data);
0b5e55
 	if (id) {
0b5e55
@@ -224,7 +230,7 @@ static int probe_dos_pt(blkid_probe pr,
0b5e55
 		}
0b5e55
 		par = blkid_partlist_add_partition(ls, tab, start, size);
0b5e55
 		if (!par)
0b5e55
-			goto err;
0b5e55
+			return -ENOMEM;
0b5e55
 
0b5e55
 		blkid_partition_set_type(par, p->sys_type);
0b5e55
 		blkid_partition_set_flags(par, p->boot_ind);
0b5e55
@@ -244,13 +250,14 @@ static int probe_dos_pt(blkid_probe pr,
0b5e55
 			continue;
0b5e55
 		if (is_extended(p) &&
0b5e55
 		    parse_dos_extended(pr, tab, start, size, ssf) == -1)
0b5e55
-			goto err;
0b5e55
+			goto nothing;
0b5e55
 	}
0b5e55
 
0b5e55
 	/* Parse subtypes (nested partitions) on large disks */
0b5e55
 	if (!blkid_probe_is_tiny(pr)) {
0b5e55
 		for (p = p0, i = 0; i < 4; i++, p++) {
0b5e55
 			size_t n;
0b5e55
+			int rc;
0b5e55
 
0b5e55
 			if (!dos_partition_size(p) || is_extended(p))
0b5e55
 				continue;
0b5e55
@@ -259,20 +266,19 @@ static int probe_dos_pt(blkid_probe pr,
0b5e55
 				if (dos_nested[n].type != p->sys_type)
0b5e55
 					continue;
0b5e55
 
0b5e55
-				if (blkid_partitions_do_subprobe(pr,
0b5e55
+				rc = blkid_partitions_do_subprobe(pr,
0b5e55
 						blkid_partlist_get_partition(ls, i),
0b5e55
-						dos_nested[n].id) == -1)
0b5e55
-					goto err;
0b5e55
+						dos_nested[n].id);
0b5e55
+				if (rc < 0)
0b5e55
+					return rc;
0b5e55
 				break;
0b5e55
 			}
0b5e55
 		}
0b5e55
 	}
0b5e55
-	return 0;
0b5e55
+	return BLKID_PROBE_OK;
0b5e55
 
0b5e55
 nothing:
0b5e55
-	return 1;
0b5e55
-err:
0b5e55
-	return -1;
0b5e55
+	return BLKID_PROBE_NONE;
0b5e55
 }
0b5e55
 
0b5e55
 
0b5e55
diff -up util-linux-2.23.2/libblkid/src/partitions/gpt.c.kzak util-linux-2.23.2/libblkid/src/partitions/gpt.c
0b5e55
--- util-linux-2.23.2/libblkid/src/partitions/gpt.c.kzak	2014-03-28 15:11:18.336283724 +0100
0b5e55
+++ util-linux-2.23.2/libblkid/src/partitions/gpt.c	2014-03-28 15:11:44.677551986 +0100
0b5e55
@@ -169,8 +169,11 @@ static int is_pmbr_valid(blkid_probe pr,
0b5e55
 		goto ok;			/* skip PMBR check */
0b5e55
 
0b5e55
 	data = blkid_probe_get_sector(pr, 0);
0b5e55
-	if (!data)
0b5e55
+	if (!data) {
0b5e55
+		if (errno)
0b5e55
+			return -errno;
0b5e55
 		goto failed;
0b5e55
+	}
0b5e55
 
0b5e55
 	if (!is_valid_mbr_signature(data))
0b5e55
 		goto failed;
0b5e55
@@ -305,19 +308,27 @@ static int probe_gpt_pt(blkid_probe pr,
0b5e55
 	uint64_t fu, lu;
0b5e55
 	uint32_t ssf, i;
0b5e55
 	efi_guid_t guid;
0b5e55
+	int ret;
0b5e55
 
0b5e55
 	if (last_lba(pr, &lastlba))
0b5e55
 		goto nothing;
0b5e55
 
0b5e55
-	if (!is_pmbr_valid(pr, NULL))
0b5e55
+	ret = is_pmbr_valid(pr, NULL);
0b5e55
+	if (ret < 0)
0b5e55
+		return ret;
0b5e55
+	else if (ret == 0)
0b5e55
 		goto nothing;
0b5e55
 
0b5e55
+	errno = 0;
0b5e55
 	h = get_gpt_header(pr, &hdr, &e, (lba = GPT_PRIMARY_LBA), lastlba);
0b5e55
-	if (!h)
0b5e55
+	if (!h && !errno)
0b5e55
 		h = get_gpt_header(pr, &hdr, &e, (lba = lastlba), lastlba);
0b5e55
 
0b5e55
-	if (!h)
0b5e55
+	if (!h) {
0b5e55
+		if (errno)
0b5e55
+			return -errno;
0b5e55
 		goto nothing;
0b5e55
+	}
0b5e55
 
0b5e55
 	blkid_probe_use_wiper(pr, lba * blkid_probe_get_size(pr), 8);
0b5e55
 
0b5e55
@@ -388,12 +399,13 @@ static int probe_gpt_pt(blkid_probe pr,
0b5e55
 		blkid_partition_set_flags(par, e->attributes);
0b5e55
 	}
0b5e55
 
0b5e55
-	return 0;
0b5e55
+	return BLKID_PROBE_OK;
0b5e55
 
0b5e55
 nothing:
0b5e55
-	return 1;
0b5e55
+	return BLKID_PROBE_NONE;
0b5e55
+
0b5e55
 err:
0b5e55
-	return -1;
0b5e55
+	return -ENOMEM;
0b5e55
 }
0b5e55
 
0b5e55
 
0b5e55
diff -up util-linux-2.23.2/libblkid/src/partitions/mac.c.kzak util-linux-2.23.2/libblkid/src/partitions/mac.c
0b5e55
--- util-linux-2.23.2/libblkid/src/partitions/mac.c.kzak	2013-06-13 09:46:10.418650605 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/partitions/mac.c	2014-03-28 15:11:44.677551986 +0100
0b5e55
@@ -87,8 +87,11 @@ static int probe_mac_pt(blkid_probe pr,
0b5e55
 	 * the first block on the disk.
0b5e55
 	 */
0b5e55
 	md = (struct mac_driver_desc *) blkid_probe_get_sector(pr, 0);
0b5e55
-	if (!md)
0b5e55
+	if (!md) {
0b5e55
+		if (errno)
0b5e55
+			return -errno;
0b5e55
 		goto nothing;
0b5e55
+	}
0b5e55
 
0b5e55
 	block_size = be16_to_cpu(md->block_size);
0b5e55
 
0b5e55
@@ -96,8 +99,11 @@ static int probe_mac_pt(blkid_probe pr,
0b5e55
 	 * the second block on the disk.
0b5e55
 	 */
0b5e55
 	p = (struct mac_partition *) get_mac_block(pr, block_size, 1);
0b5e55
-	if (!p)
0b5e55
+	if (!p) {
0b5e55
+		if (errno)
0b5e55
+			return -errno;
0b5e55
 		goto nothing;
0b5e55
+	}
0b5e55
 
0b5e55
 	/* check the first partition signature */
0b5e55
 	if (!has_part_signature(p))
0b5e55
@@ -109,7 +115,7 @@ static int probe_mac_pt(blkid_probe pr,
0b5e55
 
0b5e55
 	ls = blkid_probe_get_partlist(pr);
0b5e55
 	if (!ls)
0b5e55
-		goto err;
0b5e55
+		goto nothing;
0b5e55
 
0b5e55
 	tab = blkid_partlist_new_parttable(ls, "mac", 0);
0b5e55
 	if (!tab)
0b5e55
@@ -124,15 +130,18 @@ static int probe_mac_pt(blkid_probe pr,
0b5e55
 		uint32_t size;
0b5e55
 
0b5e55
 		p = (struct mac_partition *) get_mac_block(pr, block_size, i);
0b5e55
-		if (!p)
0b5e55
+		if (!p) {
0b5e55
+			if (errno)
0b5e55
+				return -errno;
0b5e55
 			goto nothing;
0b5e55
+		}
0b5e55
 		if (!has_part_signature(p))
0b5e55
 			goto nothing;
0b5e55
 
0b5e55
 		if (be32_to_cpu(p->map_count) != nblks) {
0b5e55
 			DBG(LOWPROBE, blkid_debug(
0b5e55
 				"mac: inconsisten map_count in partition map, "
0b5e55
-			        "entry[0]: %d, entry[%d]: %d",
0b5e55
+				"entry[0]: %d, entry[%d]: %d",
0b5e55
 				nblks, i - 1,
0b5e55
 				be32_to_cpu(p->map_count)));
0b5e55
 		}
0b5e55
@@ -157,12 +166,12 @@ static int probe_mac_pt(blkid_probe pr,
0b5e55
 						sizeof(p->type));
0b5e55
 	}
0b5e55
 
0b5e55
-	return 0;
0b5e55
+	return BLKID_PROBE_OK;
0b5e55
 
0b5e55
 nothing:
0b5e55
-	return 1;
0b5e55
+	return BLKID_PROBE_NONE;
0b5e55
 err:
0b5e55
-	return -1;
0b5e55
+	return -ENOMEM;
0b5e55
 }
0b5e55
 
0b5e55
 /*
0b5e55
diff -up util-linux-2.23.2/libblkid/src/partitions/minix.c.kzak util-linux-2.23.2/libblkid/src/partitions/minix.c
0b5e55
--- util-linux-2.23.2/libblkid/src/partitions/minix.c.kzak	2013-07-15 10:25:46.284049064 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/partitions/minix.c	2014-03-28 15:36:23.866715100 +0100
0b5e55
@@ -26,12 +26,15 @@ static int probe_minix_pt(blkid_probe pr
0b5e55
 	int i;
0b5e55
 
0b5e55
 	data = blkid_probe_get_sector(pr, 0);
0b5e55
-	if (!data)
0b5e55
+	if (!data) {
0b5e55
+		if (errno)
0b5e55
+			return -errno;
0b5e55
 		goto nothing;
0b5e55
+	}
0b5e55
 
0b5e55
 	ls = blkid_probe_get_partlist(pr);
0b5e55
 	if (!ls)
0b5e55
-		goto err;
0b5e55
+		goto nothing;
0b5e55
 
0b5e55
 	/* Parent is required, because Minix uses the same PT as DOS and
0b5e55
 	 * difference is only in primary partition (parent) type.
0b5e55
@@ -78,12 +81,12 @@ static int probe_minix_pt(blkid_probe pr
0b5e55
 		blkid_partition_set_flags(par, p->boot_ind);
0b5e55
 	}
0b5e55
 
0b5e55
-	return 0;
0b5e55
+	return BLKID_PROBE_OK;
0b5e55
 
0b5e55
 nothing:
0b5e55
-	return 1;
0b5e55
+	return BLKID_PROBE_NONE;
0b5e55
 err:
0b5e55
-	return -1;
0b5e55
+	return -ENOMEM;
0b5e55
 }
0b5e55
 
0b5e55
 /* same as DOS */
0b5e55
diff -up util-linux-2.23.2/libblkid/src/partitions/partitions.c.kzak util-linux-2.23.2/libblkid/src/partitions/partitions.c
0b5e55
--- util-linux-2.23.2/libblkid/src/partitions/partitions.c.kzak	2014-03-28 15:11:18.336283724 +0100
0b5e55
+++ util-linux-2.23.2/libblkid/src/partitions/partitions.c	2014-03-28 15:12:28.036993622 +0100
0b5e55
@@ -533,12 +533,13 @@ static int idinfo_probe(blkid_probe pr,
0b5e55
 {
0b5e55
 	const struct blkid_idmag *mag = NULL;
0b5e55
 	blkid_loff_t off;
0b5e55
-	int rc = 1;		/* = nothing detected */
0b5e55
+	int rc = BLKID_PROBE_NONE;		/* = nothing detected */
0b5e55
 
0b5e55
 	if (pr->size <= 0 || (id->minsz && id->minsz > pr->size))
0b5e55
 		goto nothing;	/* the device is too small */
0b5e55
 
0b5e55
-	if (blkid_probe_get_idmag(pr, id, &off, &mag))
0b5e55
+	rc = blkid_probe_get_idmag(pr, id, &off, &mag;;
0b5e55
+	if (rc != BLKID_PROBE_OK)
0b5e55
 		goto nothing;
0b5e55
 
0b5e55
 	/* final check by probing function */
0b5e55
@@ -546,14 +547,15 @@ static int idinfo_probe(blkid_probe pr,
0b5e55
 		DBG(LOWPROBE, blkid_debug(
0b5e55
 			"%s: ---> call probefunc()", id->name));
0b5e55
 		rc = id->probefunc(pr, mag);
0b5e55
-	        if (rc == -1) {
0b5e55
+		if (rc < 0) {
0b5e55
 			/* reset after error */
0b5e55
 			reset_partlist(blkid_probe_get_partlist(pr));
0b5e55
 			if (chn && !chn->binary)
0b5e55
 				blkid_probe_chain_reset_vals(pr, chn);
0b5e55
-			DBG(LOWPROBE, blkid_debug("%s probefunc failed", id->name));
0b5e55
+			DBG(LOWPROBE, blkid_debug("%s probefunc failed, rc %d",
0b5e55
+						  id->name, rc));
0b5e55
 		}
0b5e55
-		if (rc == 0 && mag && chn && !chn->binary)
0b5e55
+		if (rc == BLKID_PROBE_OK && mag && chn && !chn->binary)
0b5e55
 			rc = blkid_probe_set_magic(pr, off, mag->len,
0b5e55
 					(unsigned char *) mag->magic);
0b5e55
 
0b5e55
@@ -569,11 +571,11 @@ nothing:
0b5e55
  */
0b5e55
 static int partitions_probe(blkid_probe pr, struct blkid_chain *chn)
0b5e55
 {
0b5e55
-	int rc = 1;
0b5e55
+	int rc = BLKID_PROBE_NONE;
0b5e55
 	size_t i;
0b5e55
 
0b5e55
 	if (!pr || chn->idx < -1)
0b5e55
-		return -1;
0b5e55
+		return -EINVAL;
0b5e55
 	blkid_probe_chain_reset_vals(pr, chn);
0b5e55
 
0b5e55
 	if (chn->binary)
0b5e55
@@ -597,7 +599,10 @@ static int partitions_probe(blkid_probe
0b5e55
 			continue;
0b5e55
 
0b5e55
 		/* apply checks from idinfo */
0b5e55
-		if (idinfo_probe(pr, idinfos[i], chn) != 0)
0b5e55
+		rc = idinfo_probe(pr, idinfos[i], chn);
0b5e55
+		if (rc < 0)
0b5e55
+			break;
0b5e55
+		if (rc != BLKID_PROBE_OK)
0b5e55
 			continue;
0b5e55
 
0b5e55
 		name = idinfos[i]->name;
0b5e55
@@ -613,20 +618,21 @@ static int partitions_probe(blkid_probe
0b5e55
 		break;
0b5e55
 	}
0b5e55
 
0b5e55
-	if (rc == 1) {
0b5e55
-		DBG(LOWPROBE, blkid_debug("<-- leaving probing loop (failed) [PARTS idx=%d]",
0b5e55
-			chn->idx));
0b5e55
+	if (rc != BLKID_PROBE_OK) {
0b5e55
+		DBG(LOWPROBE, blkid_debug("<-- leaving probing loop (failed=%d) [PARTS idx=%d]",
0b5e55
+			rc, chn->idx));
0b5e55
 	}
0b5e55
 
0b5e55
 details_only:
0b5e55
 	/*
0b5e55
 	 * Gather PART_ENTRY_* values if the current device is a partition.
0b5e55
 	 */
0b5e55
-	if (!chn->binary &&
0b5e55
+	if ((rc == BLKID_PROBE_OK || rc == BLKID_PROBE_NONE) && !chn->binary &&
0b5e55
 	    (blkid_partitions_get_flags(pr) & BLKID_PARTS_ENTRY_DETAILS)) {
0b5e55
 
0b5e55
-		if (!blkid_partitions_probe_partition(pr))
0b5e55
-			rc = 0;
0b5e55
+		int xrc = blkid_partitions_probe_partition(pr);
0b5e55
+		if (xrc < 0)
0b5e55
+			rc = xrc;	/* optional, care about errors only */
0b5e55
 	}
0b5e55
 
0b5e55
 	return rc;
0b5e55
@@ -637,7 +643,7 @@ int blkid_partitions_do_subprobe(blkid_p
0b5e55
 		const struct blkid_idinfo *id)
0b5e55
 {
0b5e55
 	blkid_probe prc;
0b5e55
-	int rc = 1;
0b5e55
+	int rc;
0b5e55
 	blkid_partlist ls;
0b5e55
 	blkid_loff_t sz, off;
0b5e55
 
0b5e55
@@ -646,7 +652,7 @@ int blkid_partitions_do_subprobe(blkid_p
0b5e55
 		id->name, parent));
0b5e55
 
0b5e55
 	if (!pr || !parent || !parent->size)
0b5e55
-		return -1;
0b5e55
+		return -EINVAL;
0b5e55
 
0b5e55
 	/* range defined by parent */
0b5e55
 	sz = ((blkid_loff_t) parent->size) << 9;
0b5e55
@@ -656,13 +662,13 @@ int blkid_partitions_do_subprobe(blkid_p
0b5e55
 		DBG(LOWPROBE, blkid_debug(
0b5e55
 			"ERROR: parts: <---- '%s' subprobe: overflow detected.",
0b5e55
 			id->name));
0b5e55
-		return -1;
0b5e55
+		return -ENOSPC;
0b5e55
 	}
0b5e55
 
0b5e55
 	/* create private prober */
0b5e55
 	prc = blkid_clone_probe(pr);
0b5e55
 	if (!prc)
0b5e55
-		return -1;
0b5e55
+		return -ENOMEM;
0b5e55
 
0b5e55
 	blkid_probe_set_dimension(prc, off, sz);
0b5e55
 
0b5e55
@@ -695,7 +701,7 @@ int blkid_partitions_do_subprobe(blkid_p
0b5e55
 
0b5e55
 static int blkid_partitions_probe_partition(blkid_probe pr)
0b5e55
 {
0b5e55
-	int rc = 1;
0b5e55
+	int rc = BLKID_PROBE_NONE;
0b5e55
 	blkid_probe disk_pr = NULL;
0b5e55
 	blkid_partlist ls;
0b5e55
 	blkid_partition par;
0b5e55
@@ -761,7 +767,7 @@ static int blkid_partitions_probe_partit
0b5e55
 		blkid_probe_sprintf_value(pr, "PART_ENTRY_DISK", "%u:%u",
0b5e55
 				major(disk), minor(disk));
0b5e55
 	}
0b5e55
-	rc = 0;
0b5e55
+	rc = BLKID_PROBE_OK;
0b5e55
 nothing:
0b5e55
 	return rc;
0b5e55
 }
0b5e55
diff -up util-linux-2.23.2/libblkid/src/partitions/sgi.c.kzak util-linux-2.23.2/libblkid/src/partitions/sgi.c
0b5e55
--- util-linux-2.23.2/libblkid/src/partitions/sgi.c.kzak	2013-07-15 10:25:46.285049072 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/partitions/sgi.c	2014-03-28 15:11:44.677551986 +0100
0b5e55
@@ -99,8 +99,11 @@ static int probe_sgi_pt(blkid_probe pr,
0b5e55
 	int i;
0b5e55
 
0b5e55
 	l = (struct sgi_disklabel *) blkid_probe_get_sector(pr, 0);
0b5e55
-	if (!l)
0b5e55
+	if (!l) {
0b5e55
+		if (errno)
0b5e55
+			return -errno;
0b5e55
 		goto nothing;
0b5e55
+	}
0b5e55
 
0b5e55
 	if (count_checksum(l)) {
0b5e55
 		DBG(LOWPROBE, blkid_debug(
0b5e55
@@ -110,11 +113,11 @@ static int probe_sgi_pt(blkid_probe pr,
0b5e55
 
0b5e55
 	if (blkid_partitions_need_typeonly(pr))
0b5e55
 		/* caller does not ask for details about partitions */
0b5e55
-		return 0;
0b5e55
+		return BLKID_PROBE_OK;
0b5e55
 
0b5e55
 	ls = blkid_probe_get_partlist(pr);
0b5e55
 	if (!ls)
0b5e55
-		goto err;
0b5e55
+		goto nothing;
0b5e55
 
0b5e55
 	tab = blkid_partlist_new_parttable(ls, "sgi", 0);
0b5e55
 	if (!tab)
0b5e55
@@ -138,12 +141,12 @@ static int probe_sgi_pt(blkid_probe pr,
0b5e55
 		blkid_partition_set_type(par, type);
0b5e55
 	}
0b5e55
 
0b5e55
-	return 0;
0b5e55
+	return BLKID_PROBE_OK;
0b5e55
 
0b5e55
 nothing:
0b5e55
-	return 1;
0b5e55
+	return BLKID_PROBE_NONE;
0b5e55
 err:
0b5e55
-	return -1;
0b5e55
+	return -ENOMEM;
0b5e55
 }
0b5e55
 
0b5e55
 const struct blkid_idinfo sgi_pt_idinfo =
0b5e55
diff -up util-linux-2.23.2/libblkid/src/partitions/solaris_x86.c.kzak util-linux-2.23.2/libblkid/src/partitions/solaris_x86.c
0b5e55
--- util-linux-2.23.2/libblkid/src/partitions/solaris_x86.c.kzak	2013-06-13 09:46:10.418650605 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/partitions/solaris_x86.c	2014-03-28 15:11:44.677551986 +0100
0b5e55
@@ -69,8 +69,11 @@ static int probe_solaris_pt(blkid_probe
0b5e55
 	uint16_t nparts;
0b5e55
 
0b5e55
 	l = (struct solaris_vtoc *) blkid_probe_get_sector(pr, SOLARIS_SECTOR);
0b5e55
-	if (!l)
0b5e55
+	if (!l) {
0b5e55
+		if (errno)
0b5e55
+			return -errno;
0b5e55
 		goto nothing;
0b5e55
+	}
0b5e55
 
0b5e55
 	if (le32_to_cpu(l->v_version) != 1) {
0b5e55
 		DBG(LOWPROBE, blkid_debug(
0b5e55
@@ -81,11 +84,11 @@ static int probe_solaris_pt(blkid_probe
0b5e55
 
0b5e55
 	if (blkid_partitions_need_typeonly(pr))
0b5e55
 		/* caller does not ask for details about partitions */
0b5e55
-		return 0;
0b5e55
+		return BLKID_PROBE_OK;
0b5e55
 
0b5e55
 	ls = blkid_probe_get_partlist(pr);
0b5e55
 	if (!ls)
0b5e55
-		goto err;
0b5e55
+		goto nothing;
0b5e55
 
0b5e55
 	parent = blkid_partlist_get_parent(ls);
0b5e55
 
0b5e55
@@ -126,12 +129,12 @@ static int probe_solaris_pt(blkid_probe
0b5e55
 		blkid_partition_set_flags(par, le16_to_cpu(p->s_flag));
0b5e55
 	}
0b5e55
 
0b5e55
-	return 0;
0b5e55
+	return BLKID_PROBE_OK;
0b5e55
 
0b5e55
 nothing:
0b5e55
-	return 1;
0b5e55
+	return BLKID_PROBE_NONE;
0b5e55
 err:
0b5e55
-	return -1;
0b5e55
+	return -ENOMEM;
0b5e55
 }
0b5e55
 
0b5e55
 const struct blkid_idinfo solaris_x86_pt_idinfo =
0b5e55
diff -up util-linux-2.23.2/libblkid/src/partitions/sun.c.kzak util-linux-2.23.2/libblkid/src/partitions/sun.c
0b5e55
--- util-linux-2.23.2/libblkid/src/partitions/sun.c.kzak	2013-06-13 09:46:10.419650613 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/partitions/sun.c	2014-03-28 15:11:44.678551996 +0100
0b5e55
@@ -27,8 +27,11 @@ static int probe_sun_pt(blkid_probe pr,
0b5e55
 	int i, use_vtoc;
0b5e55
 
0b5e55
 	l = (struct sun_disklabel *) blkid_probe_get_sector(pr, 0);
0b5e55
-	if (!l)
0b5e55
+	if (!l) {
0b5e55
+		if (errno)
0b5e55
+			return -errno;
0b5e55
 		goto nothing;
0b5e55
+	}
0b5e55
 
0b5e55
 	if (sun_pt_checksum(l)) {
0b5e55
 		DBG(LOWPROBE, blkid_debug(
0b5e55
@@ -38,11 +41,11 @@ static int probe_sun_pt(blkid_probe pr,
0b5e55
 
0b5e55
 	if (blkid_partitions_need_typeonly(pr))
0b5e55
 		/* caller does not ask for details about partitions */
0b5e55
-		return 0;
0b5e55
+		return BLKID_PROBE_OK;
0b5e55
 
0b5e55
 	ls = blkid_probe_get_partlist(pr);
0b5e55
 	if (!ls)
0b5e55
-		goto err;
0b5e55
+		goto nothing;
0b5e55
 
0b5e55
 	tab = blkid_partlist_new_parttable(ls, "sun", 0);
0b5e55
 	if (!tab)
0b5e55
@@ -76,7 +79,7 @@ static int probe_sun_pt(blkid_probe pr,
0b5e55
 		uint16_t type = 0, flags = 0;
0b5e55
 		blkid_partition par;
0b5e55
 
0b5e55
-                start = be32_to_cpu(p->start_cylinder) * spc;
0b5e55
+		start = be32_to_cpu(p->start_cylinder) * spc;
0b5e55
 		size = be32_to_cpu(p->num_sectors);
0b5e55
 		if (use_vtoc) {
0b5e55
 			type = be16_to_cpu(l->vtoc.infos[i].id);
0b5e55
@@ -96,12 +99,12 @@ static int probe_sun_pt(blkid_probe pr,
0b5e55
 		if (flags)
0b5e55
 			blkid_partition_set_flags(par, flags);
0b5e55
 	}
0b5e55
-	return 0;
0b5e55
+	return BLKID_PROBE_OK;
0b5e55
 
0b5e55
 nothing:
0b5e55
-	return 1;
0b5e55
+	return BLKID_PROBE_NONE;
0b5e55
 err:
0b5e55
-	return -1;
0b5e55
+	return -ENOMEM;
0b5e55
 }
0b5e55
 
0b5e55
 
0b5e55
diff -up util-linux-2.23.2/libblkid/src/partitions/ultrix.c.kzak util-linux-2.23.2/libblkid/src/partitions/ultrix.c
0b5e55
--- util-linux-2.23.2/libblkid/src/partitions/ultrix.c.kzak	2013-05-30 15:21:43.127591380 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/partitions/ultrix.c	2014-03-28 15:11:44.678551996 +0100
0b5e55
@@ -44,8 +44,11 @@ static int probe_ultrix_pt(blkid_probe p
0b5e55
 	int i;
0b5e55
 
0b5e55
 	data = blkid_probe_get_sector(pr, ULTRIX_SECTOR);
0b5e55
-	if (!data)
0b5e55
+	if (!data) {
0b5e55
+		if (errno)
0b5e55
+			return -errno;
0b5e55
 		goto nothing;
0b5e55
+	}
0b5e55
 
0b5e55
 	l = (struct ultrix_disklabel *) (data + ULTRIX_OFFSET);
0b5e55
 
0b5e55
@@ -59,11 +62,11 @@ static int probe_ultrix_pt(blkid_probe p
0b5e55
 
0b5e55
 	if (blkid_partitions_need_typeonly(pr))
0b5e55
 		/* caller does not ask for details about partitions */
0b5e55
-		return 0;
0b5e55
+		return BLKID_PROBE_OK;
0b5e55
 
0b5e55
 	ls = blkid_probe_get_partlist(pr);
0b5e55
 	if (!ls)
0b5e55
-		goto err;
0b5e55
+		goto nothing;
0b5e55
 
0b5e55
 	tab = blkid_partlist_new_parttable(ls, "ultrix", 0);
0b5e55
 	if (!tab)
0b5e55
@@ -80,11 +83,11 @@ static int probe_ultrix_pt(blkid_probe p
0b5e55
 		}
0b5e55
 	}
0b5e55
 
0b5e55
-	return 0;
0b5e55
+	return BLKID_PROBE_OK;
0b5e55
 nothing:
0b5e55
-	return 1;
0b5e55
+	return BLKID_PROBE_NONE;
0b5e55
 err:
0b5e55
-	return -1;
0b5e55
+	return -ENOMEM;
0b5e55
 }
0b5e55
 
0b5e55
 const struct blkid_idinfo ultrix_pt_idinfo =
0b5e55
diff -up util-linux-2.23.2/libblkid/src/partitions/unixware.c.kzak util-linux-2.23.2/libblkid/src/partitions/unixware.c
0b5e55
--- util-linux-2.23.2/libblkid/src/partitions/unixware.c.kzak	2013-06-13 09:46:10.419650613 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/partitions/unixware.c	2014-03-28 15:11:44.678551996 +0100
0b5e55
@@ -106,19 +106,22 @@ static int probe_unixware_pt(blkid_probe
0b5e55
 
0b5e55
 	l = (struct unixware_disklabel *)
0b5e55
 			blkid_probe_get_sector(pr, UNIXWARE_SECTOR);
0b5e55
-	if (!l)
0b5e55
+	if (!l) {
0b5e55
+		if (errno)
0b5e55
+			return -errno;
0b5e55
 		goto nothing;
0b5e55
+	}
0b5e55
 
0b5e55
 	if (le32_to_cpu(l->vtoc.v_magic) != UNIXWARE_VTOCMAGIC)
0b5e55
 		goto nothing;
0b5e55
 
0b5e55
 	if (blkid_partitions_need_typeonly(pr))
0b5e55
 		/* caller does not ask for details about partitions */
0b5e55
-		return 0;
0b5e55
+		return BLKID_PROBE_OK;
0b5e55
 
0b5e55
 	ls = blkid_probe_get_partlist(pr);
0b5e55
 	if (!ls)
0b5e55
-		goto err;
0b5e55
+		goto nothing;
0b5e55
 
0b5e55
 	parent = blkid_partlist_get_parent(ls);
0b5e55
 
0b5e55
@@ -161,12 +164,12 @@ static int probe_unixware_pt(blkid_probe
0b5e55
 		blkid_partition_set_flags(par, flg);
0b5e55
 	}
0b5e55
 
0b5e55
-	return 0;
0b5e55
+	return BLKID_PROBE_OK;
0b5e55
 
0b5e55
 nothing:
0b5e55
-	return 1;
0b5e55
+	return BLKID_PROBE_NONE;
0b5e55
 err:
0b5e55
-	return -1;
0b5e55
+	return -ENOMEM;
0b5e55
 }
0b5e55
 
0b5e55
 
0b5e55
diff -up util-linux-2.23.2/libblkid/src/probe.c.kzak util-linux-2.23.2/libblkid/src/probe.c
0b5e55
--- util-linux-2.23.2/libblkid/src/probe.c.kzak	2014-03-28 15:11:18.334283704 +0100
0b5e55
+++ util-linux-2.23.2/libblkid/src/probe.c	2014-03-28 15:11:44.678551996 +0100
0b5e55
@@ -559,13 +559,17 @@ unsigned char *blkid_probe_get_buffer(bl
0b5e55
 	if (!bf) {
0b5e55
 		ssize_t ret;
0b5e55
 
0b5e55
-		if (blkid_llseek(pr->fd, pr->off + off, SEEK_SET) < 0)
0b5e55
+		if (blkid_llseek(pr->fd, pr->off + off, SEEK_SET) < 0) {
0b5e55
+			errno = 0;
0b5e55
 			return NULL;
0b5e55
+		}
0b5e55
 
0b5e55
 		/* allocate info and space for data by why call */
0b5e55
 		bf = calloc(1, sizeof(struct blkid_bufinfo) + len);
0b5e55
-		if (!bf)
0b5e55
+		if (!bf) {
0b5e55
+			errno = ENOMEM;
0b5e55
 			return NULL;
0b5e55
+		}
0b5e55
 
0b5e55
 		bf->data = ((unsigned char *) bf) + sizeof(struct blkid_bufinfo);
0b5e55
 		bf->len = len;
0b5e55
@@ -577,7 +581,10 @@ unsigned char *blkid_probe_get_buffer(bl
0b5e55
 
0b5e55
 		ret = read(pr->fd, bf->data, len);
0b5e55
 		if (ret != (ssize_t) len) {
0b5e55
+			DBG(LOWPROBE, blkid_debug("\tbuffer read: return %zd error %m", ret));
0b5e55
 			free(bf);
0b5e55
+			if (ret >= 0)
0b5e55
+				errno = 0;
0b5e55
 			return NULL;
0b5e55
 		}
0b5e55
 		list_add_tail(&bf->bufs, &pr->buffers);
0b5e55
@@ -766,6 +773,17 @@ int blkid_probe_set_dimension(blkid_prob
0b5e55
 	return 0;
0b5e55
 }
0b5e55
 
0b5e55
+/**
0b5e55
+ * blkid_probe_get_idmag:
0b5e55
+ * @pr: probe
0b5e55
+ * @id: id information
0b5e55
+ * @offset: begin of probing area
0b5e55
+ * @res: found id information
0b5e55
+ *
0b5e55
+ * Check for matching magic value.
0b5e55
+ * Returns BLKID_PROBE_OK if found, BLKID_PROBE_NONE if not found
0b5e55
+ * or no magic present, or negative value on error.
0b5e55
+ */
0b5e55
 int blkid_probe_get_idmag(blkid_probe pr, const struct blkid_idinfo *id,
0b5e55
 			blkid_loff_t *offset, const struct blkid_idmag **res)
0b5e55
 {
0b5e55
@@ -784,6 +802,8 @@ int blkid_probe_get_idmag(blkid_probe pr
0b5e55
 		off = (mag->kboff + (mag->sboff >> 10)) << 10;
0b5e55
 		buf = blkid_probe_get_buffer(pr, off, 1024);
0b5e55
 
0b5e55
+		if (!buf && errno)
0b5e55
+			return -errno;
0b5e55
 		if (buf && !memcmp(mag->magic,
0b5e55
 				buf + (mag->sboff & 0x3ff), mag->len)) {
0b5e55
 			DBG(LOWPROBE, blkid_debug("\tmagic sboff=%u, kboff=%ld",
0b5e55
@@ -792,16 +812,16 @@ int blkid_probe_get_idmag(blkid_probe pr
0b5e55
 				*offset = off + (mag->sboff & 0x3ff);
0b5e55
 			if (res)
0b5e55
 				*res = mag;
0b5e55
-			return 0;
0b5e55
+			return BLKID_PROBE_OK;
0b5e55
 		}
0b5e55
 		mag++;
0b5e55
 	}
0b5e55
 
0b5e55
 	if (id && id->magics[0].magic)
0b5e55
 		/* magic string(s) defined, but not found */
0b5e55
-		return 1;
0b5e55
+		return BLKID_PROBE_NONE;
0b5e55
 
0b5e55
-	return 0;
0b5e55
+	return BLKID_PROBE_OK;
0b5e55
 }
0b5e55
 
0b5e55
 static inline void blkid_probe_start(blkid_probe pr)
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/adaptec_raid.c.kzak util-linux-2.23.2/libblkid/src/superblocks/adaptec_raid.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/adaptec_raid.c.kzak	2013-04-08 17:55:40.232855970 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/adaptec_raid.c	2014-03-28 15:11:44.678551996 +0100
0b5e55
@@ -80,10 +80,10 @@ static int probe_adraid(blkid_probe pr,
0b5e55
 	struct adaptec_metadata *ad;
0b5e55
 
0b5e55
 	if (pr->size < 0x10000)
0b5e55
-		return -1;
0b5e55
+		return BLKID_PROBE_NONE;
0b5e55
 
0b5e55
 	if (!S_ISREG(pr->mode) && !blkid_probe_is_wholedisk(pr))
0b5e55
-		return -1;
0b5e55
+		return BLKID_PROBE_NONE;
0b5e55
 
0b5e55
 	off = ((pr->size / 0x200)-1) * 0x200;
0b5e55
 	ad = (struct adaptec_metadata *)
0b5e55
@@ -91,17 +91,19 @@ static int probe_adraid(blkid_probe pr,
0b5e55
 					off,
0b5e55
 					sizeof(struct adaptec_metadata));
0b5e55
 	if (!ad)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : BLKID_PROBE_NONE;;
0b5e55
+
0b5e55
 	if (ad->smagic != be32_to_cpu(AD_SIGNATURE))
0b5e55
-		return -1;
0b5e55
+		return BLKID_PROBE_NONE;
0b5e55
 	if (ad->b0idcode != be32_to_cpu(AD_MAGIC))
0b5e55
-		return -1;
0b5e55
+		return BLKID_PROBE_NONE;
0b5e55
 	if (blkid_probe_sprintf_version(pr, "%u", ad->resver) != 0)
0b5e55
-		return -1;
0b5e55
+		return BLKID_PROBE_NONE;
0b5e55
 	if (blkid_probe_set_magic(pr, off, sizeof(ad->b0idcode),
0b5e55
 				(unsigned char *) &ad->b0idcode))
0b5e55
-		return -1;
0b5e55
-	return 0;
0b5e55
+		return BLKID_PROBE_NONE;
0b5e55
+
0b5e55
+	return BLKID_PROBE_OK;
0b5e55
 }
0b5e55
 
0b5e55
 const struct blkid_idinfo adraid_idinfo = {
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/befs.c.kzak util-linux-2.23.2/libblkid/src/superblocks/befs.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/befs.c.kzak	2013-04-08 17:55:40.237856017 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/befs.c	2014-03-28 15:11:44.679552006 +0100
0b5e55
@@ -261,21 +261,23 @@ static int64_t get_key_value(blkid_probe
0b5e55
 	int64_t node_pointer;
0b5e55
 	int32_t first, last, mid, cmp;
0b5e55
 
0b5e55
+	errno = 0;
0b5e55
 	bh = (struct bplustree_header *) get_tree_node(pr, bs, &bi->data, 0,
0b5e55
 					sizeof(struct bplustree_header), fs_le);
0b5e55
 	if (!bh)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : -ENOENT;
0b5e55
 
0b5e55
 	if ((int32_t) FS32_TO_CPU(bh->magic, fs_le) != BPLUSTREE_MAGIC)
0b5e55
-		return -1;
0b5e55
+		return -ENOENT;
0b5e55
 
0b5e55
 	node_pointer = FS64_TO_CPU(bh->root_node_pointer, fs_le);
0b5e55
 
0b5e55
 	do {
0b5e55
+		errno = 0;
0b5e55
 		bn = (struct bplustree_node *) get_tree_node(pr, bs, &bi->data,
0b5e55
 			node_pointer, FS32_TO_CPU(bh->node_size, fs_le), fs_le);
0b5e55
 		if (!bn)
0b5e55
-			return -1;
0b5e55
+			return errno ? -errno : -ENOENT;
0b5e55
 
0b5e55
 		keylengths = (uint16_t *) ((uint8_t *) bn
0b5e55
 				+ ((sizeof(struct bplustree_node)
0b5e55
@@ -336,10 +338,10 @@ static int get_uuid(blkid_probe pr, cons
0b5e55
 
0b5e55
 	bi = (struct befs_inode *) get_block_run(pr, bs, &bs->root_dir, fs_le);
0b5e55
 	if (!bi)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : BLKID_PROBE_NONE;
0b5e55
 
0b5e55
 	if (FS32_TO_CPU(bi->magic1, fs_le) != INODE_MAGIC1)
0b5e55
-		return -1;
0b5e55
+		return BLKID_PROBE_NONE;
0b5e55
 
0b5e55
 	sd = (struct small_data *) bi->small_data;
0b5e55
 
0b5e55
@@ -376,24 +378,24 @@ static int get_uuid(blkid_probe pr, cons
0b5e55
 		bi = (struct befs_inode *) get_block_run(pr, bs,
0b5e55
 							&bi->attributes, fs_le);
0b5e55
 		if (!bi)
0b5e55
-			return -1;
0b5e55
+			return errno ? -errno : BLKID_PROBE_NONE;
0b5e55
 
0b5e55
 		if (FS32_TO_CPU(bi->magic1, fs_le) != INODE_MAGIC1)
0b5e55
-			return -1;
0b5e55
+			return BLKID_PROBE_NONE;
0b5e55
 
0b5e55
 		value = get_key_value(pr, bs, bi, KEY_NAME, fs_le);
0b5e55
-
0b5e55
 		if (value < 0)
0b5e55
-			return value;
0b5e55
+			return value == -ENOENT ? BLKID_PROBE_NONE : value;
0b5e55
+
0b5e55
 		else if (value > 0) {
0b5e55
 			bi = (struct befs_inode *) blkid_probe_get_buffer(pr,
0b5e55
 				value << FS32_TO_CPU(bs->block_shift, fs_le),
0b5e55
 				FS32_TO_CPU(bs->block_size, fs_le));
0b5e55
 			if (!bi)
0b5e55
-				return -1;
0b5e55
+				return errno ? -errno : BLKID_PROBE_NONE;
0b5e55
 
0b5e55
 			if (FS32_TO_CPU(bi->magic1, fs_le) != INODE_MAGIC1)
0b5e55
-				return -1;
0b5e55
+				return 1;
0b5e55
 
0b5e55
 			if (FS32_TO_CPU(bi->type, fs_le) == B_UINT64_TYPE
0b5e55
 				&& FS64_TO_CPU(bi->data.size, fs_le) == KEY_SIZE
0b5e55
@@ -404,7 +406,7 @@ static int get_uuid(blkid_probe pr, cons
0b5e55
 				attr_data = (uint64_t *) get_block_run(pr, bs,
0b5e55
 						&bi->data.direct[0], fs_le);
0b5e55
 				if (!attr_data)
0b5e55
-					return -1;
0b5e55
+					return errno ? -errno : BLKID_PROBE_NONE;
0b5e55
 
0b5e55
 				*uuid = *attr_data;
0b5e55
 			}
0b5e55
@@ -424,7 +426,7 @@ static int probe_befs(blkid_probe pr, co
0b5e55
 					mag->sboff - B_OS_NAME_LENGTH,
0b5e55
 					sizeof(struct befs_super_block));
0b5e55
 	if (!bs)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : BLKID_PROBE_NONE;
0b5e55
 
0b5e55
 	if (le32_to_cpu(bs->magic1) == SUPER_BLOCK_MAGIC1
0b5e55
 		&& le32_to_cpu(bs->magic2) == SUPER_BLOCK_MAGIC2
0b5e55
@@ -439,11 +441,11 @@ static int probe_befs(blkid_probe pr, co
0b5e55
 		fs_le = 0;
0b5e55
 		version = "big-endian";
0b5e55
 	} else
0b5e55
-		return -1;
0b5e55
+		return BLKID_PROBE_NONE;
0b5e55
 
0b5e55
 	ret = get_uuid(pr, bs, &volume_id, fs_le);
0b5e55
 
0b5e55
-	if (ret < 0)
0b5e55
+	if (ret != 0)
0b5e55
 		return ret;
0b5e55
 
0b5e55
 	/*
0b5e55
@@ -459,7 +461,7 @@ static int probe_befs(blkid_probe pr, co
0b5e55
 		blkid_probe_sprintf_uuid(pr, (unsigned char *) &volume_id,
0b5e55
 					sizeof(volume_id), "%016" PRIx64,
0b5e55
 					FS64_TO_CPU(volume_id, fs_le));
0b5e55
-	return 0;
0b5e55
+	return BLKID_PROBE_OK;
0b5e55
 }
0b5e55
 
0b5e55
 const struct blkid_idinfo befs_idinfo =
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/btrfs.c.kzak util-linux-2.23.2/libblkid/src/superblocks/btrfs.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/btrfs.c.kzak	2014-03-28 15:11:18.335283714 +0100
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/btrfs.c	2014-03-28 15:11:44.679552006 +0100
0b5e55
@@ -65,7 +65,7 @@ static int probe_btrfs(blkid_probe pr, c
0b5e55
 
0b5e55
 	bfs = blkid_probe_get_sb(pr, mag, struct btrfs_super_block);
0b5e55
 	if (!bfs)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	if (*bfs->label)
0b5e55
 		blkid_probe_set_label(pr,
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/cramfs.c.kzak util-linux-2.23.2/libblkid/src/superblocks/cramfs.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/cramfs.c.kzak	2013-04-08 17:55:40.240856046 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/cramfs.c	2014-03-28 15:11:44.679552006 +0100
0b5e55
@@ -40,7 +40,7 @@ static int probe_cramfs(blkid_probe pr,
0b5e55
 
0b5e55
 	cs = blkid_probe_get_sb(pr, mag, struct cramfs_super);
0b5e55
 	if (!cs)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	blkid_probe_set_label(pr, cs->name, sizeof(cs->name));
0b5e55
 	return 0;
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/ddf_raid.c.kzak util-linux-2.23.2/libblkid/src/superblocks/ddf_raid.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/ddf_raid.c.kzak	2013-04-08 17:55:40.241856056 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/ddf_raid.c	2014-03-28 15:11:44.679552006 +0100
0b5e55
@@ -81,7 +81,7 @@ static int probe_ddf(blkid_probe pr,
0b5e55
 	uint64_t off, lba;
0b5e55
 
0b5e55
 	if (pr->size < 0x30000)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	for (i = 0; i < ARRAY_SIZE(hdrs); i++) {
0b5e55
 		off = ((pr->size / 0x200) - hdrs[i]) * 0x200;
0b5e55
@@ -90,8 +90,7 @@ static int probe_ddf(blkid_probe pr,
0b5e55
 					off,
0b5e55
 					sizeof(struct ddf_header));
0b5e55
 		if (!ddf)
0b5e55
-			return -1;
0b5e55
-
0b5e55
+			return errno ? -errno : 1;
0b5e55
 		if (ddf->signature == cpu_to_be32(DDF_MAGIC) ||
0b5e55
 		    ddf->signature == cpu_to_le32(DDF_MAGIC))
0b5e55
 			break;
0b5e55
@@ -99,7 +98,7 @@ static int probe_ddf(blkid_probe pr,
0b5e55
 	}
0b5e55
 
0b5e55
 	if (!ddf)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	lba = ddf->signature == cpu_to_be32(DDF_MAGIC) ?
0b5e55
 			be64_to_cpu(ddf->primary_lba) :
0b5e55
@@ -111,8 +110,12 @@ static int probe_ddf(blkid_probe pr,
0b5e55
 
0b5e55
 		buf = blkid_probe_get_buffer(pr,
0b5e55
 					lba << 9, sizeof(ddf->signature));
0b5e55
-		if (!buf || memcmp(buf, &ddf->signature, 4))
0b5e55
-			return -1;
0b5e55
+		if (!buf) {
0b5e55
+			if (errno)
0b5e55
+				return -errno;
0b5e55
+			if (memcmp(buf, &ddf->signature, 4))
0b5e55
+				return 1;
0b5e55
+		}
0b5e55
 	}
0b5e55
 
0b5e55
 	blkid_probe_strncpy_uuid(pr, ddf->guid, sizeof(ddf->guid));
0b5e55
@@ -121,11 +124,11 @@ static int probe_ddf(blkid_probe pr,
0b5e55
 	*(version + sizeof(ddf->ddf_rev)) = '\0';
0b5e55
 
0b5e55
 	if (blkid_probe_set_version(pr, version) != 0)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (blkid_probe_set_magic(pr, off,
0b5e55
 			sizeof(ddf->signature),
0b5e55
 			(unsigned char *) &ddf->signature))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	return 0;
0b5e55
 }
0b5e55
 
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/drbd.c.kzak util-linux-2.23.2/libblkid/src/superblocks/drbd.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/drbd.c.kzak	2013-04-08 17:55:40.243856074 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/drbd.c	2014-03-28 15:11:44.679552006 +0100
0b5e55
@@ -75,18 +75,18 @@ static int probe_drbd(blkid_probe pr,
0b5e55
 
0b5e55
 	/* Small devices cannot be drbd (?) */
0b5e55
 	if (pr->size < 0x10000)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	md = (struct md_on_disk_08 *)
0b5e55
 			blkid_probe_get_buffer(pr,
0b5e55
 					off,
0b5e55
 					sizeof(struct md_on_disk_08));
0b5e55
 	if (!md)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	if (be32_to_cpu(md->magic) != DRBD_MD_MAGIC_08 &&
0b5e55
 			be32_to_cpu(md->magic) != DRBD_MD_MAGIC_84_UNCLEAN)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	/*
0b5e55
 	 * DRBD does not have "real" uuids; the following resembles DRBD's
0b5e55
@@ -102,7 +102,7 @@ static int probe_drbd(blkid_probe pr,
0b5e55
 				off + offsetof(struct md_on_disk_08, magic),
0b5e55
 				sizeof(md->magic),
0b5e55
 				(unsigned char *) &md->magic))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	return 0;
0b5e55
 }
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/drbdproxy_datalog.c.kzak util-linux-2.23.2/libblkid/src/superblocks/drbdproxy_datalog.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/drbdproxy_datalog.c.kzak	2013-04-08 17:55:40.244856084 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/drbdproxy_datalog.c	2014-03-28 15:11:44.679552006 +0100
0b5e55
@@ -33,7 +33,7 @@ static int probe_drbdproxy_datalog(blkid
0b5e55
 
0b5e55
 	lh = (struct log_header_t *) blkid_probe_get_buffer(pr, 0, sizeof(*lh));
0b5e55
 	if (!lh)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	blkid_probe_set_uuid(pr, lh->uuid);
0b5e55
 	blkid_probe_sprintf_version(pr, "v%jd", le64_to_cpu(lh->version));
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/exfat.c.kzak util-linux-2.23.2/libblkid/src/superblocks/exfat.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/exfat.c.kzak	2013-04-08 17:55:40.245856093 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/exfat.c	2014-03-28 15:11:44.680552016 +0100
0b5e55
@@ -115,12 +115,14 @@ static int probe_exfat(blkid_probe pr, c
0b5e55
 
0b5e55
 	sb = blkid_probe_get_sb(pr, mag, struct exfat_super_block);
0b5e55
 	if (!sb)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : BLKID_PROBE_NONE;
0b5e55
 
0b5e55
 	label = find_label(pr, sb);
0b5e55
 	if (label)
0b5e55
 		blkid_probe_set_utf8label(pr, label->name,
0b5e55
 				min(label->length * 2, 30), BLKID_ENC_UTF16LE);
0b5e55
+	else if (errno)
0b5e55
+		return -errno;
0b5e55
 
0b5e55
 	blkid_probe_sprintf_uuid(pr, sb->volume_serial, 4,
0b5e55
 			"%02hhX%02hhX-%02hhX%02hhX",
0b5e55
@@ -130,7 +132,7 @@ static int probe_exfat(blkid_probe pr, c
0b5e55
 	blkid_probe_sprintf_version(pr, "%u.%u",
0b5e55
 			sb->version.major, sb->version.minor);
0b5e55
 
0b5e55
-	return 0;
0b5e55
+	return BLKID_PROBE_OK;
0b5e55
 }
0b5e55
 
0b5e55
 const struct blkid_idinfo exfat_idinfo =
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/ext.c.kzak util-linux-2.23.2/libblkid/src/superblocks/ext.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/ext.c.kzak	2014-03-28 15:11:18.333283694 +0100
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/ext.c	2014-03-28 15:11:44.680552016 +0100
0b5e55
@@ -198,9 +198,9 @@ static int probe_jbd(blkid_probe pr,
0b5e55
 
0b5e55
 	es = ext_get_super(pr, NULL, &fi, NULL);
0b5e55
 	if (!es)
0b5e55
-		return -BLKID_ERR_PARAM;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 	if (!(fi & EXT3_FEATURE_INCOMPAT_JOURNAL_DEV))
0b5e55
-		return -BLKID_ERR_PARAM;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	ext_get_info(pr, 2, es);
0b5e55
 	return 0;
0b5e55
@@ -214,16 +214,16 @@ static int probe_ext2(blkid_probe pr,
0b5e55
 
0b5e55
 	es = ext_get_super(pr, &fc, &fi, &frc;;
0b5e55
 	if (!es)
0b5e55
-		return -BLKID_ERR_PARAM;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	/* Distinguish between ext3 and ext2 */
0b5e55
 	if (fc & EXT3_FEATURE_COMPAT_HAS_JOURNAL)
0b5e55
-		return -BLKID_ERR_PARAM;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	/* Any features which ext2 doesn't understand */
0b5e55
 	if ((frc & EXT2_FEATURE_RO_COMPAT_UNSUPPORTED) ||
0b5e55
 	    (fi  & EXT2_FEATURE_INCOMPAT_UNSUPPORTED))
0b5e55
-		return -BLKID_ERR_PARAM;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	ext_get_info(pr, 2, es);
0b5e55
 	return 0;
0b5e55
@@ -237,16 +237,16 @@ static int probe_ext3(blkid_probe pr,
0b5e55
 
0b5e55
 	es = ext_get_super(pr, &fc, &fi, &frc;;
0b5e55
 	if (!es)
0b5e55
-		return -BLKID_ERR_PARAM;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	/* ext3 requires journal */
0b5e55
 	if (!(fc & EXT3_FEATURE_COMPAT_HAS_JOURNAL))
0b5e55
-		return -BLKID_ERR_PARAM;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	/* Any features which ext3 doesn't understand */
0b5e55
 	if ((frc & EXT3_FEATURE_RO_COMPAT_UNSUPPORTED) ||
0b5e55
 	    (fi  & EXT3_FEATURE_INCOMPAT_UNSUPPORTED))
0b5e55
-		return -BLKID_ERR_PARAM;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	ext_get_info(pr, 3, es);
0b5e55
 	return 0;
0b5e55
@@ -261,14 +261,14 @@ static int probe_ext4dev(blkid_probe pr,
0b5e55
 
0b5e55
 	es = ext_get_super(pr, &fc, &fi, &frc;;
0b5e55
 	if (!es)
0b5e55
-		return -BLKID_ERR_PARAM;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	/* Distinguish from jbd */
0b5e55
 	if (fi & EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)
0b5e55
-		return -BLKID_ERR_PARAM;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	if (!(le32_to_cpu(es->s_flags) & EXT2_FLAGS_TEST_FILESYS))
0b5e55
-		return -BLKID_ERR_PARAM;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	ext_get_info(pr, 4, es);
0b5e55
 	return 0;
0b5e55
@@ -282,16 +282,16 @@ static int probe_ext4(blkid_probe pr,
0b5e55
 
0b5e55
 	es = ext_get_super(pr, &fc, &fi, &frc;;
0b5e55
 	if (!es)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	/* Distinguish from jbd */
0b5e55
 	if (fi & EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)
0b5e55
-		return -BLKID_ERR_PARAM;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	/* Ext4 has at least one feature which ext3 doesn't understand */
0b5e55
 	if (!(frc & EXT3_FEATURE_RO_COMPAT_UNSUPPORTED) &&
0b5e55
 	    !(fi  & EXT3_FEATURE_INCOMPAT_UNSUPPORTED))
0b5e55
-		return -BLKID_ERR_PARAM;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	/*
0b5e55
 	 * If the filesystem is a OK for use by in-development
0b5e55
@@ -304,7 +304,7 @@ static int probe_ext4(blkid_probe pr,
0b5e55
 	 * ext4dev.
0b5e55
 	 */
0b5e55
 	if (le32_to_cpu(es->s_flags) & EXT2_FLAGS_TEST_FILESYS)
0b5e55
-		return -BLKID_ERR_PARAM;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	ext_get_info(pr, 4, es);
0b5e55
 	return 0;
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/f2fs.c.kzak util-linux-2.23.2/libblkid/src/superblocks/f2fs.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/f2fs.c.kzak	2013-06-13 09:46:10.422650639 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/f2fs.c	2014-03-28 15:11:44.680552016 +0100
0b5e55
@@ -62,7 +62,7 @@ static int probe_f2fs(blkid_probe pr, co
0b5e55
 
0b5e55
 	sb = blkid_probe_get_sb(pr, mag, struct f2fs_super_block);
0b5e55
 	if (!sb)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	major = le16_to_cpu(sb->major_ver);
0b5e55
 	minor = le16_to_cpu(sb->minor_ver);
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/gfs.c.kzak util-linux-2.23.2/libblkid/src/superblocks/gfs.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/gfs.c.kzak	2013-04-08 17:55:40.250856141 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/gfs.c	2014-03-28 15:11:44.680552016 +0100
0b5e55
@@ -64,7 +64,7 @@ static int probe_gfs(blkid_probe pr, con
0b5e55
 
0b5e55
 	sbd = blkid_probe_get_sb(pr, mag, struct gfs2_sb);
0b5e55
 	if (!sbd)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	if (be32_to_cpu(sbd->sb_fs_format) == GFS_FORMAT_FS &&
0b5e55
 	    be32_to_cpu(sbd->sb_multihost_format) == GFS_FORMAT_MULTI)
0b5e55
@@ -78,7 +78,7 @@ static int probe_gfs(blkid_probe pr, con
0b5e55
 		return 0;
0b5e55
 	}
0b5e55
 
0b5e55
-	return -1;
0b5e55
+	return 1;
0b5e55
 }
0b5e55
 
0b5e55
 static int probe_gfs2(blkid_probe pr, const struct blkid_idmag *mag)
0b5e55
@@ -87,7 +87,7 @@ static int probe_gfs2(blkid_probe pr, co
0b5e55
 
0b5e55
 	sbd = blkid_probe_get_sb(pr, mag, struct gfs2_sb);
0b5e55
 	if (!sbd)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	if (be32_to_cpu(sbd->sb_fs_format) == GFS2_FORMAT_FS &&
0b5e55
 	    be32_to_cpu(sbd->sb_multihost_format) == GFS2_FORMAT_MULTI)
0b5e55
@@ -100,7 +100,7 @@ static int probe_gfs2(blkid_probe pr, co
0b5e55
 		blkid_probe_set_version(pr, "1");
0b5e55
 		return 0;
0b5e55
 	}
0b5e55
-	return -1;
0b5e55
+	return 1;
0b5e55
 }
0b5e55
 
0b5e55
 const struct blkid_idinfo gfs_idinfo =
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/hfs.c.kzak util-linux-2.23.2/libblkid/src/superblocks/hfs.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/hfs.c.kzak	2013-04-08 17:55:40.251856150 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/hfs.c	2014-03-28 15:11:44.680552016 +0100
0b5e55
@@ -154,7 +154,7 @@ static int probe_hfs(blkid_probe pr, con
0b5e55
 
0b5e55
 	hfs = blkid_probe_get_sb(pr, mag, struct hfs_mdb);
0b5e55
 	if (!hfs)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	if ((memcmp(hfs->embed_sig, "H+", 2) == 0) ||
0b5e55
 	    (memcmp(hfs->embed_sig, "HX", 2) == 0))
0b5e55
@@ -193,7 +193,7 @@ static int probe_hfsplus(blkid_probe pr,
0b5e55
 
0b5e55
 	sbd = blkid_probe_get_sb(pr, mag, struct hfs_mdb);
0b5e55
 	if (!sbd)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	/* Check for a HFS+ volume embedded in a HFS volume */
0b5e55
 	if (memcmp(sbd->signature, "BD", 2) == 0) {
0b5e55
@@ -218,7 +218,7 @@ static int probe_hfsplus(blkid_probe pr,
0b5e55
 				struct hfsplus_vol_header);
0b5e55
 
0b5e55
 	if (!hfsplus)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	if ((memcmp(hfsplus->signature, "H+", 2) != 0) &&
0b5e55
 	    (memcmp(hfsplus->signature, "HX", 2) != 0))
0b5e55
@@ -228,7 +228,7 @@ static int probe_hfsplus(blkid_probe pr,
0b5e55
 
0b5e55
 	blocksize = be32_to_cpu(hfsplus->blocksize);
0b5e55
 	if (blocksize < HFSPLUS_SECTOR_SIZE)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	memcpy(extents, hfsplus->cat_file.extents, sizeof(extents));
0b5e55
 	cat_block = be32_to_cpu(extents[0].start_block);
0b5e55
@@ -236,7 +236,7 @@ static int probe_hfsplus(blkid_probe pr,
0b5e55
 	buf = blkid_probe_get_buffer(pr,
0b5e55
 			off + ((blkid_loff_t) cat_block * blocksize), 0x2000);
0b5e55
 	if (!buf)
0b5e55
-		return 0;
0b5e55
+		return errno ? -errno : 0;
0b5e55
 
0b5e55
 	bnode = (struct hfsplus_bheader_record *)
0b5e55
 		&buf[sizeof(struct hfsplus_bnode_descriptor)];
0b5e55
@@ -271,7 +271,7 @@ static int probe_hfsplus(blkid_probe pr,
0b5e55
 				(blkid_loff_t) off + leaf_off,
0b5e55
 				leaf_node_size);
0b5e55
 	if (!buf)
0b5e55
-		return 0;
0b5e55
+		return errno ? -errno : 0;
0b5e55
 
0b5e55
 	descr = (struct hfsplus_bnode_descriptor *) buf;
0b5e55
 	record_count = be16_to_cpu(descr->num_recs);
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/highpoint_raid.c.kzak util-linux-2.23.2/libblkid/src/superblocks/highpoint_raid.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/highpoint_raid.c.kzak	2013-04-08 17:55:40.251856150 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/highpoint_raid.c	2014-03-28 15:11:44.680552016 +0100
0b5e55
@@ -30,9 +30,9 @@ static int probe_highpoint45x(blkid_prob
0b5e55
 	uint32_t magic;
0b5e55
 
0b5e55
 	if (pr->size < 0x10000)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (!S_ISREG(pr->mode) && !blkid_probe_is_wholedisk(pr))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	off = ((pr->size / 0x200) - 11) * 0x200;
0b5e55
 	hpt = (struct hpt45x_metadata *)
0b5e55
@@ -40,13 +40,13 @@ static int probe_highpoint45x(blkid_prob
0b5e55
 					off,
0b5e55
 					sizeof(struct hpt45x_metadata));
0b5e55
 	if (!hpt)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 	magic = le32_to_cpu(hpt->magic);
0b5e55
 	if (magic != HPT45X_MAGIC_OK && magic != HPT45X_MAGIC_BAD)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (blkid_probe_set_magic(pr, off, sizeof(hpt->magic),
0b5e55
 				(unsigned char *) &hpt->magic))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	return 0;
0b5e55
 }
0b5e55
 
0b5e55
@@ -54,7 +54,7 @@ static int probe_highpoint37x(blkid_prob
0b5e55
 		const struct blkid_idmag *mag __attribute__((__unused__)))
0b5e55
 {
0b5e55
 	if (!S_ISREG(pr->mode) && !blkid_probe_is_wholedisk(pr))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	return 0;
0b5e55
 }
0b5e55
 
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/hpfs.c.kzak util-linux-2.23.2/libblkid/src/superblocks/hpfs.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/hpfs.c.kzak	2013-04-08 17:55:40.252856159 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/hpfs.c	2014-03-28 15:11:44.680552016 +0100
0b5e55
@@ -68,7 +68,7 @@ static int probe_hpfs(blkid_probe pr, co
0b5e55
 	/* super block */
0b5e55
 	hs = blkid_probe_get_sb(pr, mag, struct hpfs_super_block);
0b5e55
 	if (!hs)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 	version = hs->version;
0b5e55
 
0b5e55
 	/* spare super block */
0b5e55
@@ -77,9 +77,9 @@ static int probe_hpfs(blkid_probe pr, co
0b5e55
 				HPFS_SBSPARE_OFFSET,
0b5e55
 				sizeof(struct hpfs_spare_super));
0b5e55
 	if (!hss)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 	if (memcmp(hss->magic, "\x49\x18\x91\xf9", 4) != 0)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	/* boot block (with UUID and LABEL) */
0b5e55
 	hbb = (struct hpfs_boot_block *)
0b5e55
@@ -87,7 +87,7 @@ static int probe_hpfs(blkid_probe pr, co
0b5e55
 				0,
0b5e55
 				sizeof(struct hpfs_boot_block));
0b5e55
 	if (!hbb)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 	if (memcmp(hbb->magic, "\x55\xaa", 2) == 0 &&
0b5e55
 	    memcmp(hbb->sig_hpfs, "HPFS", 4) == 0 &&
0b5e55
 	    hbb->sig_28h == 0x28) {
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/iso9660.c.kzak util-linux-2.23.2/libblkid/src/superblocks/iso9660.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/iso9660.c.kzak	2013-06-13 09:46:10.422650639 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/iso9660.c	2014-03-28 15:11:44.680552016 +0100
0b5e55
@@ -100,7 +100,7 @@ static int probe_iso9660_hsfs(blkid_prob
0b5e55
 
0b5e55
 	iso = blkid_probe_get_sb(pr, mag, struct high_sierra_volume_descriptor);
0b5e55
 	if (!iso)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	blkid_probe_set_version(pr, "High Sierra");
0b5e55
 	blkid_probe_set_label(pr, iso->volume_id, sizeof(iso->volume_id));
0b5e55
@@ -178,7 +178,7 @@ int probe_iso9660(blkid_probe pr, const
0b5e55
 
0b5e55
 	iso = blkid_probe_get_sb(pr, mag, struct iso_volume_descriptor);
0b5e55
 	if (!iso)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	memcpy(label, iso->volume_id, sizeof(label));
0b5e55
 
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/isw_raid.c.kzak util-linux-2.23.2/libblkid/src/superblocks/isw_raid.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/isw_raid.c.kzak	2013-04-08 17:55:40.252856159 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/isw_raid.c	2014-03-28 15:11:44.680552016 +0100
0b5e55
@@ -33,9 +33,9 @@ static int probe_iswraid(blkid_probe pr,
0b5e55
 	struct isw_metadata *isw;
0b5e55
 
0b5e55
 	if (pr->size < 0x10000)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (!S_ISREG(pr->mode) && !blkid_probe_is_wholedisk(pr))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	off = ((pr->size / 0x200) - 2) * 0x200;
0b5e55
 	isw = (struct isw_metadata *)
0b5e55
@@ -43,15 +43,16 @@ static int probe_iswraid(blkid_probe pr,
0b5e55
 					off,
0b5e55
 					sizeof(struct isw_metadata));
0b5e55
 	if (!isw)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
+
0b5e55
 	if (memcmp(isw->sig, ISW_SIGNATURE, sizeof(ISW_SIGNATURE)-1) != 0)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (blkid_probe_sprintf_version(pr, "%6s",
0b5e55
 			&isw->sig[sizeof(ISW_SIGNATURE)-1]) != 0)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (blkid_probe_set_magic(pr, off, sizeof(isw->sig),
0b5e55
 				(unsigned char *) isw->sig))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	return 0;
0b5e55
 }
0b5e55
 
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/jfs.c.kzak util-linux-2.23.2/libblkid/src/superblocks/jfs.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/jfs.c.kzak	2013-04-08 17:55:40.253856169 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/jfs.c	2014-03-28 15:11:44.681552026 +0100
0b5e55
@@ -40,7 +40,7 @@ static int probe_jfs(blkid_probe pr, con
0b5e55
 
0b5e55
 	js = blkid_probe_get_sb(pr, mag, struct jfs_super_block);
0b5e55
 	if (!js)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 	if (le32_to_cpu(js->js_bsize) != (1U << le16_to_cpu(js->js_l2bsize)))
0b5e55
 		return 1;
0b5e55
 	if (le32_to_cpu(js->js_pbsize) != (1U << le16_to_cpu(js->js_l2pbsize)))
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/jmicron_raid.c.kzak util-linux-2.23.2/libblkid/src/superblocks/jmicron_raid.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/jmicron_raid.c.kzak	2013-04-08 17:55:40.253856169 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/jmicron_raid.c	2014-03-28 15:11:44.681552026 +0100
0b5e55
@@ -32,9 +32,9 @@ static int probe_jmraid(blkid_probe pr,
0b5e55
 	struct jm_metadata *jm;
0b5e55
 
0b5e55
 	if (pr->size < 0x10000)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (!S_ISREG(pr->mode) && !blkid_probe_is_wholedisk(pr))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	off = ((pr->size / 0x200) - 1) * 0x200;
0b5e55
 	jm = (struct jm_metadata *)
0b5e55
@@ -42,15 +42,16 @@ static int probe_jmraid(blkid_probe pr,
0b5e55
 				off,
0b5e55
 				sizeof(struct jm_metadata));
0b5e55
 	if (!jm)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
+
0b5e55
 	if (memcmp(jm->signature, JM_SIGNATURE, sizeof(JM_SIGNATURE) - 1) != 0)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (blkid_probe_sprintf_version(pr, "%u.%u",
0b5e55
 				jm->major_version, jm->minor_version) != 0)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (blkid_probe_set_magic(pr, off, sizeof(jm->signature),
0b5e55
 				(unsigned char *) jm->signature))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	return 0;
0b5e55
 }
0b5e55
 
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/linux_raid.c.kzak util-linux-2.23.2/libblkid/src/superblocks/linux_raid.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/linux_raid.c.kzak	2013-04-08 17:55:40.253856169 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/linux_raid.c	2014-03-28 15:11:44.681552026 +0100
0b5e55
@@ -110,13 +110,13 @@ static int probe_raid0(blkid_probe pr, b
0b5e55
 	uint64_t size;
0b5e55
 
0b5e55
 	if (pr->size < MD_RESERVED_BYTES)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	mdp0 = (struct mdp0_super_block *)
0b5e55
 			blkid_probe_get_buffer(pr,
0b5e55
 				off,
0b5e55
 				sizeof(struct mdp0_super_block));
0b5e55
 	if (!mdp0)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	memset(uuid.ints, 0, sizeof(uuid.ints));
0b5e55
 
0b5e55
@@ -173,12 +173,12 @@ static int probe_raid0(blkid_probe pr, b
0b5e55
 	}
0b5e55
 
0b5e55
 	if (blkid_probe_sprintf_version(pr, "%u.%u.%u", ma, mi, pa) != 0)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (blkid_probe_set_uuid(pr, (unsigned char *) uuid.bytes) != 0)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (blkid_probe_set_magic(pr, off, sizeof(mdp0->md_magic),
0b5e55
 				(unsigned char *) &mdp0->md_magic))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	return 0;
0b5e55
 }
0b5e55
 
0b5e55
@@ -191,24 +191,24 @@ static int probe_raid1(blkid_probe pr, o
0b5e55
 				off,
0b5e55
 				sizeof(struct mdp1_super_block));
0b5e55
 	if (!mdp1)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 	if (le32_to_cpu(mdp1->magic) != MD_SB_MAGIC)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (le32_to_cpu(mdp1->major_version) != 1U)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (le64_to_cpu(mdp1->super_offset) != (uint64_t) off >> 9)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (blkid_probe_set_uuid(pr, (unsigned char *) mdp1->set_uuid) != 0)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (blkid_probe_set_uuid_as(pr,
0b5e55
 			(unsigned char *) mdp1->device_uuid, "UUID_SUB") != 0)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (blkid_probe_set_label(pr, mdp1->set_name,
0b5e55
 				sizeof(mdp1->set_name)) != 0)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (blkid_probe_set_magic(pr, off, sizeof(mdp1->magic),
0b5e55
 				(unsigned char *) &mdp1->magic))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	return 0;
0b5e55
 }
0b5e55
 
0b5e55
@@ -216,35 +216,44 @@ int probe_raid(blkid_probe pr,
0b5e55
 		const struct blkid_idmag *mag __attribute__((__unused__)))
0b5e55
 {
0b5e55
 	const char *ver = NULL;
0b5e55
+	int ret = BLKID_PROBE_NONE;
0b5e55
 
0b5e55
 	if (pr->size > MD_RESERVED_BYTES) {
0b5e55
 		/* version 0 at the end of the device */
0b5e55
 		uint64_t sboff = (pr->size & ~(MD_RESERVED_BYTES - 1))
0b5e55
-			         - MD_RESERVED_BYTES;
0b5e55
-		if (probe_raid0(pr, sboff) == 0)
0b5e55
-			return 0;
0b5e55
+			- MD_RESERVED_BYTES;
0b5e55
+		ret = probe_raid0(pr, sboff);
0b5e55
+		if (ret < 1)
0b5e55
+			return ret;	/* error */
0b5e55
 
0b5e55
 		/* version 1.0 at the end of the device */
0b5e55
 		sboff = (pr->size & ~(0x1000 - 1)) - 0x2000;
0b5e55
-		if (probe_raid1(pr, sboff) == 0)
0b5e55
+		ret = probe_raid1(pr, sboff);
0b5e55
+		if (ret < 0)
0b5e55
+			return ret;	/* error */
0b5e55
+		if (ret == 0)
0b5e55
 			ver = "1.0";
0b5e55
 	}
0b5e55
 
0b5e55
 	if (!ver) {
0b5e55
 		/* version 1.1 at the start of the device */
0b5e55
-		if (probe_raid1(pr, 0) == 0)
0b5e55
+		ret = probe_raid1(pr, 0);
0b5e55
+		if (ret == 0)
0b5e55
 			ver = "1.1";
0b5e55
 
0b5e55
 		/* version 1.2 at 4k offset from the start */
0b5e55
-		else if (probe_raid1(pr, 0x1000) == 0)
0b5e55
-			ver = "1.2";
0b5e55
+		else if (ret == BLKID_PROBE_NONE) {
0b5e55
+			ret = probe_raid1(pr, 0x1000);
0b5e55
+			if (ret == 0)
0b5e55
+				ver = "1.2";
0b5e55
+		}
0b5e55
 	}
0b5e55
 
0b5e55
 	if (ver) {
0b5e55
 		blkid_probe_set_version(pr, ver);
0b5e55
-		return 0;
0b5e55
+		return BLKID_PROBE_OK;
0b5e55
 	}
0b5e55
-	return -1;
0b5e55
+	return ret;
0b5e55
 }
0b5e55
 
0b5e55
 
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/lsi_raid.c.kzak util-linux-2.23.2/libblkid/src/superblocks/lsi_raid.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/lsi_raid.c.kzak	2013-04-08 17:55:40.254856179 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/lsi_raid.c	2014-03-28 15:11:44.681552026 +0100
0b5e55
@@ -30,9 +30,9 @@ static int probe_lsiraid(blkid_probe pr,
0b5e55
 	struct lsi_metadata *lsi;
0b5e55
 
0b5e55
 	if (pr->size < 0x10000)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (!S_ISREG(pr->mode) && !blkid_probe_is_wholedisk(pr))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	off = ((pr->size / 0x200) - 1) * 0x200;
0b5e55
 	lsi = (struct lsi_metadata *)
0b5e55
@@ -40,13 +40,13 @@ static int probe_lsiraid(blkid_probe pr,
0b5e55
 				off,
0b5e55
 				sizeof(struct lsi_metadata));
0b5e55
 	if (!lsi)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	if (memcmp(lsi->sig, LSI_SIGNATURE, sizeof(LSI_SIGNATURE)-1) != 0)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (blkid_probe_set_magic(pr, off, sizeof(lsi->sig),
0b5e55
 				(unsigned char *) lsi->sig))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	return 0;
0b5e55
 }
0b5e55
 
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/luks.c.kzak util-linux-2.23.2/libblkid/src/superblocks/luks.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/luks.c.kzak	2013-04-08 17:55:40.254856179 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/luks.c	2014-03-28 15:11:44.681552026 +0100
0b5e55
@@ -45,7 +45,7 @@ static int probe_luks(blkid_probe pr, co
0b5e55
 
0b5e55
 	header = blkid_probe_get_sb(pr, mag, struct luks_phdr);
0b5e55
 	if (header == NULL)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	blkid_probe_strncpy_uuid(pr, (unsigned char *) header->uuid,
0b5e55
 			sizeof(header->uuid));
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/lvm.c.kzak util-linux-2.23.2/libblkid/src/superblocks/lvm.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/lvm.c.kzak	2013-06-13 09:46:10.422650639 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/lvm.c	2014-03-28 15:11:44.681552026 +0100
0b5e55
@@ -82,7 +82,7 @@ static int probe_lvm2(blkid_probe pr, co
0b5e55
 			mag->kboff << 10,
0b5e55
 			512 + sizeof(struct lvm2_pv_label_header));
0b5e55
 	if (!buf)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	/* buf is at 0k or 1k offset; find label inside */
0b5e55
 	if (memcmp(buf, "LABELONE", 8) == 0) {
0b5e55
@@ -129,7 +129,7 @@ static int probe_lvm1(blkid_probe pr, co
0b5e55
 
0b5e55
 	label = blkid_probe_get_sb(pr, mag, struct lvm1_pv_label_header);
0b5e55
 	if (!label)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	version = le16_to_cpu(label->version);
0b5e55
 	if (version != 1 && version != 2)
0b5e55
@@ -164,7 +164,7 @@ static int probe_verity(blkid_probe pr,
0b5e55
 
0b5e55
 	sb = blkid_probe_get_sb(pr, mag, struct verity_sb);
0b5e55
 	if (sb == NULL)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	version = le32_to_cpu(sb->version);
0b5e55
 	if (version != 1)
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/minix.c.kzak util-linux-2.23.2/libblkid/src/superblocks/minix.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/minix.c.kzak	2013-06-13 09:46:10.423650647 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/minix.c	2014-03-28 15:11:44.681552026 +0100
0b5e55
@@ -80,17 +80,17 @@ static int probe_minix(blkid_probe pr, c
0b5e55
 			max(sizeof(struct minix_super_block),
0b5e55
 			    sizeof(struct minix3_super_block)));
0b5e55
 	if (!data)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 	version = get_minix_version(data, &swabme);
0b5e55
 	if (version < 1)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	if (version <= 2) {
0b5e55
 		struct minix_super_block *sb = (struct minix_super_block *) data;
0b5e55
 		int zones, ninodes, imaps, zmaps, firstz;
0b5e55
 
0b5e55
 		if (sb->s_imap_blocks == 0 || sb->s_zmap_blocks == 0)
0b5e55
-			return -1;
0b5e55
+			return 1;
0b5e55
 
0b5e55
 		zones = version == 2 ? minix_swab32(swabme, sb->s_zones) :
0b5e55
 				       minix_swab16(swabme, sb->s_nzones);
0b5e55
@@ -101,15 +101,15 @@ static int probe_minix(blkid_probe pr, c
0b5e55
 
0b5e55
 		/* sanity checks to be sure that the FS is really minix */
0b5e55
 		if (imaps * MINIX_BLOCK_SIZE * 8 < ninodes + 1)
0b5e55
-			return -1;
0b5e55
+			return 1;
0b5e55
 		if (zmaps * MINIX_BLOCK_SIZE * 8 < zones - firstz + 1)
0b5e55
-			return -1;
0b5e55
+			return 1;
0b5e55
 
0b5e55
 	} else if (version == 3) {
0b5e55
 		struct minix3_super_block *sb = (struct minix3_super_block *) data;
0b5e55
 
0b5e55
 		if (sb->s_imap_blocks == 0 || sb->s_zmap_blocks == 0)
0b5e55
-			return -1;
0b5e55
+			return 1;
0b5e55
 	}
0b5e55
 
0b5e55
 	/* unfortunately, some parts of ext3 is sometimes possible to
0b5e55
@@ -117,8 +117,10 @@ static int probe_minix(blkid_probe pr, c
0b5e55
 	 * string. (For extN magic string and offsets see ext.c.)
0b5e55
 	 */
0b5e55
 	ext = blkid_probe_get_buffer(pr, 0x400 + 0x38, 2);
0b5e55
-	if (ext && memcmp(ext, "\123\357", 2) == 0)
0b5e55
-		return -1;
0b5e55
+	if (!ext)
0b5e55
+		return errno ? -errno : 1;
0b5e55
+	else if (memcmp(ext, "\123\357", 2) == 0)
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	blkid_probe_sprintf_version(pr, "%d", version);
0b5e55
 	return 0;
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/netware.c.kzak util-linux-2.23.2/libblkid/src/superblocks/netware.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/netware.c.kzak	2013-04-08 17:55:40.255856188 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/netware.c	2014-03-28 15:11:44.681552026 +0100
0b5e55
@@ -71,7 +71,7 @@ static int probe_netware(blkid_probe pr,
0b5e55
 
0b5e55
 	nw = blkid_probe_get_sb(pr, mag, struct netware_super_block);
0b5e55
 	if (!nw)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	blkid_probe_set_uuid(pr, nw->SBH_PoolID);
0b5e55
 
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/nilfs.c.kzak util-linux-2.23.2/libblkid/src/superblocks/nilfs.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/nilfs.c.kzak	2013-04-08 17:55:40.256856198 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/nilfs.c	2014-03-28 15:11:44.681552026 +0100
0b5e55
@@ -82,7 +82,7 @@ static int probe_nilfs2(blkid_probe pr,
0b5e55
 
0b5e55
 	sb = blkid_probe_get_sb(pr, mag, struct nilfs_super_block);
0b5e55
 	if (!sb)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	bytes = le16_to_cpu(sb->s_bytes);
0b5e55
 	crc = crc32(le32_to_cpu(sb->s_crc_seed), (unsigned char *)sb, sumoff);
0b5e55
@@ -90,7 +90,7 @@ static int probe_nilfs2(blkid_probe pr,
0b5e55
 	crc = crc32(crc, (unsigned char *)sb + sumoff + 4, bytes - sumoff - 4);
0b5e55
 
0b5e55
 	if (crc != le32_to_cpu(sb->s_sum))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	if (strlen(sb->s_volume_name))
0b5e55
 		blkid_probe_set_label(pr, (unsigned char *) sb->s_volume_name,
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/ntfs.c.kzak util-linux-2.23.2/libblkid/src/superblocks/ntfs.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/ntfs.c.kzak	2013-06-13 09:46:10.423650647 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/ntfs.c	2014-03-28 15:11:44.681552026 +0100
0b5e55
@@ -91,7 +91,7 @@ static int probe_ntfs(blkid_probe pr, co
0b5e55
 
0b5e55
 	ns = blkid_probe_get_sb(pr, mag, struct ntfs_super_block);
0b5e55
 	if (!ns)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	/*
0b5e55
 	 * Check bios parameters block
0b5e55
@@ -158,7 +158,7 @@ static int probe_ntfs(blkid_probe pr, co
0b5e55
 
0b5e55
 	buf_mft = blkid_probe_get_buffer(pr, off, mft_record_size);
0b5e55
 	if (!buf_mft)
0b5e55
-		return 1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	if (memcmp(buf_mft, "FILE", 4))
0b5e55
 		return 1;
0b5e55
@@ -167,7 +167,7 @@ static int probe_ntfs(blkid_probe pr, co
0b5e55
 
0b5e55
 	buf_mft = blkid_probe_get_buffer(pr, off, mft_record_size);
0b5e55
 	if (!buf_mft)
0b5e55
-		return 1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	if (memcmp(buf_mft, "FILE", 4))
0b5e55
 		return 1;
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/nvidia_raid.c.kzak util-linux-2.23.2/libblkid/src/superblocks/nvidia_raid.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/nvidia_raid.c.kzak	2013-04-08 17:55:40.257856207 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/nvidia_raid.c	2014-03-28 15:11:44.682552036 +0100
0b5e55
@@ -32,9 +32,9 @@ static int probe_nvraid(blkid_probe pr,
0b5e55
 	struct nv_metadata *nv;
0b5e55
 
0b5e55
 	if (pr->size < 0x10000)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (!S_ISREG(pr->mode) && !blkid_probe_is_wholedisk(pr))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	off = ((pr->size / 0x200) - 2) * 0x200;
0b5e55
 	nv = (struct nv_metadata *)
0b5e55
@@ -42,15 +42,15 @@ static int probe_nvraid(blkid_probe pr,
0b5e55
 				off,
0b5e55
 				sizeof(struct nv_metadata));
0b5e55
 	if (!nv)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	if (memcmp(nv->vendor, NVIDIA_SIGNATURE, sizeof(NVIDIA_SIGNATURE)-1) != 0)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (blkid_probe_sprintf_version(pr, "%u", le16_to_cpu(nv->version)) != 0)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (blkid_probe_set_magic(pr, off, sizeof(nv->vendor),
0b5e55
 				(unsigned char *) nv->vendor))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	return 0;
0b5e55
 }
0b5e55
 
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/ocfs.c.kzak util-linux-2.23.2/libblkid/src/superblocks/ocfs.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/ocfs.c.kzak	2013-04-08 17:55:40.257856207 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/ocfs.c	2014-03-28 15:11:44.682552036 +0100
0b5e55
@@ -109,14 +109,14 @@ static int probe_ocfs(blkid_probe pr, co
0b5e55
 	buf = blkid_probe_get_buffer(pr, mag->kboff << 10,
0b5e55
 			sizeof(struct ocfs_volume_header));
0b5e55
 	if (!buf)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 	memcpy(&ovh, buf, sizeof(ovh));
0b5e55
 
0b5e55
 	/* label */
0b5e55
 	buf = blkid_probe_get_buffer(pr, (mag->kboff << 10) + 512,
0b5e55
 			sizeof(struct ocfs_volume_label));
0b5e55
 	if (!buf)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 	memcpy(&ovl, buf, sizeof(ovl));
0b5e55
 
0b5e55
 	maj = ocfsmajor(ovh);
0b5e55
@@ -144,7 +144,7 @@ static int probe_ocfs2(blkid_probe pr, c
0b5e55
 
0b5e55
 	osb = blkid_probe_get_sb(pr, mag, struct ocfs2_super_block);
0b5e55
 	if (!osb)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	blkid_probe_set_label(pr, (unsigned char *) osb->s_label, sizeof(osb->s_label));
0b5e55
 	blkid_probe_set_uuid(pr, osb->s_uuid);
0b5e55
@@ -162,7 +162,7 @@ static int probe_oracleasm(blkid_probe p
0b5e55
 
0b5e55
 	dl = blkid_probe_get_sb(pr, mag, struct oracle_asm_disk_label);
0b5e55
 	if (!dl)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	blkid_probe_set_label(pr, (unsigned char *) dl->dl_id, sizeof(dl->dl_id));
0b5e55
 	return 0;
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/promise_raid.c.kzak util-linux-2.23.2/libblkid/src/superblocks/promise_raid.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/promise_raid.c.kzak	2013-06-13 09:46:10.423650647 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/promise_raid.c	2014-03-28 15:11:44.682552036 +0100
0b5e55
@@ -33,9 +33,9 @@ static int probe_pdcraid(blkid_probe pr,
0b5e55
 	};
0b5e55
 
0b5e55
 	if (pr->size < 0x40000)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (!S_ISREG(pr->mode) && !blkid_probe_is_wholedisk(pr))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	for (i = 0; sectors[i] != 0; i++) {
0b5e55
 		uint64_t off;
0b5e55
@@ -47,18 +47,18 @@ static int probe_pdcraid(blkid_probe pr,
0b5e55
 					off,
0b5e55
 					sizeof(struct promise_metadata));
0b5e55
 		if (!pdc)
0b5e55
-			return -1;
0b5e55
+			return errno ? -errno : 1;
0b5e55
 
0b5e55
 		if (memcmp(pdc->sig, PDC_SIGNATURE,
0b5e55
 				sizeof(PDC_SIGNATURE) - 1) == 0) {
0b5e55
 
0b5e55
 			if (blkid_probe_set_magic(pr, off, sizeof(pdc->sig),
0b5e55
 						(unsigned char *) pdc->sig))
0b5e55
-				return -1;
0b5e55
+				return 1;
0b5e55
 			return 0;
0b5e55
 		}
0b5e55
 	}
0b5e55
-	return -1;
0b5e55
+	return 1;
0b5e55
 }
0b5e55
 
0b5e55
 const struct blkid_idinfo pdcraid_idinfo = {
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/reiserfs.c.kzak util-linux-2.23.2/libblkid/src/superblocks/reiserfs.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/reiserfs.c.kzak	2013-04-08 17:55:40.258856216 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/reiserfs.c	2014-03-28 15:11:44.682552036 +0100
0b5e55
@@ -45,17 +45,17 @@ static int probe_reiser(blkid_probe pr,
0b5e55
 
0b5e55
 	rs = blkid_probe_get_sb(pr, mag, struct reiserfs_super_block);
0b5e55
 	if (!rs)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	blocksize = le16_to_cpu(rs->rs_blocksize);
0b5e55
 
0b5e55
 	/* The blocksize must be at least 512B */
0b5e55
 	if ((blocksize >> 9) == 0)
0b5e55
-		return -BLKID_ERR_PARAM;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	/* If the superblock is inside the journal, we have the wrong one */
0b5e55
 	if (mag->kboff / (blocksize >> 9) > le32_to_cpu(rs->rs_journal_block) / 2)
0b5e55
-		return -BLKID_ERR_BIG;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	/* LABEL/UUID are only valid for later versions of Reiserfs v3.6. */
0b5e55
 	if (mag->magic[6] == '2' || mag->magic[6] == '3') {
0b5e55
@@ -82,7 +82,7 @@ static int probe_reiser4(blkid_probe pr,
0b5e55
 
0b5e55
 	rs4 = blkid_probe_get_sb(pr, mag, struct reiser4_super_block);
0b5e55
 	if (!rs4)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	if (*rs4->rs4_label)
0b5e55
 		blkid_probe_set_label(pr, rs4->rs4_label, sizeof(rs4->rs4_label));
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/romfs.c.kzak util-linux-2.23.2/libblkid/src/superblocks/romfs.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/romfs.c.kzak	2013-04-08 17:55:40.258856216 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/romfs.c	2014-03-28 15:11:44.682552036 +0100
0b5e55
@@ -29,7 +29,7 @@ static int probe_romfs(blkid_probe pr, c
0b5e55
 
0b5e55
 	ros = blkid_probe_get_sb(pr, mag, struct romfs_super_block);
0b5e55
 	if (!ros)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	if (strlen((char *) ros->ros_volume))
0b5e55
 		blkid_probe_set_label(pr, ros->ros_volume,
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/silicon_raid.c.kzak util-linux-2.23.2/libblkid/src/superblocks/silicon_raid.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/silicon_raid.c.kzak	2013-06-13 09:46:10.424650656 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/silicon_raid.c	2014-03-28 15:11:44.682552036 +0100
0b5e55
@@ -88,9 +88,9 @@ static int probe_silraid(blkid_probe pr,
0b5e55
 	struct silicon_metadata *sil;
0b5e55
 
0b5e55
 	if (pr->size < 0x10000)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (!S_ISREG(pr->mode) && !blkid_probe_is_wholedisk(pr))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	off = ((pr->size / 0x200) - 1) * 0x200;
0b5e55
 
0b5e55
@@ -98,27 +98,27 @@ static int probe_silraid(blkid_probe pr,
0b5e55
 			blkid_probe_get_buffer(pr, off,
0b5e55
 				sizeof(struct silicon_metadata));
0b5e55
 	if (!sil)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	if (le32_to_cpu(sil->magic) != SILICON_MAGIC)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (sil->disk_number >= 8)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (!checksum(sil)) {
0b5e55
 		DBG(LOWPROBE, blkid_debug("silicon raid: incorrect checksum"));
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	}
0b5e55
 
0b5e55
 	if (blkid_probe_sprintf_version(pr, "%u.%u",
0b5e55
 				le16_to_cpu(sil->major_ver),
0b5e55
 				le16_to_cpu(sil->minor_ver)) != 0)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	if (blkid_probe_set_magic(pr,
0b5e55
 			off + offsetof(struct silicon_metadata, magic),
0b5e55
 			sizeof(sil->magic),
0b5e55
 			(unsigned char *) &sil->magic))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	return 0;
0b5e55
 }
0b5e55
 
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/squashfs.c.kzak util-linux-2.23.2/libblkid/src/superblocks/squashfs.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/squashfs.c.kzak	2013-04-08 17:55:40.258856216 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/squashfs.c	2014-03-28 15:11:44.682552036 +0100
0b5e55
@@ -34,7 +34,7 @@ static int probe_squashfs(blkid_probe pr
0b5e55
 
0b5e55
 	sq = blkid_probe_get_sb(pr, mag, struct sqsh_super_block);
0b5e55
 	if (!sq)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	if (strcmp(mag->magic, "sqsh") == 0 ||
0b5e55
 	    strcmp(mag->magic, "qshs") == 0)
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/superblocks.c.kzak util-linux-2.23.2/libblkid/src/superblocks/superblocks.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/superblocks.c.kzak	2013-07-30 10:39:26.209738269 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/superblocks.c	2014-03-28 15:11:44.682552036 +0100
0b5e55
@@ -331,9 +331,10 @@ int blkid_superblocks_get_name(size_t id
0b5e55
 static int superblocks_probe(blkid_probe pr, struct blkid_chain *chn)
0b5e55
 {
0b5e55
 	size_t i;
0b5e55
+	int rc = BLKID_PROBE_NONE;
0b5e55
 
0b5e55
 	if (!pr || chn->idx < -1)
0b5e55
-		return -1;
0b5e55
+		return -EINVAL;
0b5e55
 	blkid_probe_chain_reset_vals(pr, chn);
0b5e55
 
0b5e55
 	DBG(LOWPROBE, blkid_debug("--> starting probing loop [SUBLKS idx=%d]",
0b5e55
@@ -351,38 +352,50 @@ static int superblocks_probe(blkid_probe
0b5e55
 		const struct blkid_idinfo *id;
0b5e55
 		const struct blkid_idmag *mag = NULL;
0b5e55
 		blkid_loff_t off = 0;
0b5e55
-		int rc = 0;
0b5e55
 
0b5e55
 		chn->idx = i;
0b5e55
 		id = idinfos[i];
0b5e55
 
0b5e55
 		if (chn->fltr && blkid_bmp_get_item(chn->fltr, i)) {
0b5e55
 			DBG(LOWPROBE, blkid_debug("filter out: %s", id->name));
0b5e55
+			rc = BLKID_PROBE_NONE;
0b5e55
 			continue;
0b5e55
 		}
0b5e55
 
0b5e55
-		if (id->minsz && id->minsz > pr->size)
0b5e55
+		if (id->minsz && id->minsz > pr->size) {
0b5e55
+			rc = BLKID_PROBE_NONE;
0b5e55
 			continue;	/* the device is too small */
0b5e55
+		}
0b5e55
 
0b5e55
 		/* don't probe for RAIDs, swap or journal on CD/DVDs */
0b5e55
 		if ((id->usage & (BLKID_USAGE_RAID | BLKID_USAGE_OTHER)) &&
0b5e55
-		    blkid_probe_is_cdrom(pr))
0b5e55
+		    blkid_probe_is_cdrom(pr)) {
0b5e55
+			rc = BLKID_PROBE_NONE;
0b5e55
 			continue;
0b5e55
+		}
0b5e55
 
0b5e55
 		/* don't probe for RAIDs on floppies */
0b5e55
-		if ((id->usage & BLKID_USAGE_RAID) && blkid_probe_is_tiny(pr))
0b5e55
+		if ((id->usage & BLKID_USAGE_RAID) && blkid_probe_is_tiny(pr)) {
0b5e55
+			rc = BLKID_PROBE_NONE;
0b5e55
 			continue;
0b5e55
+		}
0b5e55
 
0b5e55
 		DBG(LOWPROBE, blkid_debug("[%zd] %s:", i, id->name));
0b5e55
 
0b5e55
-		if (blkid_probe_get_idmag(pr, id, &off, &mag))
0b5e55
+		rc = blkid_probe_get_idmag(pr, id, &off, &mag;;
0b5e55
+		if (rc < 0)
0b5e55
+			break;
0b5e55
+		if (rc != BLKID_PROBE_OK)
0b5e55
 			continue;
0b5e55
 
0b5e55
 		/* final check by probing function */
0b5e55
 		if (id->probefunc) {
0b5e55
 			DBG(LOWPROBE, blkid_debug("\tcall probefunc()"));
0b5e55
-			if (id->probefunc(pr, mag) != 0) {
0b5e55
+			rc = id->probefunc(pr, mag);
0b5e55
+			if (rc != BLKID_PROBE_OK) {
0b5e55
 				blkid_probe_chain_reset_vals(pr, chn);
0b5e55
+				if (rc < 0)
0b5e55
+					break;
0b5e55
 				continue;
0b5e55
 			}
0b5e55
 		}
0b5e55
@@ -407,13 +420,13 @@ static int superblocks_probe(blkid_probe
0b5e55
 
0b5e55
 		DBG(LOWPROBE, blkid_debug("<-- leaving probing loop (type=%s) [SUBLKS idx=%d]",
0b5e55
 			id->name, chn->idx));
0b5e55
-		return 0;
0b5e55
+		return BLKID_PROBE_OK;
0b5e55
 	}
0b5e55
 
0b5e55
 nothing:
0b5e55
-	DBG(LOWPROBE, blkid_debug("<-- leaving probing loop (failed) [SUBLKS idx=%d]",
0b5e55
-		chn->idx));
0b5e55
-	return 1;
0b5e55
+	DBG(LOWPROBE, blkid_debug("<-- leaving probing loop (failed=%d) [SUBLKS idx=%d]",
0b5e55
+			rc, chn->idx));
0b5e55
+	return rc;
0b5e55
 }
0b5e55
 
0b5e55
 /*
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/swap.c.kzak util-linux-2.23.2/libblkid/src/superblocks/swap.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/swap.c.kzak	2013-06-13 09:46:10.425650665 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/swap.c	2014-03-28 15:11:44.682552036 +0100
0b5e55
@@ -44,17 +44,17 @@ static int swap_set_info(blkid_probe pr,
0b5e55
 	hdr = (struct swap_header_v1_2 *) blkid_probe_get_buffer(pr, 1024,
0b5e55
 				sizeof(struct swap_header_v1_2));
0b5e55
 	if (!hdr)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	/* SWAPSPACE2 - check for wrong version or zeroed pagecount */
0b5e55
         if (strcmp(version, "2") == 0) {
0b5e55
 		if (hdr->version != 1 && swab32(hdr->version) != 1) {
0b5e55
 			DBG(LOWPROBE, blkid_debug("incorrect swap version"));
0b5e55
-			return -1;
0b5e55
+			return 1;
0b5e55
 		}
0b5e55
 		if (hdr->lastpage == 0) {
0b5e55
 			DBG(LOWPROBE, blkid_debug("not set last swap page"));
0b5e55
-			return -1;
0b5e55
+			return 1;
0b5e55
 		}
0b5e55
         }
0b5e55
 
0b5e55
@@ -62,9 +62,9 @@ static int swap_set_info(blkid_probe pr,
0b5e55
 	if (hdr->padding[32] == 0 && hdr->padding[33] == 0) {
0b5e55
 		if (hdr->volume[0] && blkid_probe_set_label(pr, hdr->volume,
0b5e55
 				sizeof(hdr->volume)) < 0)
0b5e55
-			return -1;
0b5e55
+			return 1;
0b5e55
 		if (blkid_probe_set_uuid(pr, hdr->uuid) < 0)
0b5e55
-			return -1;
0b5e55
+			return 1;
0b5e55
 	}
0b5e55
 
0b5e55
 	blkid_probe_set_version(pr, version);
0b5e55
@@ -76,12 +76,12 @@ static int probe_swap(blkid_probe pr, co
0b5e55
 	unsigned char *buf;
0b5e55
 
0b5e55
 	if (!mag)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	/* TuxOnIce keeps valid swap header at the end of the 1st page */
0b5e55
 	buf = blkid_probe_get_buffer(pr, 0, TOI_MAGIC_STRLEN);
0b5e55
 	if (!buf)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	if (memcmp(buf, TOI_MAGIC_STRING, TOI_MAGIC_STRLEN) == 0)
0b5e55
 		return 1;	/* Ignore swap signature, it's TuxOnIce */
0b5e55
@@ -94,13 +94,13 @@ static int probe_swap(blkid_probe pr, co
0b5e55
 	} else if (!memcmp(mag->magic, "SWAPSPACE2", mag->len))
0b5e55
 		return swap_set_info(pr, "2");
0b5e55
 
0b5e55
-	return -1;
0b5e55
+	return 1;
0b5e55
 }
0b5e55
 
0b5e55
 static int probe_swsuspend(blkid_probe pr, const struct blkid_idmag *mag)
0b5e55
 {
0b5e55
 	if (!mag)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (!memcmp(mag->magic, "S1SUSPEND", mag->len))
0b5e55
 		return swap_set_info(pr, "s1suspend");
0b5e55
 	if (!memcmp(mag->magic, "S2SUSPEND", mag->len))
0b5e55
@@ -112,7 +112,7 @@ static int probe_swsuspend(blkid_probe p
0b5e55
 	if (!memcmp(mag->magic, "LINHIB0001", mag->len))
0b5e55
 		return swap_set_info(pr, "linhib0001");
0b5e55
 
0b5e55
-	return -1;	/* no signature detected */
0b5e55
+	return 1;	/* no signature detected */
0b5e55
 }
0b5e55
 
0b5e55
 const struct blkid_idinfo swap_idinfo =
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/sysv.c.kzak util-linux-2.23.2/libblkid/src/superblocks/sysv.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/sysv.c.kzak	2013-04-08 17:55:40.261856245 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/sysv.c	2014-03-28 15:11:44.683552047 +0100
0b5e55
@@ -80,7 +80,7 @@ static int probe_xenix(blkid_probe pr, c
0b5e55
 
0b5e55
 	sb = blkid_probe_get_sb(pr, mag, struct xenix_super_block);
0b5e55
 	if (!sb)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 	blkid_probe_set_label(pr, sb->s_fname, sizeof(sb->s_fname));
0b5e55
 	return 0;
0b5e55
 }
0b5e55
@@ -105,21 +105,21 @@ static int probe_sysv(blkid_probe pr,
0b5e55
 					off,
0b5e55
 					sizeof(struct sysv_super_block));
0b5e55
 		if (!sb)
0b5e55
-			return -1;
0b5e55
+			return errno ? -errno : 1;
0b5e55
 
0b5e55
 		if (sb->s_magic == cpu_to_le32(0xfd187e20) ||
0b5e55
 		    sb->s_magic == cpu_to_be32(0xfd187e20)) {
0b5e55
 
0b5e55
 			if (blkid_probe_set_label(pr, sb->s_fname,
0b5e55
 						sizeof(sb->s_fname)))
0b5e55
-				return -1;
0b5e55
+				return 1;
0b5e55
 
0b5e55
 			if (blkid_probe_set_magic(pr,
0b5e55
 					off + offsetof(struct sysv_super_block,
0b5e55
 								s_magic),
0b5e55
 					sizeof(sb->s_magic),
0b5e55
 					(unsigned char *) &sb->s_magic))
0b5e55
-				return -1;
0b5e55
+				return 1;
0b5e55
 
0b5e55
 			return 0;
0b5e55
 		}
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/ubifs.c.kzak util-linux-2.23.2/libblkid/src/superblocks/ubifs.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/ubifs.c.kzak	2013-06-13 09:46:10.426650673 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/ubifs.c	2014-03-28 15:11:44.683552047 +0100
0b5e55
@@ -99,7 +99,7 @@ static int probe_ubifs(blkid_probe pr, c
0b5e55
 
0b5e55
 	sb = blkid_probe_get_sb(pr, mag, struct ubifs_sb_node);
0b5e55
 	if (!sb)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	blkid_probe_set_uuid(pr, sb->uuid);
0b5e55
 	blkid_probe_sprintf_version(pr, "w%dr%d",
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/udf.c.kzak util-linux-2.23.2/libblkid/src/superblocks/udf.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/udf.c.kzak	2013-06-13 09:46:10.426650673 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/udf.c	2014-03-28 15:11:44.683552047 +0100
0b5e55
@@ -85,11 +85,11 @@ static int probe_udf(blkid_probe pr,
0b5e55
 					UDF_VSD_OFFSET + b,
0b5e55
 					sizeof(*vsd));
0b5e55
 		if (!vsd)
0b5e55
-			return 1;
0b5e55
+			return errno ? -errno : 1;
0b5e55
 		if (vsd->id[0] != '\0')
0b5e55
 			goto nsr;
0b5e55
 	}
0b5e55
-	return -1;
0b5e55
+	return 1;
0b5e55
 
0b5e55
 nsr:
0b5e55
 	/* search the list of VSDs for a NSR descriptor */
0b5e55
@@ -99,15 +99,15 @@ nsr:
0b5e55
 					UDF_VSD_OFFSET + ((blkid_loff_t) b * 0x800),
0b5e55
 					sizeof(*vsd));
0b5e55
 		if (!vsd)
0b5e55
-			return -1;
0b5e55
+			return errno ? -errno : 1;
0b5e55
 		if (vsd->id[0] == '\0')
0b5e55
-			return -1;
0b5e55
+			return 1;
0b5e55
 		if (memcmp(vsd->id, "NSR02", 5) == 0)
0b5e55
 			goto anchor;
0b5e55
 		if (memcmp(vsd->id, "NSR03", 5) == 0)
0b5e55
 			goto anchor;
0b5e55
 	}
0b5e55
-	return -1;
0b5e55
+	return 1;
0b5e55
 
0b5e55
 anchor:
0b5e55
 	/* read Anchor Volume Descriptor (AVDP), checking block size */
0b5e55
@@ -115,7 +115,7 @@ anchor:
0b5e55
 		vd = (struct volume_descriptor *)
0b5e55
 			blkid_probe_get_buffer(pr, 256 * pbs[i], sizeof(*vd));
0b5e55
 		if (!vd)
0b5e55
-			return -1;
0b5e55
+			return errno ? -errno : 1;
0b5e55
 
0b5e55
 		type = le16_to_cpu(vd->tag.id);
0b5e55
 		if (type == 2) /* TAG_ID_AVDP */
0b5e55
@@ -138,7 +138,7 @@ real_blksz:
0b5e55
 					(blkid_loff_t) (loc + b) * bs,
0b5e55
 					sizeof(*vd));
0b5e55
 		if (!vd)
0b5e55
-			return -1;
0b5e55
+			return errno ? -errno : 1;
0b5e55
 	}
0b5e55
 
0b5e55
 	/* Try extract all possible ISO9660 information -- if there is
0b5e55
@@ -155,7 +155,7 @@ real_blksz:
0b5e55
 					(blkid_loff_t) (loc + b) * bs,
0b5e55
 					sizeof(*vd));
0b5e55
 		if (!vd)
0b5e55
-			return -1;
0b5e55
+			return errno ? -errno : 1;
0b5e55
 		type = le16_to_cpu(vd->tag.id);
0b5e55
 		if (type == 0)
0b5e55
 			break;
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/ufs.c.kzak util-linux-2.23.2/libblkid/src/superblocks/ufs.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/ufs.c.kzak	2013-04-08 17:55:40.263856264 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/ufs.c	2014-03-28 15:11:44.683552047 +0100
0b5e55
@@ -185,7 +185,7 @@ static int probe_ufs(blkid_probe pr,
0b5e55
 					offsets[i] * 1024,
0b5e55
 					sizeof(struct ufs_super_block));
0b5e55
 		if (!ufs)
0b5e55
-			return -1;
0b5e55
+			return errno ? -errno : 1;
0b5e55
 
0b5e55
 		magBE = be32_to_cpu(ufs->fs_magic);
0b5e55
 		magLE = le32_to_cpu(ufs->fs_magic);
0b5e55
@@ -231,7 +231,7 @@ found:
0b5e55
 				offsetof(struct ufs_super_block, fs_magic),
0b5e55
 			sizeof(ufs->fs_magic),
0b5e55
 			(unsigned char *) &ufs->fs_magic))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	return 0;
0b5e55
 }
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/vfat.c.kzak util-linux-2.23.2/libblkid/src/superblocks/vfat.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/vfat.c.kzak	2013-06-13 09:46:10.426650673 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/vfat.c	2014-03-28 15:12:28.036993622 +0100
0b5e55
@@ -255,16 +255,20 @@ int blkid_probe_is_vfat(blkid_probe pr)
0b5e55
 	struct vfat_super_block *vs;
0b5e55
 	struct msdos_super_block *ms;
0b5e55
 	const struct blkid_idmag *mag = NULL;
0b5e55
+	int rc;
0b5e55
 
0b5e55
-	if (blkid_probe_get_idmag(pr, &vfat_idinfo, NULL, &mag) || !mag)
0b5e55
+	rc = blkid_probe_get_idmag(pr, &vfat_idinfo, NULL, &mag;;
0b5e55
+	if (rc < 0)
0b5e55
+		return rc;	/* error */
0b5e55
+	if (rc != BLKID_PROBE_OK || !mag)
0b5e55
 		return 0;
0b5e55
 
0b5e55
 	ms = blkid_probe_get_sb(pr, mag, struct msdos_super_block);
0b5e55
 	if (!ms)
0b5e55
-		return 0;
0b5e55
+		return errno ? -errno : 0;
0b5e55
 	vs = blkid_probe_get_sb(pr, mag, struct vfat_super_block);
0b5e55
 	if (!vs)
0b5e55
-		return 0;
0b5e55
+		return errno ? -errno : 0;
0b5e55
 
0b5e55
 	return fat_valid_superblock(mag, ms, vs, NULL, NULL);
0b5e55
 }
0b5e55
@@ -283,10 +287,12 @@ static int probe_vfat(blkid_probe pr, co
0b5e55
 
0b5e55
 	ms = blkid_probe_get_sb(pr, mag, struct msdos_super_block);
0b5e55
 	if (!ms)
0b5e55
-		return 0;
0b5e55
+		return errno ? -errno : 1;
0b5e55
+
0b5e55
 	vs = blkid_probe_get_sb(pr, mag, struct vfat_super_block);
0b5e55
 	if (!vs)
0b5e55
-		return 0;
0b5e55
+		return errno ? -errno : 1;
0b5e55
+
0b5e55
 	if (!fat_valid_superblock(mag, ms, vs, &cluster_count, &fat_size))
0b5e55
 		return 1;
0b5e55
 
0b5e55
@@ -376,16 +382,16 @@ static int probe_vfat(blkid_probe pr, co
0b5e55
 					(blkid_loff_t) fsinfo_sect * sector_size,
0b5e55
 					sizeof(struct fat32_fsinfo));
0b5e55
 			if (buf == NULL)
0b5e55
-				return -1;
0b5e55
+				return errno ? -errno : 1;
0b5e55
 
0b5e55
 			fsinfo = (struct fat32_fsinfo *) buf;
0b5e55
 			if (memcmp(fsinfo->signature1, "\x52\x52\x61\x41", 4) != 0 &&
0b5e55
 			    memcmp(fsinfo->signature1, "\x52\x52\x64\x41", 4) != 0 &&
0b5e55
 			    memcmp(fsinfo->signature1, "\x00\x00\x00\x00", 4) != 0)
0b5e55
-				return -1;
0b5e55
+				return 1;
0b5e55
 			if (memcmp(fsinfo->signature2, "\x72\x72\x41\x61", 4) != 0 &&
0b5e55
 			    memcmp(fsinfo->signature2, "\x00\x00\x00\x00", 4) != 0)
0b5e55
-				return -1;
0b5e55
+				return 1;
0b5e55
 		}
0b5e55
 	}
0b5e55
 
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/via_raid.c.kzak util-linux-2.23.2/libblkid/src/superblocks/via_raid.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/via_raid.c.kzak	2013-04-08 17:55:40.264856273 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/via_raid.c	2014-03-28 15:11:44.683552047 +0100
0b5e55
@@ -52,9 +52,9 @@ static int probe_viaraid(blkid_probe pr,
0b5e55
 	struct via_metadata *v;
0b5e55
 
0b5e55
 	if (pr->size < 0x10000)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (!S_ISREG(pr->mode) && !blkid_probe_is_wholedisk(pr))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	off = ((pr->size / 0x200)-1) * 0x200;
0b5e55
 
0b5e55
@@ -63,19 +63,19 @@ static int probe_viaraid(blkid_probe pr,
0b5e55
 				off,
0b5e55
 				sizeof(struct via_metadata));
0b5e55
 	if (!v)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 	if (le16_to_cpu(v->signature) != VIA_SIGNATURE)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (v->version_number > 2)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (!via_checksum(v))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (blkid_probe_sprintf_version(pr, "%u", v->version_number) != 0)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	if (blkid_probe_set_magic(pr, off,
0b5e55
 				sizeof(v->signature),
0b5e55
 				(unsigned char *) &v->signature))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 	return 0;
0b5e55
 }
0b5e55
 
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/vmfs.c.kzak util-linux-2.23.2/libblkid/src/superblocks/vmfs.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/vmfs.c.kzak	2013-04-08 17:55:40.264856273 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/vmfs.c	2014-03-28 15:11:44.683552047 +0100
0b5e55
@@ -28,7 +28,7 @@ static int probe_vmfs_fs(blkid_probe pr,
0b5e55
 
0b5e55
 	header = blkid_probe_get_sb(pr, mag, struct vmfs_fs_info);
0b5e55
 	if (header == NULL)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	blkid_probe_sprintf_uuid(pr, (unsigned char *) header->uuid, 16,
0b5e55
 		"%02x%02x%02x%02x-%02x%02x%02x%02x-"
0b5e55
@@ -53,7 +53,7 @@ static int probe_vmfs_volume(blkid_probe
0b5e55
 
0b5e55
 	header = blkid_probe_get_sb(pr, mag, struct vmfs_volume_info);
0b5e55
 	if (header == NULL)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	blkid_probe_sprintf_value(pr, "UUID_SUB",
0b5e55
 		"%02x%02x%02x%02x-%02x%02x%02x%02x-"
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/vxfs.c.kzak util-linux-2.23.2/libblkid/src/superblocks/vxfs.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/vxfs.c.kzak	2013-04-08 17:55:40.264856273 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/vxfs.c	2014-03-28 15:11:44.683552047 +0100
0b5e55
@@ -20,7 +20,7 @@ static int probe_vxfs(blkid_probe pr, co
0b5e55
 
0b5e55
 	vxs = blkid_probe_get_sb(pr, mag, struct vxfs_super_block);
0b5e55
 	if (!vxs)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	blkid_probe_sprintf_version(pr, "%u", (unsigned int) vxs->vs_version);
0b5e55
 	return 0;
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/xfs.c.kzak util-linux-2.23.2/libblkid/src/superblocks/xfs.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/xfs.c.kzak	2013-04-08 17:55:40.265856283 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/xfs.c	2014-03-28 15:11:44.683552047 +0100
0b5e55
@@ -40,7 +40,7 @@ static int probe_xfs(blkid_probe pr, con
0b5e55
 
0b5e55
 	xs = blkid_probe_get_sb(pr, mag, struct xfs_super_block);
0b5e55
 	if (!xs)
0b5e55
-		return -1;
0b5e55
+		return errno ? -errno : 1;
0b5e55
 
0b5e55
 	if (strlen(xs->xs_fname))
0b5e55
 		blkid_probe_set_label(pr, (unsigned char *) xs->xs_fname,
0b5e55
diff -up util-linux-2.23.2/libblkid/src/superblocks/zfs.c.kzak util-linux-2.23.2/libblkid/src/superblocks/zfs.c
0b5e55
--- util-linux-2.23.2/libblkid/src/superblocks/zfs.c.kzak	2013-06-13 09:46:10.427650682 +0200
0b5e55
+++ util-linux-2.23.2/libblkid/src/superblocks/zfs.c	2014-03-28 15:11:44.683552047 +0100
0b5e55
@@ -185,7 +185,7 @@ static int probe_zfs(blkid_probe pr,
0b5e55
 			blkid_probe_get_buffer(pr, offset,
0b5e55
 					       sizeof(struct zfs_uberblock));
0b5e55
 		if (ub == NULL)
0b5e55
-			return -1;
0b5e55
+			return errno ? -errno : 1;
0b5e55
 
0b5e55
 		if (ub->ub_magic == UBERBLOCK_MAGIC) {
0b5e55
 			ub_offset = offset;
0b5e55
@@ -202,7 +202,7 @@ static int probe_zfs(blkid_probe pr,
0b5e55
 	}
0b5e55
 
0b5e55
 	if (found < 4)
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	/* If we found the 4th uberblock, then we will have exited from the
0b5e55
 	 * scanning loop immediately, and ub will be a valid uberblock. */
0b5e55
@@ -214,7 +214,7 @@ static int probe_zfs(blkid_probe pr,
0b5e55
 	if (blkid_probe_set_magic(pr, ub_offset,
0b5e55
 				sizeof(ub->ub_magic),
0b5e55
 				(unsigned char *) &ub->ub_magic))
0b5e55
-		return -1;
0b5e55
+		return 1;
0b5e55
 
0b5e55
 	return 0;
0b5e55
 }