From 40b1f830b91540befd50ff995e8769e0b09d0372 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 14 May 2009 18:29:03 +0200 Subject: [PATCH] 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 --- libs/blkid/src/probe.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libs/blkid/src/probe.c b/libs/blkid/src/probe.c index b0c0be80..af22e34d 100644 --- a/libs/blkid/src/probe.c +++ b/libs/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 */ -- 2.39.5