summaryrefslogtreecommitdiffstats
path: root/lib/filters
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: drop unneeded included header filesZdenek Kabelac2012-08-232-2/+0
| | | | | This headers were not resolving anything used for compiled .c files. Remove unused util.c file.
* filters: move device_info_t definition to headerAlasdair G Kergon2012-07-262-7/+7
|
* filters: Add Micron PCIe SSDs (mtip32xx) [part2]Alasdair G Kergon2012-07-261-0/+55
| | | | Recognise Micron PCIe SSDs in filter and move array out to device-types.h.
* filters: Add Micron PCIe SSDs (mtip32xx)Alasdair G Kergon2012-07-261-40/+2
| | | | Recognise Micron PCIe SSDs in filter and move array out to device-types.h.
* Support improperly formated device numbersZdenek Kabelac2012-03-201-2/+15
| | | | | | | | | | | | | There are kernel drivers (smblk) which set '-1' as their device major number. This number is listed in /proc/devices then - but the kernel itself is using just 12 bits - thus device is accessible via 4095 - there is posted patch for 3.4 to fix this behavior (0 for auto allocation was mean to be used). However to still allow using such devices with older kernels add some code to use same behavior - so cut 12 bits from the major number from /proc/devices. For now use log_warn() - maybe the severity of the message could be lowered to just verbose level.
* Better structure layout for device_infoZdenek Kabelac2012-03-122-21/+19
| | | | | | Save some relocation entries and use directly char[]. Since we do not need yes more then 127 partitions per device, use just int8_t. Move lvm_type_filter_destroy into local static function.
* Improve error loggingZdenek Kabelac2012-03-011-24/+47
| | | | | Log errors instead of plain return 0. Check for f->private strdup result.
* Test dm_hash_insert() failures mem failuresZdenek Kabelac2012-02-281-2/+8
|
* Add some stack traces for dev_close error pathsZdenek Kabelac2012-02-281-1/+2
|
* Check allocation resultZdenek Kabelac2012-02-271-1/+3
|
* Add check for allocation failureZdenek Kabelac2012-02-131-9/+10
|
* Remove duplicit testZdenek Kabelac2012-02-131-2/+2
| | | | When it's space it's also not a '\0'.
* Add range test for device numberZdenek Kabelac2012-02-081-1/+1
| | | | Check the output of atoi is in valid range.
* Replace snprintf with dm_snprintfZdenek Kabelac2012-02-081-1/+1
| | | | | | snprintf testing for negative is replaced with dm_snprintf where this test really works. Add missing test for result of dm_snprintf().
* Give priority to emcpower devices with duplicate PVIDs.Alasdair Kergon2012-01-111-0/+11
|
* Make a cleaner split between config tree and config file functionality. MovePetr Rockai2011-12-181-4/+4
| | | | the latter out of libdm.
* Remove constant expression checkZdenek Kabelac2011-11-181-3/+0
| | | | | | | | | | | | "result_independent_of_operands: ((dev->dev & 0xfff00UL) >> 8) == 18446744073709551615UL /* -1 */ is always false regardless of the values of its operands (logical operand of if)." 'dev->dev' is set in dev-cache.c _insert() and it's not expectable st_rdev would have '-1' This code has been introduced with drbd support commit and code never worked - so eliminated.
* Fix major number filter structure boundary test.Milan Broz2011-11-111-3/+3
|
* Remove unneeded parameter.Milan Broz2011-11-111-1/+1
|
* And now add files for real.Milan Broz2011-11-112-0/+213
|
* Do not scan device if it is part of active multipath.Milan Broz2011-11-112-8/+27
| | | | | | | | | | | | | | | | | | | Add filter which tries to check if scanned device is part of active multipath. Firstly, only SCSI major number devices are handled in filter. Then it checks if device has exactly one holder (in sysfs) and if it is device-mapper device and DM-UUID is prefixed by "MPATH-". If so, this device is filtered out. The whole filter can be switched off by setting mpath_component_detection in lvm.conf. https://bugzilla.redhat.com/show_bug.cgi?id=597010 Signed-off-by: Milan Broz <mbroz@redhat.com>
* Move the core of the lib/config/config.c functionality into libdevmapper,Petr Rockai2011-08-306-22/+22
| | | | | | | leaving behind the LVM-specific parts of the code (convenience wrappers that handle `struct device` and `struct cmd_context`, basically). A number of functions have been renamed (in addition to getting a dm_ prefix) -- namely, all of the config interface now has a dm_config_ prefix.
* Add and use dev_open_readonly and variations.Alasdair Kergon2011-05-241-1/+1
|
* Do not issue an error message when unable to remove .cache on read-only fs.Peter Rajnoha2011-05-121-1/+1
|
* Obtain device list from udev by default if LVM2 is compiled with udev support.Peter Rajnoha2011-04-221-0/+14
| | | | | | | | | | | | | | Also, add a new 'obtain_device_list_from_udev' setting to lvm.conf with which we can turn this feature on or off if needed. If set, the cache of block device nodes with all associated symlinks will be constructed out of the existing udev database content. This avoids using and opening any inapplicable non-block devices or subdirectories found in the device directory. This setting is applied to udev-managed device directory only, other directories will be scanned fully. LVM2 needs to be compiled with udev support for this setting to take effect. N.B. Any device node or symlink not managed by udev in udev directory will be ignored with this setting on.
* Const fixingZdenek Kabelac2011-02-181-1/+1
| | | | | | | | | | | | | | | | Fixing some const warnings - with API change in: int vg_extend(struct volume_group *vg, int pv_count, const char *const *pv_names, Change is needed - as lvm2api expects const behaviour here. So vg_extend() is doing local strdup for unescaping. skip_dev_dir return const char* from const char* vg_name. Rest of the patch is cleanup of related warnings. Also using dm_report_filed_string() API change to simplify casting in _string_disp and _lvname_disp.
* Replace PV_MIN_SIZE with function pv_min_size()Zdenek Kabelac2011-02-181-1/+1
| | | | | | | | | | | | | | | | | Add configurable option to define minimal size of of block device usable as a PV. pv_min_size() is added to lvm-globals and it's being initialized through _process_config. Macro PV_MIN_SIZE is unused and removed. New define DEFAULT_PV_MIN_SIZE_KB is added to lvm-global and unlike PV_MIN_SIZE it uses KB units. Should help users with various slow devices attached to the system, which cannot be easily filtered out (like FDD on /dev/sdX): https://bugzilla.redhat.com/show_bug.cgi?id=644578
* Use O_DIRECT when reading block devices.Alasdair Kergon2011-01-271-1/+1
|
* add fioAlasdair Kergon2011-01-121-1/+2
|
* Fix memory leak in filter creation error pathZdenek Kabelac2011-01-061-7/+12
| | | | | | | If some allocation for peristent filter fails its memory reference was lost, fix it by calling filter's destructor. Fix log_error messages for failing allocation.
* Fix error path if regex engine cannot be created in _build_matcher().Zdenek Kabelac2010-12-201-1/+1
| | | | Fix only 'stack' printing with full function error exit.
* Add more strict const pointers around config treeZdenek Kabelac2010-12-204-7/+7
| | | | | | To have better control were the config tree could be modified use more const pointers and very carefully downcast them back to non-const (for config tree merge).
* Add dm_zalloc and use it and dm_pool_zalloc throughout.Alasdair Kergon2010-09-301-2/+1
|
* Fix name in msg in last checkin.Alasdair Kergon2010-09-221-1/+1
| | | | | (The problem the last checkin addressed was a segfault in 'pvs -a' if .cache didn't contain every PV in a VG.)
* Track recursive filter iteration to avoid refreshing while in use. (2.02.56)Alasdair Kergon2010-09-226-2/+28
|
* Recognise and give preference to md device partitions (blkext major).Peter Rajnoha2010-08-111-0/+10
| | | | | | | We can already detect MD devices internally. But when using MD partitions, these have "block extended major" (blkext) assigned (259). Blkext major is also used in general, so we need to check whether the original device is an MD device actually.
* Never scan internal LVM devices.Petr Rockai2010-08-091-2/+2
|
* Use __attribute__ consistently throughout.Alasdair Kergon2010-07-093-3/+3
|
* Always pass unsuspended dm devices through persistent filter to other filters.Alasdair Kergon2010-07-023-13/+29
| | | | Move test for suspended dm devices ahead of other filters.
* Don't merge unchanged persistent cache file before dumping if tool scanned.Alasdair Kergon2010-06-011-0/+5
|
* pre-releaseAlasdair Kergon2010-05-171-0/+1
|
* Skip also special lvm devices in scan (if ignore suspended is used).Milan Broz2010-05-131-2/+2
| | | | | | This should avoid various races between dmeventd on multiple nodes in cluster where one node already repairing device and another run full scan and locks the device.
* Currently if clvmd is running and user issues vgscan,Milan Broz2010-05-132-3/+3
| | | | | | | | | | | | | | the device cache file is dumped both in vgscan and clvmd process. Unfortunately, clvmd calls lvmcache_label_scan, it properly destroys persistent filter, but during persistent_filter_dump it merges old cache content back! This causes that change in filters is not properly propagated into device cache after vgscan on cluster. (Only new devices are added.) https://bugzilla.redhat.com/show_bug.cgi?id=591861
* Show string with invalid patternZdenek Kabelac2010-04-301-2/+2
| | | | and start error message with capital letter.
* Use fixed buffer to prevent stack overflow in persistent filter dump.Milan Broz2010-01-061-8/+3
|
* Cleanup returns for void functions.Zdenek Kabelac2009-12-112-3/+0
|
* Recognise DRBD device part and handle it similar to MD devices.Milan Broz2009-10-272-0/+33
| | | | | | | | | | | | | The DRBD uses underlying device so code should prefer top device if duplicate is found. Patch also introduce dev_subsystem_part_major and dev_subsytem_name functions to easily handle all these replication susbystems and not hardcode md_major call. See https://bugzilla.redhat.com/show_bug.cgi?id=530881 for full problem description.
* Fix pvcreate on a partition (regressed in 2.02.51).Mike Snitzer2009-08-192-0/+11
| | | | | | | | | | | Eliminate busy loop during pvcreate of a "normal" partition. _md_sysfs_attribute_snprintf() would busy loop if the device it was given was not a blkext-based MD partition. Rather than being cute with a busy-loop prone 'goto check_md_major' in _md_sysfs_attribute_snprintf(): explicitly check if the provided device is a blkext-based partition (blkext_major()); and then check that the get_primary_dev() determined parent is an MD device (md_major()).
* Add extended device (blkext) and MD partition (mdp) types to filters.Mike Snitzer2009-07-091-0/+2
| | | | | Both types were added with a 'max_partitions' of 1 because these devices are _not_ partitionable (they are the partitions).
* Fix segfault in persistent_filter_dump() if lvm init fails.Dave Wysochanski2009-07-081-1/+5
| | | | Just return_0 in persistent_filter_dump() if passed a NULL filter;