summaryrefslogtreecommitdiffstats
path: root/shlibs/blkid/src/probe.c
diff options
context:
space:
mode:
authorKarel Zak2009-05-14 18:29:03 +0200
committerKarel Zak2009-05-14 18:29:03 +0200
commit7103157c8bbf37a56c7c385198267120f72b7866 (patch)
treecd8b80ff5edca6108da76c56900c9007b38fdc80 /shlibs/blkid/src/probe.c
parentblkid: fix "hangs forever with partition type mdraid" (diff)
downloadkernel-qcow2-util-linux-7103157c8bbf37a56c7c385198267120f72b7866.tar.gz
kernel-qcow2-util-linux-7103157c8bbf37a56c7c385198267120f72b7866.tar.xz
kernel-qcow2-util-linux-7103157c8bbf37a56c7c385198267120f72b7866.zip
blkid: blkid_do_safeprobe() has to be tolerant to RAIDs
It's pretty generic that RAID signature is on the same device as FS signature. We have to be tolerant and ignore filesystems signatures on such devices. The RAID signature is always preferred. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/blkid/src/probe.c')
-rw-r--r--shlibs/blkid/src/probe.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/shlibs/blkid/src/probe.c b/shlibs/blkid/src/probe.c
index b0c0be80a..af22e34da 100644
--- a/shlibs/blkid/src/probe.c
+++ b/shlibs/blkid/src/probe.c
@@ -529,6 +529,10 @@ int blkid_do_probe(blkid_probe pr)
* This is the same function as blkid_do_probe(), but returns only one result
* (cannot be used in while()) and checks for ambivalen results (more
* filesystems on the device) -- in such case returns -2.
+ *
+ * The function does not check for filesystems when a RAID signature is
+ * detected. The function also does not check for collision between RAIDs. The
+ * first detected RAID is returned.
*/
int blkid_do_safeprobe(blkid_probe pr)
{
@@ -544,9 +548,12 @@ int blkid_do_safeprobe(blkid_probe pr)
first.nvals = pr->nvals;
first.idx = pr->idx;
}
+ count++;
+
+ if (idinfos[pr->idx]->usage & BLKID_USAGE_RAID)
+ break;
if (!(idinfos[pr->idx]->flags & BLKID_IDINFO_TOLERANT))
intol++;
- count++;
}
if (rc < 0)
return rc; /* error */