d2bdca
diff -up util-linux-2.23.2/libblkid/src/partitions/partitions.c.kzak util-linux-2.23.2/libblkid/src/partitions/partitions.c
d2bdca
--- util-linux-2.23.2/libblkid/src/partitions/partitions.c.kzak	2015-08-11 14:00:27.930573965 +0200
d2bdca
+++ util-linux-2.23.2/libblkid/src/partitions/partitions.c	2015-08-11 14:13:11.213087814 +0200
d2bdca
@@ -533,7 +533,7 @@ static int idinfo_probe(blkid_probe pr,
d2bdca
 {
d2bdca
 	const struct blkid_idmag *mag = NULL;
d2bdca
 	blkid_loff_t off;
d2bdca
-	int rc = BLKID_PROBE_NONE;		/* = nothing detected */
d2bdca
+	int rc = BLKID_PROBE_NONE;		/* default is nothing */
d2bdca
 
d2bdca
 	if (pr->size <= 0 || (id->minsz && id->minsz > pr->size))
d2bdca
 		goto nothing;	/* the device is too small */
d2bdca
@@ -564,8 +564,10 @@ static int idinfo_probe(blkid_probe pr,
d2bdca
 		DBG(LOWPROBE, blkid_debug("%s: <--- (rc = %d)", id->name, rc));
d2bdca
 	}
d2bdca
 
d2bdca
-nothing:
d2bdca
 	return rc;
d2bdca
+
d2bdca
+nothing:
d2bdca
+	return BLKID_PROBE_NONE;
d2bdca
 }
d2bdca
 
d2bdca
 /*
d2bdca
@@ -620,7 +622,7 @@ static int partitions_probe(blkid_probe
d2bdca
 						strlen(name) + 1);
d2bdca
 		DBG(LOWPROBE, blkid_debug("<-- leaving probing loop (type=%s) [PARTS idx=%d]",
d2bdca
 			name, chn->idx));
d2bdca
-		rc = 0;
d2bdca
+		rc = BLKID_PROBE_OK;
d2bdca
 		break;
d2bdca
 	}
d2bdca
 
d2bdca
@@ -637,10 +639,16 @@ details_only:
d2bdca
 	    (blkid_partitions_get_flags(pr) & BLKID_PARTS_ENTRY_DETAILS)) {
d2bdca
 
d2bdca
 		int xrc = blkid_partitions_probe_partition(pr);
d2bdca
+
d2bdca
+		/* partition entry probing is optional, and "not-found" from
d2bdca
+		 * this sub-probing must not to overwrite previous success. */
d2bdca
 		if (xrc < 0)
d2bdca
-			rc = xrc;	/* optional, care about errors only */
d2bdca
+			rc = xrc;			/* always propagate errors */
d2bdca
+		else if (rc == BLKID_PROBE_NONE)
d2bdca
+			rc = xrc;
d2bdca
 	}
d2bdca
 
d2bdca
+	DBG(LOWPROBE, blkid_debug("partitions probe done [rc=%d]", rc));
d2bdca
 	return rc;
d2bdca
 }
d2bdca
 
d2bdca
@@ -709,7 +717,6 @@ int blkid_partitions_do_subprobe(blkid_p
d2bdca
 
d2bdca
 static int blkid_partitions_probe_partition(blkid_probe pr)
d2bdca
 {
d2bdca
-	int rc = BLKID_PROBE_NONE;
d2bdca
 	blkid_probe disk_pr = NULL;
d2bdca
 	blkid_partlist ls;
d2bdca
 	blkid_partition par;
d2bdca
@@ -732,7 +739,9 @@ static int blkid_partitions_probe_partit
d2bdca
 		goto nothing;
d2bdca
 
d2bdca
 	par = blkid_partlist_devno_to_partition(ls, devno);
d2bdca
-	if (par) {
d2bdca
+	if (!par)
d2bdca
+		goto nothing;
d2bdca
+	else {
d2bdca
 		const char *v;
d2bdca
 		blkid_parttable tab = blkid_partition_get_table(par);
d2bdca
 		dev_t disk = blkid_probe_get_devno(disk_pr);
d2bdca
@@ -778,9 +787,13 @@ static int blkid_partitions_probe_partit
d2bdca
 		blkid_probe_sprintf_value(pr, "PART_ENTRY_DISK", "%u:%u",
d2bdca
 				major(disk), minor(disk));
d2bdca
 	}
d2bdca
-	rc = BLKID_PROBE_OK;
d2bdca
+
d2bdca
+	DBG(LOWPROBE, blkid_debug("parts: end probing for partition entry [success]"));
d2bdca
+	return BLKID_PROBE_OK;
d2bdca
+
d2bdca
 nothing:
d2bdca
-	return rc;
d2bdca
+	DBG(LOWPROBE, blkid_debug("parts: end probing for partition entry [nothing]"));
d2bdca
+	return BLKID_PROBE_NONE;
d2bdca
 }
d2bdca
 
d2bdca
 /*
d2bdca
diff -up util-linux-2.23.2/libblkid/src/superblocks/superblocks.c.kzak util-linux-2.23.2/libblkid/src/superblocks/superblocks.c
d2bdca
--- util-linux-2.23.2/libblkid/src/superblocks/superblocks.c.kzak	2015-07-03 10:35:05.456153560 +0200
d2bdca
+++ util-linux-2.23.2/libblkid/src/superblocks/superblocks.c	2015-08-11 14:08:42.572674469 +0200
d2bdca
@@ -335,19 +335,24 @@ static int superblocks_probe(blkid_probe
d2bdca
 
d2bdca
 	if (!pr || chn->idx < -1)
d2bdca
 		return -EINVAL;
d2bdca
-	if (pr->flags & BLKID_FL_NOSCAN_DEV)
d2bdca
-		goto nothing;
d2bdca
 
d2bdca
 	blkid_probe_chain_reset_vals(pr, chn);
d2bdca
 
d2bdca
 	DBG(LOWPROBE, blkid_debug("--> starting probing loop [SUBLKS idx=%d]",
d2bdca
 		chn->idx));
d2bdca
 
d2bdca
+	if (pr->flags & BLKID_FL_NOSCAN_DEV)
d2bdca
+		return BLKID_PROBE_NONE;
d2bdca
+
d2bdca
 	if (pr->size <= 0 || (pr->size <= 1024 && !S_ISCHR(pr->mode)))
d2bdca
 		/* Ignore very very small block devices or regular files (e.g.
d2bdca
 		 * extended partitions). Note that size of the UBI char devices
d2bdca
 		 * is 1 byte */
d2bdca
-		goto nothing;
d2bdca
+		return BLKID_PROBE_NONE;
d2bdca
+
d2bdca
+
d2bdca
+	DBG(LOWPROBE, blkid_debug("--> starting probing loop [SUBLKS idx=%d]",
d2bdca
+		chn->idx));
d2bdca
 
d2bdca
 	i = chn->idx < 0 ? 0 : chn->idx + 1U;
d2bdca
 
d2bdca
@@ -417,7 +422,7 @@ static int superblocks_probe(blkid_probe
d2bdca
 					(unsigned char *) mag->magic);
d2bdca
 		if (rc) {
d2bdca
 			blkid_probe_chain_reset_vals(pr, chn);
d2bdca
-			DBG(LOWPROBE, blkid_debug("failed to set result -- ingnore"));
d2bdca
+			DBG(LOWPROBE, blkid_debug("failed to set result -- ignore"));
d2bdca
 			continue;
d2bdca
 		}
d2bdca
 
d2bdca
@@ -426,7 +431,6 @@ static int superblocks_probe(blkid_probe
d2bdca
 		return BLKID_PROBE_OK;
d2bdca
 	}
d2bdca
 
d2bdca
-nothing:
d2bdca
 	DBG(LOWPROBE, blkid_debug("<-- leaving probing loop (failed=%d) [SUBLKS idx=%d]",
d2bdca
 			rc, chn->idx));
d2bdca
 	return rc;
d2bdca
@@ -454,13 +458,12 @@ static int superblocks_safeprobe(blkid_p
d2bdca
 	int rc;
d2bdca
 
d2bdca
 	if (pr->flags & BLKID_FL_NOSCAN_DEV)
d2bdca
-		return 1;				/* nothing */
d2bdca
+		return BLKID_PROBE_NONE;
d2bdca
 
d2bdca
 	while ((rc = superblocks_probe(pr, chn)) == 0) {
d2bdca
 
d2bdca
 		if (blkid_probe_is_tiny(pr) && !count)
d2bdca
-			/* floppy or so -- returns the first result. */
d2bdca
-			return 0;
d2bdca
+			return BLKID_PROBE_OK;	/* floppy or so -- returns the first result. */
d2bdca
 
d2bdca
 		count++;
d2bdca
 
d2bdca
@@ -489,7 +492,7 @@ static int superblocks_safeprobe(blkid_p
d2bdca
 		return -2;		/* error, ambivalent result (more FS) */
d2bdca
 	}
d2bdca
 	if (!count)
d2bdca
-		return 1;		/* nothing detected */
d2bdca
+		return BLKID_PROBE_NONE;
d2bdca
 
d2bdca
 	if (idx != -1) {
d2bdca
 		/* restore the first result */
d2bdca
@@ -506,7 +509,7 @@ static int superblocks_safeprobe(blkid_p
d2bdca
 	if (chn->idx >= 0 && idinfos[chn->idx]->usage & BLKID_USAGE_RAID)
d2bdca
 		pr->prob_flags |= BLKID_PROBE_FL_IGNORE_PT;
d2bdca
 
d2bdca
-	return 0;
d2bdca
+	return BLKID_PROBE_OK;
d2bdca
 }
d2bdca
 
d2bdca
 int blkid_probe_set_version(blkid_probe pr, const char *version)
d2bdca
diff -up util-linux-2.23.2/libblkid/src/topology/topology.c.kzak util-linux-2.23.2/libblkid/src/topology/topology.c
d2bdca
--- util-linux-2.23.2/libblkid/src/topology/topology.c.kzak	2013-06-13 09:46:10.429650699 +0200
d2bdca
+++ util-linux-2.23.2/libblkid/src/topology/topology.c	2015-08-11 14:09:35.623361499 +0200
d2bdca
@@ -150,7 +150,7 @@ static int topology_probe(blkid_probe pr
d2bdca
 		return -1;
d2bdca
 
d2bdca
 	if (!S_ISBLK(pr->mode))
d2bdca
-		return -1;	/* nothing, works with block devices only */
d2bdca
+		return -EINVAL;	/* nothing, works with block devices only */
d2bdca
 
d2bdca
 	if (chn->binary) {
d2bdca
 		DBG(LOWPROBE, blkid_debug("initialize topology binary data"));
d2bdca
@@ -163,7 +163,7 @@ static int topology_probe(blkid_probe pr
d2bdca
 			chn->data = calloc(1,
d2bdca
 					sizeof(struct blkid_struct_topology));
d2bdca
 			if (!chn->data)
d2bdca
-				return -1;
d2bdca
+				return -ENOMEM;
d2bdca
 		}
d2bdca
 	}
d2bdca
 
d2bdca
@@ -193,12 +193,12 @@ static int topology_probe(blkid_probe pr
d2bdca
 
d2bdca
 		DBG(LOWPROBE, blkid_debug("<-- leaving probing loop (type=%s) [TOPOLOGY idx=%d]",
d2bdca
 			id->name, chn->idx));
d2bdca
-		return 0;
d2bdca
+		return BLKID_PROBE_OK;
d2bdca
 	}
d2bdca
 
d2bdca
 	DBG(LOWPROBE, blkid_debug("<-- leaving probing loop (failed) [TOPOLOGY idx=%d]",
d2bdca
 		chn->idx));
d2bdca
-	return 1;
d2bdca
+	return BLKID_PROBE_NONE;
d2bdca
 }
d2bdca
 
d2bdca
 static void topology_free(blkid_probe pr __attribute__((__unused__)),