1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 20:25:52 +03:00
Commit Graph

452 Commits

Author SHA1 Message Date
Alasdair Kergon
d38bf3616c Fix orphan-related locking in pvdisplay and pvs.
Fix missing VG unlocks in some pvchange error paths.
Add some missing validation of VG names.
Rename validate_vg_name() to validate_new_vg_name().
Change orphan lock to VG_ORPHANS.
Change format1 to use ORPHAN as orphan VG name.
2007-11-02 20:40:05 +00:00
Bryn M. Reeves
8b98c12815 Add is_orphan_vg() and change all hardcoded checks to use it. 2007-11-02 13:06:42 +00:00
Dave Wysochanski
0f8387c2d6 Remove comment about allocation of pv->vg_name. 2007-10-12 21:08:38 +00:00
Dave Wysochanski
0283c439ec Add _alloc_pv() and _free_pv() from _pv_create() code and fix error paths.
Modified original patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
2007-10-12 18:37:19 +00:00
Dave Wysochanski
1b8de4cb25 Add pv_dev_name() to access PV device name.
Patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
2007-10-12 14:29:32 +00:00
Dave Wysochanski
70d9f98ed3 Accessor functions for PV will not modify the given PV.
So we can add 'const' to it.
Patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
2007-10-12 14:08:10 +00:00
Dave Wysochanski
9ea1d647af Non-functional change - refactor lv_create_empty().
Remove struct format_instance param - we can safely obtain
this from vg->fid inside the function.
2007-10-11 19:20:38 +00:00
Dave Wysochanski
8fd14f09e2 Non-functional change - refactor vg_add_snapshot fid parameter. 2007-10-11 18:51:21 +00:00
Dave Wysochanski
bf4f5b21a4 Some const fixups for previous checkins 2007-09-24 21:30:00 +00:00
Dave Wysochanski
dfef7f6942 Add %PVS extents option to lvresize, lvextend, and lvcreate. 2007-09-20 21:39:08 +00:00
Alasdair Kergon
9eea0107ba Fix strdup memory leak in str_list_dup(). 2007-09-17 16:02:46 +00:00
Dave Wysochanski
c6ea067fed move guts of pvresize into library 2007-08-30 20:30:41 +00:00
Jonathan Earl Brassow
a2cb3d17a7 When mirrors are created with the --nosync option, a status flag
(MIRROR_NOTSYNCED) is added to the LVM metadata.  This flag is
not cleared when converting to linear.  Subsequently, if you
up-convert the linear to a mirror, the flag remains - even though
an up-convert will always force a complete resync.
2007-08-29 20:19:11 +00:00
Dave Wysochanski
f603fe64bd Modify lvremove to prompt for removal if LV active on other cluster nodes.
Add '-f' to vgremove to force removal of VG even if LVs exist.
Update vgremove man page for '-f'.
2007-08-28 16:14:49 +00:00
Alasdair Kergon
21bc366486 Clean up numerous compiler warnings that crept in recently.
Remove several unused parameters from _allocate().
2007-08-22 14:38:18 +00:00
Alasdair Kergon
edb3374d32 Clean up mirrorlog argument processing.
Only permit --force, --verbose and --debug arguments to be repeated.
2007-08-21 19:46:36 +00:00
Dave Wysochanski
16669b5aa0 Move guts of vgremove into lvm library.
Include archiver.h in metadata.c as a result of prior move.
2007-08-21 17:38:20 +00:00
Dave Wysochanski
3d33abbb8c Prepare to move guts of vgremove into lvm library.
Fixup force_t.
2007-08-21 16:40:33 +00:00
Alasdair Kergon
be6845999b Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
Dave Wysochanski
cc78b9800d Move lv_remove_single() into library (lv_manip.c, metadata-exported.h).
Move yes_no_prompt() into library (display.c, display.h).
Fixup includes as a result of movement of prior two functions.
Fixup force_t enum to be more descriptive.
2007-08-20 17:04:53 +00:00
Dave Wysochanski
9eb05d9761 Prepare to move guts of lvremove into lvm library 2007-08-20 16:16:54 +00:00
Dave Wysochanski
be51e010b4 Remove extra checks for sub LV renaming.
Patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>.
2007-08-08 18:00:36 +00:00
Dave Wysochanski
2835f025b6 A few more cleanups for lvrename of mirrors checkin:
* add struct lv_names for old/new names
* replace lv->status & MIRROR checks with lv_is_visible()
2007-08-07 18:55:38 +00:00
Dave Wysochanski
4f4d5fdc67 Some simple fixups for last checkin:
* remove "_" from "return_0"
* improve some naming and terminology
* add 'const'
2007-08-07 16:57:09 +00:00
Jim Meyering
08c9ff434b Add "const" attributes where possible: first cut. 2007-08-07 09:06:05 +00:00
Dave Wysochanski
41a94b5400 Update a few comments 2007-08-06 21:11:27 +00:00
Dave Wysochanski
f58224119c Add support for renaming mirrored LVs.
Patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
2007-08-06 20:35:48 +00:00
Jim Meyering
e5e120a502 For consistency, rename local variable: s/newname/new_name/g. 2007-08-06 14:57:48 +00:00
Jim Meyering
b7449ebc37 Make lv_rename's interface "const correct".
* lib/metadata/lv_manip.c (lv_rename): Make char* param "const".
* lib/metadata/metadata-exported.h: Update prototype, too.
2007-08-06 09:04:21 +00:00
Dave Wysochanski
b7cd307f9b Factor out core of lvrename to lv_rename library function.
Patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
2007-08-03 21:22:10 +00:00
Dave Wysochanski
4f629c3bba Add CORRECT_INCONSISTENT and FAIL_INCONSISTENT flags to vg_lock_and_read 2007-07-23 21:03:42 +00:00
Dave Wysochanski
891c3d298b Add vg_lock_and_read() external library function. 2007-07-23 17:27:55 +00:00
Alasdair Kergon
03eee0e2ed Split metadata-external.h out from metadata.h for the tools to use. 2007-07-18 15:38:58 +00:00
Dave Wysochanski
33e5601937 Change pv_read_path to pv_by_path 2007-07-12 15:38:53 +00:00
Dave Wysochanski
0c795e2e18 Turn _add_pv_to_vg() into external library function add_pv_to_vg() 2007-07-12 05:04:42 +00:00
Dave Wysochanski
30303765a3 Refactor vg_extend error path. 2007-07-12 04:12:04 +00:00
Dave Wysochanski
c254039677 Add pv_read_path, a proposed external LVM library function to take a device path and return a PV handle 2007-07-11 23:33:12 +00:00
Alasdair Kergon
3c21da1797 Cope with find_seg_by_le() failure in check_lv_segments(). 2007-07-10 18:50:03 +00:00
Dave Wysochanski
ea8a12dbc1 Convert _add_pv_to_vg to usable LVM library function. 2007-07-02 21:48:30 +00:00
Petr Rockai
e7ddf4168d Make warnings go to stderr. Change log_warn to that effect, log_print
continues to send messages to stdout.
2007-06-28 17:33:44 +00:00
Dave Wysochanski
d6b1de30fe Convert vg->status checks to use vg_check_status function.\nRename status_flags to status in vg_check_status. 2007-06-19 04:36:12 +00:00
Dave Wysochanski
69483a8aaf Add vg_status function and clean up vg->status in tools directory 2007-06-19 04:23:32 +00:00
Dave Wysochanski
1f54709ee6 Make vg_extend() format_instance * parameter internal to vg_extend() 2007-06-19 00:33:43 +00:00
Dave Wysochanski
ff77bb1ab6 Remove get_ prefix from get_pv_* functions 2007-06-15 22:16:55 +00:00
Dave Wysochanski
3df2c388b1 convert pv->vg_name[0] to \!is_orphan(pv) 2007-06-14 15:48:05 +00:00
Dave Wysochanski
fb6ca78e05 Remove casts in pv_create and find_pv_in_vg_by_uuid 2007-06-13 21:14:07 +00:00
Dave Wysochanski
dd04871295 Convert pv_handle_t to pv_t * and tidy up whitespace 2007-06-13 20:55:56 +00:00
Dave Wysochanski
f1f4c1ea50 Add typedef pv_handle_t 2007-06-13 19:52:48 +00:00
Dave Wysochanski
b496210d9a Convert find_pv_in_vg_by_uuid and pv_create to use PV handles 2007-06-12 22:41:27 +00:00
Dave Wysochanski
fc2063b660 Change PV_HANDLE_DEREF to pv_field and add paren's 2007-06-12 21:39:49 +00:00
Dave Wysochanski
0e2f6120ee Add get_pv_* functions to return PV fields in prep for external LVM library 2007-06-12 21:20:20 +00:00
Dave Wysochanski
4e5f3e7331 Add wrappers to functions related to pv commands in preparation for exported LVM lib 2007-06-11 18:29:30 +00:00
Dave Wysochanski
c221b0bc21 Add vg_check_status to consolidate vg status flags checks and error messages. 2007-06-06 19:40:28 +00:00
Alasdair Kergon
4f2f566b06 Add devices/preferred_names config regex list for displayed device names.
Free a temporary dir string in fcntl_lock_file() after use.
Fix a dm_pool_destroy() in matcher_create().
Introduce goto_bad macro.
2007-04-26 16:44:59 +00:00
Dave Wysochanski
28d1c4d7e2 Update pvck to include text metadata area and record detection.
--
2007-04-25 21:10:55 +00:00
Dave Wysochanski
d915579c6b Update pvck to read labels on disk, with flexible --labelsector
parameter.

--
2007-04-25 20:03:16 +00:00
Dave Wysochanski
17a6fc0b45 Add 'scan_sector' parameter to label_read and _find_labeller to add
flexibility in searching for disk labels.
2007-04-23 18:21:01 +00:00
Milan Broz
5d06515c0b Fix creation and conversion of mirrors with tags. 2007-03-26 16:10:10 +00:00
Milan Broz
851002b87d Fix vgsplit for lvm1 format (set and validate VG name in PVs metadata).
Split metadata areas in vgsplit properly.
2007-03-23 12:43:17 +00:00
Alasdair Kergon
37fb985a82 If a PV reappears after it was removed from its VG, make it an orphan. 2007-02-07 13:29:52 +00:00
Alasdair Kergon
57fc4cc0b6 Add field definitions to report help text.
Remove unnecessary cmd arg from target_*monitor_events().
2007-01-24 16:51:24 +00:00
Alasdair Kergon
8a37910d51 register->monitor etc. 2007-01-19 22:21:45 +00:00
Alasdair Kergon
8ef6eb30d9 Report dmeventd mirror monitoring status. 2007-01-12 20:38:30 +00:00
Milan Broz
aa8a4d96bd Fix create mirror with name longer than 22 chars. 2007-01-05 15:53:40 +00:00
Alasdair Kergon
5b61ca7281 When lvconvert allocates a mirror log, respect parallel area constraints.
Use loop to iterate through the now-ordered policy list in _allocate().
Check for failure to allocate just the mirror log.
Introduce calc_area_multiple().
Support mirror log allocation when there is only one PV: area_count now 0.

(See lvm-devel list archives for further details.)
2006-12-13 03:39:58 +00:00
Alasdair Kergon
948ee3e396 Fix detection of smallest area in _alloc_parallel_area() for cling policy. 2006-12-12 19:30:10 +00:00
Alasdair Kergon
4dc0ec2253 Adjust some alignments for ia64 and sparc.
(Some of the changes are probably unnecessary.)
2006-11-30 23:11:42 +00:00
Alasdair Kergon
6c48fe7433 Fix mirror segment removal to use temporary error segment. 2006-11-30 17:52:47 +00:00
Alasdair Kergon
be0e37715e fix cast 2006-11-10 20:15:10 +00:00
Alasdair Kergon
f96cde8cbd Fix adjusted_mirror_region_size() for 64-bit size. 2006-11-10 19:35:03 +00:00
Alasdair Kergon
a89d601463 Add some missing bounds checks on 32 bit extent counters.
Add Petabyte and Exabyte support.
Fix lvcreate error message when 0 extents requested.
2006-11-10 18:24:11 +00:00
Alasdair Kergon
4d2a8d8231 fix last check-in: lv->size is in sectors 2006-11-03 21:07:15 +00:00
Alasdair Kergon
c89024511b Fix high-level free space check for partial allocations. 2006-10-30 16:10:55 +00:00
Alasdair Kergon
2bdc8e1252 Perform high-level free space check before each allocation attempt. 2006-10-23 15:54:51 +00:00
Alasdair Kergon
9766c3c960 Cope if same PV is included more than once in cmdline PE range list. 2006-10-21 23:18:43 +00:00
Alasdair Kergon
7c5ec12630 Add segment parameter to target_present functions. 2006-10-18 18:01:53 +00:00
Alasdair Kergon
de5c82a0d9 add cling allocation policy 2006-10-08 12:01:13 +00:00
Alasdair Kergon
b4e2a0e179 check_contiguous to use for_each_pv 2006-10-07 23:40:36 +00:00
Alasdair Kergon
5faf02761f rely on pv_setup functions to fix up pe_count 2006-10-07 23:06:18 +00:00
Alasdair Kergon
80592d845d more refactoring 2006-10-07 16:00:28 +00:00
Alasdair Kergon
b6f8552074 Extend _for_each_pv() to allow termination without error. 2006-10-07 12:41:06 +00:00
Alasdair Kergon
7dce16f234 abstract _is_contiguous() 2006-10-07 11:34:53 +00:00
Alasdair Kergon
b4ccb00b36 move _for_each_pv() 2006-10-07 11:23:22 +00:00
Alasdair Kergon
68d7c0e601 Remove duplicated pv arg from _check_contiguous(). 2006-10-07 11:00:09 +00:00
Alasdair Kergon
209f03f2b6 Fix format_text mda_setup pv->size and pv_setup pe_count calculations.
(This area of the code needs a lot more work.)
2006-10-05 22:02:52 +00:00
Alasdair Kergon
8d18637eca Fix _for_each_pv() for mirror with core log. 2006-10-05 21:24:48 +00:00
Alasdair Kergon
6c81ed26f0 Add LV column to reports listing kernel modules needed for activation. 2006-10-03 17:55:20 +00:00
Alasdair Kergon
5095de5177 Fix two potential NULL pointer derefs in error cases in vg_read(). 2006-09-21 20:25:54 +00:00
Alasdair Kergon
13ba0f9492 Fix lvconvert mirror change case detection logic.
Fix mirror log detachment so it correctly becomes a standalone LV.
2006-09-19 19:13:41 +00:00
Alasdair Kergon
bbb068562e Extend _check_contiguous() to detect single-area LVs.
Include mirror log (untested) in _for_each_pv() processing.
Use MIRROR_LOG_SIZE constant.
Remove struct seg_pvs from _for_each_pv() for generalisation.
Avoid adding duplicates to list of parallel PVs to avoid.
2006-09-11 21:14:56 +00:00
Alasdair Kergon
d9c6bbab80 Fix several incorrect comparisons in parallel area avoidance code.
Fix segment lengths when flattening existing parallel areas.
Log existing parallel areas prior to allocation.
Fix mirror log creation when activation disabled.
2006-09-11 14:24:58 +00:00
Alasdair Kergon
0550c1b618 Move lvm_snprintf into libdevmapper. 2006-08-21 12:54:53 +00:00
Alasdair Kergon
94d501edd9 Fix PE_ALIGN for pagesize over 32KB. 2006-08-17 19:53:36 +00:00
Alasdair Kergon
b5d761e1d2 wrap PE_ALIGN 2006-08-17 19:30:59 +00:00
Alasdair Kergon
916490f8bf Add lvm_getpagesize wrapper. 2006-08-17 18:23:44 +00:00
Alasdair Kergon
438abca889 Add checks for duplicate LV name, lvid and PV id before writing metadata.
Report all sanity check failures, not just the first.
2006-08-09 19:33:25 +00:00
Alasdair Kergon
8b0d546f4c Fix locking for mimage removal. 2006-07-20 20:37:10 +00:00
Alasdair Kergon
e67ed94b3e Add some forgotten memlock checks to _vg_read to protect against full scans. 2006-07-04 19:36:49 +00:00
Alasdair Kergon
4aae724656 Fix target_register_events args. 2006-05-25 13:32:26 +00:00
Alasdair Kergon
aba30ebcdb Add DISTCLEAN_TARGETS to make template for configure.h.
More fixes to error paths.
2006-05-16 20:53:13 +00:00
Alasdair Kergon
2293567c8c Fix lvcreate corelog validation.
Add --config for overriding most config file settings from cmdline.
  Quote arguments when printing command line.
  Remove linefeed from 'initialising logging' message.
  Add 'Completed' debug message.
  Don't attempt library exit after reloading config files.
  Always compile with libdevmapper, even if device-mapper is disabled.
2006-05-16 16:48:31 +00:00
Alasdair Kergon
8c4e429574 fix dev->device 2006-05-12 19:47:40 +00:00
Alasdair Kergon
de82843391 Add --nosync to lvcreate with LV flag NOTSYNCED. 2006-05-11 20:03:40 +00:00
Alasdair Kergon
aeb2c277a8 Add mirror log fault-handling policy. 2006-05-11 19:45:53 +00:00
Alasdair Kergon
526a3c2186 Propagate nosync flag around cluster. 2006-05-11 19:05:21 +00:00
Alasdair Kergon
532dae4854 Allow vgreduce to handle mirror log failures. 2006-05-11 19:01:11 +00:00
Alasdair Kergon
f17f6814c9 Add --corelog to lvcreate and lvconvert. 2006-05-11 18:54:04 +00:00
Alasdair Kergon
898e6f8e41 Add mirror_library description to example.conf.
More compile-time cleanup.
2006-05-11 17:58:58 +00:00
Alasdair Kergon
2c7fbadeef more coverity fixes 2006-05-10 17:49:25 +00:00
Alasdair Kergon
72b2cb613a Make SIZE_SHORT the default for display_size().
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.
2006-05-09 21:23:51 +00:00
Alasdair Kergon
98513c2729 fix stripesize const 2006-05-02 07:14:43 +00:00
Alasdair Kergon
12de747d3a Improve stripe size validation.
Increase maximum stripe size limit to physical extent size for lvm2 metadata.
2006-04-29 22:08:43 +00:00
Alasdair Kergon
6aa17fe8d2 remove redundant list_init 2006-04-27 17:58:48 +00:00
Alasdair Kergon
26b2524996 Invalidate cache if composition of VG changed externally. 2006-04-21 19:12:41 +00:00
Alasdair Kergon
8a2fc58645 Check for libsepol.
Add some cflow & scope support.
Separate out DEFS from CFLAGS.
Remove inlines and use unique function names.
2006-04-19 15:33:07 +00:00
Alasdair Kergon
dbd3026f8a vgrename accepts vgid and exported VG. 2006-04-13 21:08:29 +00:00
Alasdair Kergon
a5fe5a7cdd Fix vgexport/vgimport to set/reset PV exported flag so pv_attr is correct.
Add vgid to struct physical_volume and pass with vg_name to some functions.
2006-04-12 21:23:04 +00:00
Alasdair Kergon
e8db70239e If two or more VGs are found with the same name, use one that is not exported. 2006-04-12 17:54:11 +00:00
Alasdair Kergon
ace652e673 lv_is_visible() 2006-04-07 17:41:56 +00:00
Alasdair Kergon
2cd0aa727a Introduce origin_from_cow() 2006-04-06 13:39:16 +00:00
Alasdair Kergon
e64934773b Fix lvscan snapshot full display.
dmeventd fixes
2005-12-08 17:49:34 +00:00
Alasdair Kergon
15d91f5a68 More dmeventd support. 2005-12-02 20:35:07 +00:00
Alasdair Kergon
e2619d9ec1 more lvconvert mirror code 2005-11-29 18:20:23 +00:00
Alasdair Kergon
c27920b1ca Determine parallel PVs to avoid with ALLOC_NORMAL allocation. (untested) 2005-11-28 20:01:00 +00:00
Alasdair Kergon
e3195fecf1 alloc avoids parallel pvs when supplied 2005-11-24 21:23:55 +00:00
Alasdair Kergon
c0a33e10ae preparation for parallel_areas changes to allocation code 2005-11-24 20:58:44 +00:00
Alasdair Kergon
2fb492f665 Fix lv_empty. 2005-11-24 18:46:51 +00:00
Alasdair Kergon
c00f802202 _find_parallel_space -> _find_segment_space 2005-11-24 18:00:47 +00:00
Alasdair Kergon
b79c897ea1 Extend allocation areas to avoid overflow with contiguous with other PVs.
Another pvmove fix.
2005-11-10 14:45:39 +00:00
Alasdair Kergon
ad6b0ebb73 rename deptree 2005-11-09 13:08:41 +00:00
Alasdair Kergon
5f4b2acfe5 Replacement activation code. [Don't use this yet!] 2005-11-08 22:52:26 +00:00
Alasdair Kergon
7a5933259f Clear up precommitted metadata better on disk after use.
[Some activation-related features will stop working for a while now.
Some types of activation are getting split into two steps, with the
first step using the precommitted metadata.]
2005-10-31 20:15:28 +00:00
Alasdair Kergon
faf07d358f revert unfinished change 2005-10-31 15:46:29 +00:00
Alasdair Kergon
3bf5f6f575 A pvresize implementation (Zak Kipling). 2005-10-31 02:37:29 +00:00
Alasdair Kergon
1817dbaf60 more mirror library functions 2005-10-28 12:48:50 +00:00
Alasdair Kergon
d31718600b Fix contiguous allocation without preceding segments. 2005-10-27 22:20:33 +00:00
Alasdair Kergon
e6c20c6100 Fix new mirror_seg pointer. 2005-10-27 21:51:28 +00:00
Alasdair Kergon
5727a8fa85 Add mirror_seg pointer to lv_segment struct. (incomplete & untested) 2005-10-27 19:58:22 +00:00
Alasdair Kergon
352a99b95a Use dm_is_dm_major instead of local copy.
Allow mapped devices to be used as PVs safely.
2005-10-25 19:08:21 +00:00
Alasdair Kergon
78aa12e1dc Fix automatic text metadata buffer expansion (using macro). [stdarg usage bug]
Cache formatted text metadata buffer between metadata area writes.
  [improves write performance when lots of metadata area clones]
2005-10-23 00:14:48 +00:00
Alasdair Kergon
06820362bd Split lv_segment_area from lv_segment to permit extension. 2005-10-18 13:43:40 +00:00
Alasdair Kergon
2262b32057 Use hash, bitset, malloc, pool from libdevmapper. 2005-10-16 23:03:59 +00:00
Alasdair Kergon
07d318310b Prepare tools to support clustered mirrors. 2005-08-14 23:18:28 +00:00
Alasdair Kergon
bfd31e94d5 Factor out adjusted_mirror_region_size() 2005-08-12 19:23:08 +00:00
Alasdair Kergon
0440a206dc Fix pvmove segment splitting.
Abstract vg_validate.
2005-07-12 19:40:59 +00:00
Alasdair Kergon
10b44b2d4a Only make one attempt at contiguous allocation. 2005-07-12 14:50:45 +00:00
Alasdair Kergon
b6d69d0c1e missing fn defs 2005-06-14 18:22:31 +00:00
Alasdair Kergon
5e947dac48 Various allocation-related pvmove fixes. 2005-06-14 17:54:48 +00:00
Alasdair Kergon
5748cb17f8 Remove hard-coded 64k text metadata writing restriction. 2005-06-07 11:00:07 +00:00
Alasdair Kergon
8b80d2a57c Make VG name restrictions consistent. 2005-06-06 18:16:33 +00:00