summaryrefslogtreecommitdiffstats
path: root/libs/blkid/src/verify.c
diff options
context:
space:
mode:
authorKarel Zak2009-01-27 17:25:06 +0100
committerKarel Zak2009-02-11 23:35:25 +0100
commita2f01a1c0ba7e8d6f546133195ee759715ef42f7 (patch)
treeac4b51b12299821f80f731db6c62b10049296c34 /libs/blkid/src/verify.c
parentblkid: add lvm2 reg.test (diff)
downloadkernel-qcow2-util-linux-a2f01a1c0ba7e8d6f546133195ee759715ef42f7.tar.gz
kernel-qcow2-util-linux-a2f01a1c0ba7e8d6f546133195ee759715ef42f7.tar.xz
kernel-qcow2-util-linux-a2f01a1c0ba7e8d6f546133195ee759715ef42f7.zip
blkid: add blkid_do_safeprobe()
The function blkid_do_probe() is able to detect more filesystems on the device while(blkid_do_probe(pr) == 0) ... but in many cases we need only one exact answer, and we also need to be sure that there is not any other FS on the device. For example it's possible to create valid LUKS (or vfat, ...) header and valid linux swap header on the same device -- in such case the device can be interpreted (by mount/swapon) in two completely different ways. An ambivalent result is always error -- the library never returns such result. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libs/blkid/src/verify.c')
-rw-r--r--libs/blkid/src/verify.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/blkid/src/verify.c b/libs/blkid/src/verify.c
index 8892820d3..7f795a426 100644
--- a/libs/blkid/src/verify.c
+++ b/libs/blkid/src/verify.c
@@ -141,8 +141,8 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
/*
* Probe for all types.
*/
- if (blkid_do_probe(cache->probe)) {
- /* found nothing */
+ if (blkid_do_safeprobe(cache->probe)) {
+ /* found nothing or error */
blkid_free_dev(dev);
dev = NULL;
}