summaryrefslogtreecommitdiffstats
path: root/shlibs/blkid/src/blkidP.h
diff options
context:
space:
mode:
authorKarel Zak2010-04-22 21:30:04 +0200
committerKarel Zak2010-04-22 21:30:04 +0200
commitc81e70087cfebc299bdfbbd0675958483fc8a768 (patch)
tree91286e412e19324afe6514870b200d20e290983f /shlibs/blkid/src/blkidP.h
parentliblkid: export magic strings from raids (diff)
downloadkernel-qcow2-util-linux-c81e70087cfebc299bdfbbd0675958483fc8a768.tar.gz
kernel-qcow2-util-linux-c81e70087cfebc299bdfbbd0675958483fc8a768.tar.xz
kernel-qcow2-util-linux-c81e70087cfebc299bdfbbd0675958483fc8a768.zip
libblkid: fix collision between RAID and PT probing
The RAID signature is usually at end of the block device. We have to differentiate between: - RAID signature at the end of disk, and - RAID signature at the end of the last partition The position of the signature is same in both cases... It means we have to the parse partition table and check if the area where is RAID signature is covered by any partition. If yes, then the RAID signature belongs to the partition and has to be ignored during whole-disk probing. The second problem are RAID1 underlaying disks (=raid members). The RAID device could be partitioned, in such a case the partition table is visible from underlaying devices. These partition tables has to be ignored. The libblkid ignores partition tables on raid members now. Note that all these changes are implemented for blkid_do_safeprobe() only. The others functions allow to access all detected superblocks or partition tables. Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=543749 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/blkid/src/blkidP.h')
-rw-r--r--shlibs/blkid/src/blkidP.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/shlibs/blkid/src/blkidP.h b/shlibs/blkid/src/blkidP.h
index c37f73062..41eba9102 100644
--- a/shlibs/blkid/src/blkidP.h
+++ b/shlibs/blkid/src/blkidP.h
@@ -196,6 +196,7 @@ struct blkid_struct_probe
mode_t mode; /* struct stat.sb_mode */
int flags; /* private libray flags */
+ int prob_flags; /* always zeroized by blkid_do_*() */
struct list_head buffers; /* list of buffers */
@@ -206,10 +207,12 @@ struct blkid_struct_probe
int nvals; /* number of assigned vals */
};
-/* flags */
+/* private flags */
#define BLKID_PRIVATE_FD (1 << 1) /* see blkid_new_probe_from_filename() */
#define BLKID_TINY_DEV (1 << 2) /* <= 1.47MiB (floppy or so) */
#define BLKID_CDROM_DEV (1 << 3) /* is a CD/DVD drive */
+/* private probing flags */
+#define BLKID_PARTS_IGNORE_PT (1 << 1) /* ignore partition table */
/*
* Evaluation methods (for blkid_eval_* API)
@@ -390,6 +393,9 @@ extern int blkid_probe_set_dimension(blkid_probe pr,
extern blkid_partlist blkid_probe_get_partlist(blkid_probe pr);
+extern int blkid_probe_is_covered_by_pt(blkid_probe pr,
+ blkid_loff_t offset, blkid_loff_t size);
+
extern void blkid_probe_chain_reset_vals(blkid_probe pr, struct blkid_chain *chn);
extern int blkid_probe_chain_copy_vals(blkid_probe pr, struct blkid_chain *chn,
struct blkid_prval *vals, int nvals);