summaryrefslogtreecommitdiffstats
path: root/lib/format1/import-extents.c
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: format1 test whether PV was foundZdenek Kabelac2012-08-231-1/+4
| | | | Avoid dereferecing NULL pointer.
* Always use vg memory pool for allocated lv segmentZdenek Kabelac2011-10-231-3/+3
| | | | | Remove mem pool parameter from alloc_lv_segment() Since we should always allocate LV segment from the vg mempool.
* lvcreate parsing for thin provisioning.Alasdair Kergon2011-09-061-2/+2
| | | | The rest is incomplete so this isn't usable yet.
* Fix reading of unitialized memoryZdenek Kabelac2011-03-301-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Could be reached via few of our lvm2 test cases: ==11501== Invalid read of size 8 ==11501== at 0x49B2E0: _area_length (import-extents.c:204) ==11501== by 0x49B40C: _read_linear (import-extents.c:222) ==11501== by 0x49B952: _build_segments (import-extents.c:323) ==11501== by 0x49B9A0: _build_all_segments (import-extents.c:334) ==11501== by 0x49BB4C: import_extents (import-extents.c:364) ==11501== by 0x497655: _format1_vg_read (format1.c:217) ==11501== by 0x47E43E: _vg_read (metadata.c:2901) cut from t-vgcvgbackup-usage.sh -- pvcreate -M1 $(cat DEVICES) vgcreate -M1 -c n $vg $(cat DEVICES) lvcreate -l1 -n $lv1 $vg $dev1 -- Idea of the fix is rather defensive - to allocate one extra element to 'map' array which is then used in _area_length() - where the loop checks, whether next map entry is continuous. By placing there always one extra zero entry - we fix the read of unallocated memory, and we make sure the data would not make a continous block. FIXME: there could be a problem if some special broken lvm1 data would be imported. As the format1 is currently not really used - leave it for future fix and use this small hotfix for now.
* Fix pvmove allocation to take existing parallel stripes into account.Alasdair Kergon2010-04-081-2/+2
| | | | | | When moving parts of striped LVs, pvmove wouldn't care about leaving you with two stripes on the same disk. Now --alloc anywhere is needed for that. (Tried and gave up on two alternative approaches before the one committed here.)
* Use log_error macro consistently throughout in place of log_err.Alasdair Kergon2009-07-151-13/+13
|
* Right, a simple build (without options) is working again.Alasdair Kergon2008-11-031-7/+7
|
* Some whitespace tidy-ups.Alasdair Kergon2008-01-301-2/+2
|
* Use stack return macros throughout.Alasdair Kergon2008-01-301-24/+12
|
* Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1.Alasdair Kergon2007-08-201-3/+3
|
* Add devices/preferred_names config regex list for displayed device names.Alasdair Kergon2007-04-261-12/+6
| | | | | | Free a temporary dir string in fcntl_lock_file() after use. Fix a dm_pool_destroy() in matcher_create(). Introduce goto_bad macro.
* Try to fix reading in of lvm1 striped LVs.Alasdair Kergon2007-03-151-33/+36
| | | | | | | There are two fixes other than improving variable names and updating code layout etc. The loop counter is incremented by area_len instead of area_len * stripes; the 3rd _check_stripe parameter is no longer multiplied by number of stripes.
* Make SIZE_SHORT the default for display_size().Alasdair Kergon2006-05-091-1/+1
| | | | | | | Fix some memory leaks in error paths found by coverity. Use C99 struct initialisers. Move DEFS into configure.h. Clean-ups to remove miscellaneous compiler warnings.
* Add details to format1 'Invalid LV in extent map' error message.Alasdair Kergon2005-12-191-1/+6
|
* Use hash, bitset, malloc, pool from libdevmapper.Alasdair Kergon2005-10-161-23/+21
|
* Basic support for mirrors.Alasdair Kergon2005-06-011-12/+8
|
* Reinstate full PV size when removing from VG.Alasdair Kergon2005-05-031-4/+11
| | | | | Support loopfiles for testing. Complete the pv_segment support.
* extend alloc_lv_segmentAlasdair Kergon2005-04-221-55/+55
|
* set_lv_segment_area_pv/lvAlasdair Kergon2005-04-221-3/+1
|
* Internal snapshot code restructuring.Alasdair Kergon2005-04-071-0/+2
|
* pool debuggingAlasdair Kergon2004-11-231-1/+1
|
* Rename old segtypes files to segtype.Alasdair Kergon2004-09-161-1/+1
|
* Set area_count within alloc_lv_segmentAlasdair Kergon2004-05-241-2/+0
|
* Begin to separate out segment types.Alasdair Kergon2004-05-041-15/+24
|
* Update copyright notices.Alasdair Kergon2004-03-301-2/+11
|
* Extract some common functions.Alasdair Kergon2003-09-171-15/+3
|
* o Metadata area struct change.Alasdair Kergon2003-04-241-20/+26
| | | | | o Support physical extent restrictions on PV lists for allocations e.g. lvcreate -l 200 vg1 /dev/sda1:100-199:300-399
* Refactoring.Alasdair Kergon2002-11-181-7/+8
|
* Merge adjacent "Missing" segments.Alasdair Kergon2002-07-101-2/+4
|
* Merge with text format branch.Alasdair Kergon2002-04-241-3/+2
| | | | | | | | | | | | | | | | | | | Lots of changes/very little testing so far => there'll be bugs! Use 'vgcreate -M text' to create a volume group with its metadata stored in text files. Text format metadata changes should be reasonably atomic, with a (basic) automatic recovery mechanism if the system crashes while a change is in progress. Add a metadata section to lvm.conf to specify multiple directories if you want (recommended) to keep multiple copies of the metadata (eg on different filesystems). e.g. metadata { dirs = ["/etc/lvm/metadata1","/usr/local/lvm/metadata2"] } Plenty of refinements still in the pipeline.
* Basic support for (read-only) partial activation if any PVs areAlasdair Kergon2002-01-301-2/+2
| | | | | | missing from a VG. (Linear targets use the device-mapper 'error' target which returns ioerror; striped targets use '/dev/ioerror' for now - which must already exist e.g. as a sufficiently large block device version of /dev/zero).
* o Basic support for exporting (but importing not completed yet).Alasdair Kergon2002-01-291-0/+1
| | | | | o When volume group does not have write flag set, prevent changes to it. o Preparation for partial activation (not completed yet).
* The latest attempt at making extended striped LVs work portably with LVM1.Alasdair Kergon2002-01-251-37/+54
|
* o TidyJoe Thornber2002-01-251-64/+40
|
* o Remove pointless calculation.Joe Thornber2002-01-241-2/+0
|
* o Similar changes for lv_list.Joe Thornber2002-01-211-3/+3
|
* Add internal cache holding a 'hint' list of the PVs belonging to each VG.Alasdair Kergon2001-12-131-32/+56
| | | | | | | A substantial speed-up - particularly in readline mode. If the hints turn out to be wrong, the relevant parts get thrown away. vgscan destroys it totally. In both cases it then rebuilds itself as required.
* Fixes for allocation of striped volumes.Alasdair Kergon2001-12-071-16/+41
|
* o I was reading striped volumes incorrectly.Joe Thornber2001-11-291-31/+58
|
* o Tool support for segments.Alasdair Kergon2001-11-281-4/+3
| | | | o vgmerge working.
* o extra error checkingJoe Thornber2001-11-271-6/+16
|
* o Get format1 building.Joe Thornber2001-11-271-13/+27
|
* o Sync up todays work on converting to the segmented representation ofJoe Thornber2001-11-271-0/+278
logical volumes. It includes: format1 changes. metadata.h changes. lv_manip.c changed (striped allocation still not done though). activate.c changes. Nothing has been near a compiler as yet. Alasdair can you look at changing display.c to use to output the mappings in a more segment oriented format please ? I haven't put the span list into struct physical_volume to represent allocated extents. I think the burden of maintaining it for things like lv_extend may out weigh it's uses.