summaryrefslogtreecommitdiffstats
path: root/libblkid/src/verify.c
diff options
context:
space:
mode:
authorKarel Zak2012-12-04 13:02:57 +0100
committerKarel Zak2012-12-04 13:02:57 +0100
commitf4388dea5f8685149ca370279760b83cc98ccb7e (patch)
tree23bb9e74a3b72b6891c00f8bdb0ff84b9ce61676 /libblkid/src/verify.c
parentlibblkid: cleanup arguments checks (diff)
downloadkernel-qcow2-util-linux-f4388dea5f8685149ca370279760b83cc98ccb7e.tar.gz
kernel-qcow2-util-linux-f4388dea5f8685149ca370279760b83cc98ccb7e.tar.xz
kernel-qcow2-util-linux-f4388dea5f8685149ca370279760b83cc98ccb7e.zip
libblkid: re-read PART{UUID,LABEL} for successfully verified cached devices
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid/src/verify.c')
-rw-r--r--libblkid/src/verify.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/libblkid/src/verify.c b/libblkid/src/verify.c
index da78d6b08..8a6fc20af 100644
--- a/libblkid/src/verify.c
+++ b/libblkid/src/verify.c
@@ -161,9 +161,6 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
BLKID_SUBLKS_LABEL | BLKID_SUBLKS_UUID |
BLKID_SUBLKS_TYPE | BLKID_SUBLKS_SECTYPE);
- blkid_probe_enable_partitions(cache->probe, TRUE);
- blkid_probe_set_partitions_flags(cache->probe, BLKID_PARTS_ENTRY_DETAILS);
-
/*
* If we already know the type, then try that first.
*/
@@ -177,8 +174,18 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
blkid_probe_filter_superblocks_type(cache->probe,
BLKID_FLTR_ONLYIN, fltr);
- if (!blkid_do_probe(cache->probe))
- goto found_type;
+ if (blkid_do_probe(cache->probe) == 0) {
+ /*
+ * Cool, we found FS type, let's also read PART{UUID,LABEL}
+ */
+ blkid_probe_enable_superblocks(cache->probe, FALSE);
+ blkid_probe_enable_partitions(cache->probe, TRUE);
+ blkid_probe_set_partitions_flags(cache->probe, BLKID_PARTS_ENTRY_DETAILS);
+ if (blkid_do_probe(cache->probe) == 0)
+ goto found_type;
+ }
+
+ blkid_probe_enable_superblocks(cache->probe, TRUE);
blkid_probe_invert_superblocks_filter(cache->probe);
/*
@@ -193,6 +200,9 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
blkid_tag_iterate_end(iter);
}
+ blkid_probe_enable_partitions(cache->probe, TRUE);
+ blkid_probe_set_partitions_flags(cache->probe, BLKID_PARTS_ENTRY_DETAILS);
+
/*
* Probe for all types.
*/