This is stupid bug, when libblkid probe for partition table on
whole-disk device with old 0.90 Linux RAID then it creates clone of
the struct blkid_probe to avoid collisions with the original probing
setting.
If the cloned prober is unnecessary then it's deallocated by
blkid_free_probe() ... and this function also closes the file
descriptor if the device has been opened by blkid_new_probe_from_filename().
Fortunately we usually use open() + blkid_probe_set_device(), ...
except wipefs(1).
Reported-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
pr->flags = parent->flags;
pr->parent = parent;
+ pr->flags &= ~BLKID_FL_PRIVATE_FD;
+
return pr;
}