summaryrefslogtreecommitdiffstats
path: root/libblkid/src/devno.c
Commit message (Collapse)AuthorAgeFilesLines
* misc: fix reassigned values before old ones has been used [cppcheck]Sami Kerola2017-06-141-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: avoid shadowingKarel Zak2016-03-091-7/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Revert "include sysmacros.h where used"Karel Zak2016-03-081-1/+0Star
| | | | This reverts commit 46a40c018438b7b2b25083a5e5a4a21055a0c1e9.
* include sysmacros.h where usedMike Frysinger2016-03-081-0/+1
| | | | | | | | BSD/Linux systems stick major/minor/makedev in sysmacros.h. Newer Linux libraries have been moving away from including sysmacros.h implicitly via sys/types.h, so include it directly. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* lib: remove openat fallback functions (include/at.h)Ruediger Meier2016-03-071-3/+2Star
| | | | | | | | | | | | | | I have validated that we are still compatible at least back to - openSUSE 11.4 - SLE 11 - RHEL/CentOS 6 - OSX 10.10.x, (Xcode 6.3) - FreeBSD 10.2 Confirmed incompatibility: - OSX 10.9.x, (Xcode 6.2) Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* lib/sysfs: rename devname functions, cleanupKarel Zak2015-05-281-1/+0Star
| | | | | | | | | | | | | | | | | | Well, I don't have mental power to use function names like sysfs_devname_to_dev_name() so this patch renames to sysfs_devname_sys_to_dev() sysfs_devname_dev_to_sys() It also cleanups usage of the functions. We have to be sure that sysfs.c code returns regular devnames. The existence of the sysfs devnames (with '!') should be completely hidden in sysfs specific code. Signed-off-by: Karel Zak <kzak@redhat.com>
* Fix /sys to /dev node name translationStanislav Brabec2015-05-261-0/+1
| | | | | | | | | | | | | | linux/drivers/base/core.c: device_get_devnode() defines a translation of '!' in sysfs nodes to '/' in /dev nodes. The same translation has to be done to properly support device nodes with slash (e. g. device nodes of cciss driver and several other drivers). Introduce new helper sysfs_devname_to_devno() and use it where appropriate. Fixes for example lsblk -f on devices using cciss driver. Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* lib/sysfs: add sysfs_devno_is_lvm_private() from libblkidKarel Zak2014-06-171-29/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: ignore private LVM devicesKarel Zak2014-06-101-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The virtual private LVM devices do not contain any blkid relevant data and it does not make any sense to scan for superblocks or partitions on the devices, because we can interpret data from the devices in bad way. Unfortunately, for LVM has "private" very special meaning. The private LVM devices are accessible and readable (according to LVM guys it's feature, because debugging etc.). The problem is pretty visible with LVM thin provisioning where a virtual pool device contains segments from the top-level thin devices. Mountable top-level LVM-thin device: # blkid -o udev -p /dev/mapper/vg-thin1 ID_FS_UUID=57ed6490-903b-416c-91d2-6d06804ec60c ID_FS_TYPE=ext4 Virtual private LVM-pool device (contains data from all thin devices): # blkid -o udev -p /dev/mapper/vg-pool0 ID_FS_UUID=57ed6490-903b-416c-91d2-6d06804ec60c ID_FS_TYPE=ext4 ... this is incorrect, vg-pool0 is unmountable. LVM uses special UUID suffixes for private devices. All devices with uuid in format "LVM-<uuid>-<type>" are private. This patch modifies libblkid to not scan such devices. The high-level API ignores such devices at all now. The low-level API allows to assign the device to blkid_prober, but all scan functions always return nothing and library does not read anything from the device. The another functionality (get parental device, topology, sector sizes, etc.) still works as expected. The change affects only probing code. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1101345 Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: use new debug functionsKarel Zak2014-03-211-5/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: clean up DBG()Karel Zak2013-04-081-9/+6Star
| | | | | | | | | - use stderr only - use BLKID_ prefix for debug masks - don't use \n in in messages and don't use printf(), but use generic blkid_debug(). Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: use O_CLOEXECKarel Zak2013-04-031-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* a pointer should not be compared to zero [coccinelle]Sami Kerola2013-02-061-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libblkid: improve test_blkid_devno, fix compiler warning [-Wunused-result]Karel Zak2012-12-191-1/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: cleanup blkid_strconcatKarel Zak2012-11-301-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: remove blkid_{strndup,strdup}Karel Zak2012-11-301-24/+2Star
| | | | | | | Don't try to be smart. Let's use standard libc functions. (Note that we have fallback for strndup() in include/strutils.h) Signed-off-by: Karel Zak <kzak@redhat.com>
* fix buffer overrun in some calls to sscanfKarel Zak2012-07-091-1/+1
| | | | | Reported-by: Sergei Antonov <saproj@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* sysfs: move blkid_devno_to_wholedisk to sysfs_devno_to_wholediskMichal Luscon2012-03-271-129/+1Star
| | | | Signed-off-by: Michal Luscon <mluscon@redhat.com>
* libblkid: fix sysfs context usageKarel Zak2012-03-061-1/+1
| | | | | Reported-by: Elan Ruusamäe <glen@delfi.ee> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: check HAVE_ definitions with #ifdef [smatch scan]Sami Kerola2011-12-021-5/+5
| | | | | | Fix to `warning: undefined preprocessor identifier' messages. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libblkid: fix compiler warnings [-Wunused-parameter -Wsign-compare]Karel Zak2011-08-021-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: use top-level directory for libblkid rather than shlibs/blkidKarel Zak2011-06-091-0/+527
Signed-off-by: Karel Zak <kzak@redhat.com>