diff options
author | Karel Zak | 2013-02-06 17:26:46 +0100 |
---|---|---|
committer | Karel Zak | 2013-02-06 17:39:28 +0100 |
commit | 6e650f8895631dabc5b8bb809bed024896c3dcc5 (patch) | |
tree | edffd946a10714e4e3db65841ade067ad1928817 /libblkid/src/probe.c | |
parent | setpriv: Fix an error message typo (diff) | |
download | kernel-qcow2-util-linux-6e650f8895631dabc5b8bb809bed024896c3dcc5.tar.gz kernel-qcow2-util-linux-6e650f8895631dabc5b8bb809bed024896c3dcc5.tar.xz kernel-qcow2-util-linux-6e650f8895631dabc5b8bb809bed024896c3dcc5.zip |
libblkid: make blkid_new_probe_from_filename() usable on whole-disk
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>
Diffstat (limited to 'libblkid/src/probe.c')
-rw-r--r-- | libblkid/src/probe.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c index f7f90761a..9e3f8f690 100644 --- a/libblkid/src/probe.c +++ b/libblkid/src/probe.c @@ -183,6 +183,8 @@ blkid_probe blkid_clone_probe(blkid_probe parent) pr->flags = parent->flags; pr->parent = parent; + pr->flags &= ~BLKID_FL_PRIVATE_FD; + return pr; } |