+ Bitmatch.string_of_bitstring lvm2_ver = "LVM2 001" ->
+ let metadata_offset = metadata_offset +* 0x1000_l in
+
+ (* Check the metadata offset & length look reasonable for this
+ * device. Otherwise maybe it's a newer or older header which
+ * we don't really understand properly.
+ *)
+ let () =
+ let size =
+ if dev#size <= Int64.of_int32 Int32.max_int then Int64.to_int32 dev#size
+ else Int32.max_int in
+ if metadata_offset < 0x1200_l || metadata_offset >= size
+ || metadata_length < 0_l || metadata_offset+*metadata_length >= size
+ then
+ invalid_arg "read_pv_label: bad metadata offset or length" in
+
+ Bitmatch.string_of_bitstring uuid, metadata_offset, metadata_length
+
+