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

1465 Commits

Author SHA1 Message Date
Alasdair Kergon
59743245b4 Fix up cache for PVs without mdas after consistent VG metadata is processed. 2008-06-27 15:18:31 +00:00
Alasdair Kergon
6db4136358 Update validation of safe mirror log type conversions in lvconvert. (brassow) 2008-06-26 23:05:11 +00:00
Alasdair Kergon
36081ccf2d Fix reporting of LV fields alongside unallocated PV segments. 2008-06-25 16:52:27 +00:00
Alasdair Kergon
1f787aca28 Add --rows to reports. 2008-06-24 22:48:53 +00:00
Alasdair Kergon
30ef4c738a Add --unquoted to reporting tools. 2008-06-24 21:21:04 +00:00
Dave Wysochanski
15db00b53e Refactor pv_create() to take cmd_context - no functional change. 2008-06-24 20:10:32 +00:00
Dave Wysochanski
274788b4a5 Suppress invalid 'sb_offset' compiler warning (FC8) with uninitialized_var().
device/dev-md.c:61: warning: ‘sb_offset’ may be used uninitialized in this function
2008-06-23 19:26:21 +00:00
Dave Wysochanski
2d415cf9f8 Add uninitialized_var macro to suppress invalid compiler warnings.
One such warning is seen on fedora9 gcc compiler:
/metadata.c:1923: warning: 'results' may be used uninitialized in this function
2008-06-23 19:04:34 +00:00
Dave Wysochanski
626dd7a5fe Suppress 'sb_offset' compiler warning by using enum for md superblock versions.
The warning is bogus and is only seen on certain versions of gcc.
However using the enum does seem to clarify the intent of the code - only
3 possible md minor superblock versions.

Related compiler warning:
device/dev-md.c:53: warning: 'sb_offset' may be used uninitialized in this function
2008-06-23 14:54:50 +00:00
Zdenek Kabelac
5f2c195933 Improve/Fix read ahead 'auto' calculation for stripe_size
Fix lvchange output for -r auto setting if auto is already set
Add testcase for read ahead
2008-06-18 11:32:14 +00:00
Dave Wysochanski
0187112396 Fix identifier 'error_message_produced' used ambiguously.
Related compiler warning:
log/log.c:242: warning: declaration of 'error_message_produced' shadows a global declaration
../include/log.h:98: warning: shadowed declaration is here
2008-06-17 14:14:00 +00:00
Jim Meyering
d0191583e8 Begin syncing configure.in for merge/unification with device-mapper. 2008-06-13 14:37:18 +00:00
Jim Meyering
ac27ef2593 Don't deref uninitialized log_lv upon failed mirror addition.
* mirror.c (add_mirror_images): Ensure that log_lv is initialized.
2008-06-13 12:15:55 +00:00
Zdenek Kabelac
25a9fda4f6 copy vgid only when volume group is present in import_pool_pv 2008-06-11 13:14:41 +00:00
Alasdair Kergon
56637f2a85 Fix tracking of validity of PVs with no mdas in lvmcache. 2008-06-11 11:02:05 +00:00
Zdenek Kabelac
d9c8469363 Fix wrong free_count on imported volume group from pool device
Fix segfault when calling pvcreate on the pool device
2008-06-10 14:55:14 +00:00
Alasdair Kergon
80b7fe0e88 Fix segfault after _free_vginfo by remembering to remove vginfo from list. 2008-06-09 16:22:33 +00:00
Alasdair Kergon
bfadd2133e Tweak detection of invalid fid after changes to PVs in VG in _vg_read. 2008-06-08 14:18:44 +00:00
Alasdair Kergon
424dd43e6f Revert assuming precommitted metadata is live when activating (unnecessary). 2008-06-08 11:33:15 +00:00
Alasdair Kergon
ec40d92889 post-release 2008-06-06 19:28:35 +00:00
Alasdair Kergon
697e3bb2df back out unnecessary changes for this release 2008-06-06 17:36:19 +00:00
Alasdair Kergon
f0dfe9dcda fix _free_vginfo not to remove a ref to a *different* vginfo from the vgid cache 2008-06-06 12:43:40 +00:00
Alasdair Kergon
d0de492ff3 cope with volatile vginfo in vg_read 2008-06-06 11:12:50 +00:00
Alasdair Kergon
57d0dc0db2 Allow for vginfo changing during _vg_read. 2008-06-06 09:48:04 +00:00
Alasdair Kergon
e350c2f648 Decode numbers in clvmd debugging output. 2008-06-05 14:24:28 +00:00
Alasdair Kergon
e4b34bfad0 When activating, if precommitted metadata is still cached, assume it's live. 2008-06-05 13:06:39 +00:00
Alasdair Kergon
4bfa132445 When removing LV symlinks, skip any where the VG name is not determined. 2008-06-05 12:45:55 +00:00
Alasdair Kergon
ad134662a2 Drop metadata cache if update fails in vg_revert or vg_commit. 2008-06-03 17:56:54 +00:00
Alasdair Kergon
dcd5353502 Correct config file line numbers in messages when parsing comments. (kabi) 2008-06-03 17:51:04 +00:00
Alasdair Kergon
de24008109 In script-processing mode, stop if any command fails.
Warn if command exits with non-zero status code without a prior log_error.
2008-05-30 15:27:44 +00:00
Alasdair Kergon
0a5b690b70 fix setpriority int error 2008-05-28 23:12:45 +00:00
Alasdair Kergon
bdce11cb30 Avoid spurious duplicate VG messages referring to VGs that are gone.
(untested)
2008-05-28 22:27:47 +00:00
Alasdair Kergon
fc54be1062 Refactor some vginfo manipulation code. 2008-05-19 19:49:56 +00:00
Alasdair Kergon
3dfd8f12dc more cleanup 2008-05-09 19:26:58 +00:00
Alasdair Kergon
98fd1ce332 More P_ and V_ lock cleanup. 2008-05-09 18:45:15 +00:00
Alasdair Kergon
3d6af3e35e Add missing mutex around clvmd lvmcache_drop_metadata library call. 2008-05-09 15:13:20 +00:00
Alasdair Kergon
1a20d53171 Avoid unnecessary unlock attempts with LCK_CACHE pseudo-locks. 2008-05-08 18:35:58 +00:00
Alasdair Kergon
3835ad6b1c When asked to drop cached committed VG metadata, invalidate cached PV labels. 2008-05-08 18:28:27 +00:00
Alasdair Kergon
d9c0105fef Drop metadata cache before writing precommitted metadata instead of after. 2008-05-08 18:06:58 +00:00
Alasdair Kergon
d3ccaf8ae5 remove unused lvmcache_drop_vg prototype 2008-05-08 18:00:47 +00:00
Alasdair Kergon
eddc0f3307 post-release - reinstate incomplete enhancements 2008-04-29 16:11:28 +00:00
Alasdair Kergon
04ed52f6a0 pre-release (bug fixes only - enhancements excluded) 2008-04-29 15:58:25 +00:00
Alasdair Kergon
b5618c07d8 Exclude VG_GLOBAL from internal concurrent VG lock counter.
(Avoids 'device left open' warning messages from vgscan etc.)
2008-04-24 02:22:07 +00:00
Dave Wysochanski
8e8baf89c0 Fix vgsplit internal counting of snapshot LVs. 2008-04-23 14:33:06 +00:00
Alasdair Kergon
fd1b118942 Check lv_count in vg_validate.
Fix internal LV counter when a snapshot is removed.
2008-04-22 12:54:33 +00:00
Alasdair Kergon
a93ae114b8 Fix metadata corruption writing lvm1-formatted metadata with snapshots. 2008-04-22 11:47:22 +00:00
Alasdair Kergon
f419a87150 Add --prefixes to reporting tools for field name prefix output format.
E.g. lvs --prefixes --noheadings --unbuffered --units m --nosuffix

(Used '--prefixes' for now, but I'm looking for a better name.)
2008-04-20 00:15:08 +00:00
Alasdair Kergon
082628eb2c missing stack 2008-04-15 14:57:12 +00:00
Milan Broz
581b17def2 Drop cached VG metadata before and after committing changes to it. 2008-04-15 14:46:19 +00:00
Alasdair Kergon
adb578238d rename P_global to P_#global 2008-04-15 11:36:46 +00:00
Alasdair Kergon
c4afaa05a4 Don't attempt remote metadata backups of non-clustered VGs. (2.02.29) 2008-04-14 19:49:12 +00:00
Alasdair Kergon
8b1ae3c140 Don't store fid in VG metadata cache to avoid clvmd segfault. (2.02.34) 2008-04-14 19:24:16 +00:00
Dave Wysochanski
5ca6698f12 Add lv_is_active() to determine whether an lv is active.
Handles non-clustered as well as clustered.  For clustered,
the best we can do is try exclusive local activation.  If this
succeeds, we know it is not active elsewhere in the cluster.
Otherwise, we assume it is active elsewhere.
2008-04-10 21:34:18 +00:00
Alasdair Kergon
3a370b7350 more pre-release cleanup 2008-04-10 19:59:43 +00:00
Alasdair Kergon
3af1fa76eb fix 3rd copy 2008-04-10 19:16:35 +00:00
Alasdair Kergon
0b2a795ece make list_move consistent with other list fns 2008-04-10 19:14:27 +00:00
Alasdair Kergon
3cde54c50e . 2008-04-10 18:53:36 +00:00
Alasdair Kergon
2e050bfc36 Fix vgdisplay 'Cur LV' field to match lvdisplay output.
Fix lv_count report field to exclude hidden LVs.
2008-04-10 17:19:02 +00:00
Dave Wysochanski
985ca02b6a Add vg_is_clustered() helper function.
Should be no functional change.
2008-04-10 17:09:32 +00:00
Alasdair Kergon
eb273c7c65 Use clustered mirror log with pvmove in clustered VGs, if available. 2008-04-09 12:56:34 +00:00
Alasdair Kergon
6eb44b5091 Fix vgreduce to use vg_split_mdas to check sufficient mdas remain.
Add (empty) orphan VGs to lvmcache during initialisation.
Fix orphan VG name used for format_pool.
2008-04-08 12:49:21 +00:00
Alasdair Kergon
ad607a23f1 create fids for internal orphan VGs 2008-04-07 22:12:37 +00:00
Milan Broz
d334793f2a Update lvmcache VG lock state for all locking types now. 2008-04-07 19:17:29 +00:00
Milan Broz
8bf70e11ee Fix output if overriding command_names on cmdline. 2008-04-07 13:53:26 +00:00
Milan Broz
5619c629f6 Add detection of clustered mirror log capability.
Currently only check for kernel module presence.
2008-04-07 10:23:47 +00:00
Dave Wysochanski
9da5d7ac02 Add check to vg_commit() to ensure lock is held before writing new VG metadata. 2008-04-04 15:41:20 +00:00
Alasdair Kergon
906935e580 Add some basic internal VG lock validation. 2008-04-03 18:56:40 +00:00
Alasdair Kergon
810e500118 fix vd->virtblk 2008-04-03 10:29:00 +00:00
Alasdair Kergon
bae74dff07 enable vg metadata cache by default 2008-04-02 21:31:14 +00:00
Alasdair Kergon
bf7dea978e Add per-command flags to control which commands use the VG metadata cache. 2008-04-02 21:23:39 +00:00
Alasdair Kergon
6e210a6c54 Cache VG metadata internally while VG lock is held. 2008-04-01 22:40:13 +00:00
Dave Wysochanski
9332d2cb9d Add find_lv_in_lv_list() and find_pv_in_pv_list().
Update _add_pvs() to call find_pv_in_pv_list().
2008-03-28 19:08:23 +00:00
Dave Wysochanski
8e32e58e00 Use list_move() in applicable places. 2008-03-26 17:26:32 +00:00
Dave Wysochanski
052bbfba3a Add pvseg_is_allocated() for identifying a PV segment allocated to a LV. 2008-03-26 16:48:10 +00:00
Dave Wysochanski
43aa463780 Add list_move() support function for list manipulation. 2008-03-26 16:20:54 +00:00
Alasdair Kergon
7284f3f966 preparation for vg cache 2008-03-17 16:51:31 +00:00
Dave Wysochanski
ad8f37df1b Const cleanups in find_* functions. 2008-03-13 22:51:24 +00:00
Alasdair Kergon
dc2bdce11e Refactor text format initialisation into _init_text_import. 2008-03-13 12:33:22 +00:00
Alasdair Kergon
d4ce89d9da Escape double quotes and backslashes in external metadata and config data.
Add functions for escaping double quotes in strings.
Rename count_chars_len to count_chars.
2008-03-12 16:03:22 +00:00
Alasdair Kergon
bcacf9d0e3 Use return_0 in a couple more places.
Correct a function name typo in _line_append error message.
2008-03-10 18:51:27 +00:00
Alasdair Kergon
7eda3692f6 add vd to filters 2008-03-05 18:15:04 +00:00
Alasdair Kergon
60be88a0a6 Fix resetting of MIRROR_IMAGE and VISIBLE_LV after removal of LV. 2008-02-22 13:28:29 +00:00
Alasdair Kergon
4c0f4125ec Fix remove_layer_from_lv to empty the LV before removing it. (2.02.30) 2008-02-22 13:22:44 +00:00
Alasdair Kergon
39d3ec0b51 Add missing no-longer-used segs_using_this_lv test to check_lv_segments. 2008-02-22 13:22:21 +00:00
Jim Meyering
a34a6a3f71 is_orphan: make parameter "const" to avoid compiler warning 2008-02-13 20:01:48 +00:00
Alasdair Kergon
bb097a97ea split orphan VG by format type 2008-02-06 15:47:28 +00:00
Alasdair Kergon
894c6af744 a couple more compiler warnings 2008-01-31 12:35:31 +00:00
Alasdair Kergon
4e9083db10 Fix mirror log name construction during lvconvert. (2.02.30)
Make monitor_dev_for_events recurse through the stack of LVs.
Clean up some more compiler warnings.
Add mirror names test script.
2008-01-31 12:19:36 +00:00
Alasdair Kergon
16e2a5aa3b only read labels once between each lock event 2008-01-30 16:18:37 +00:00
Alasdair Kergon
2871881859 undo a few 'stack' moves 2008-01-30 14:17:29 +00:00
Alasdair Kergon
67cdbd7e4d Some whitespace tidy-ups. 2008-01-30 14:00:02 +00:00
Alasdair Kergon
c51b9fff19 Use stack return macros throughout. 2008-01-30 13:19:47 +00:00
Alasdair Kergon
962b2a559d Rely upon internally-cached PV labels while corresponding VG lock is held. 2008-01-29 23:45:48 +00:00
Alasdair Kergon
5dc6c0de80 Fix two check_lv_segments error messages to show whole segment. 2008-01-26 00:30:28 +00:00
Alasdair Kergon
3d13b4677d Refactor mirror log attachment code. 2008-01-26 00:25:04 +00:00
Alasdair Kergon
ec2bd20886 suppress compiler warning 2008-01-22 16:02:26 +00:00
Dave Wysochanski
1ce224d13f Fix vgsplit - print error if vgcreate option given w/existing vg destination
Fix vgsplit - reject split if metadata types or clustered attributes differ
Fix vgsplit - remove physicalextentsize option
Add vgsplit test cases
2008-01-22 02:48:53 +00:00
Alasdair Kergon
0e0a6eb6cf Fix lvcreate --nosync not to wait for non-happening sync. 2008-01-18 22:02:37 +00:00
Alasdair Kergon
7644c656d8 add lvconvert messages 2008-01-18 22:00:46 +00:00
Alasdair Kergon
0c06de632a pre-release review cleanups 2008-01-17 17:17:09 +00:00
Alasdair Kergon
3650e518e7 fix default extent_size 2008-01-17 15:31:18 +00:00
Alasdair Kergon
db24ceca33 rename lv_remap_error 2008-01-17 13:54:05 +00:00
Alasdair Kergon
58a63ae973 mirror log stuff 2008-01-17 13:37:51 +00:00
Alasdair Kergon
5cf3c51857 lvconvert/vgreduce fixes 2008-01-17 13:13:54 +00:00
Alasdair Kergon
70955d40a1 fix a _get_vgs return 2008-01-16 22:52:46 +00:00
Alasdair Kergon
79182305ef additional safety check on new segment list 2008-01-16 20:00:01 +00:00
Dave Wysochanski
d865615e9a Create vgs_are_compatible() fn to check whether vgs are compatible for merging.
Add new vgmerge and vgsplit tests to check rejection of incompatible vgs.
Cleanup comments.
Bugzilla: bz251992

---
 lib/metadata/metadata-exported.h |    3 +
 lib/metadata/metadata.c          |   89 +++++++++++++++++++++++++++++++++-
 test/t-vgmerge-usage.sh          |  101 +++++++++++++++++++++++++++++++++++++++
 test/t-vgsplit-operation.sh      |   20 +++++++
 tools/vgmerge.c                  |   69 --------------------------
 tools/vgsplit.c                  |    5 -
 6 files changed, 215 insertions(+), 72 deletions(-)
2008-01-16 19:54:39 +00:00
Alasdair Kergon
ba4d6ad8ea adjust mirror log error message 2008-01-16 19:50:23 +00:00
Alasdair Kergon
17431cddac cope with stacked LVs as well as PVs when deciding which bits of mirrors to remove 2008-01-16 19:38:39 +00:00
Alasdair Kergon
876003dc44 allow a mirror to contain only one mimage 2008-01-16 19:18:51 +00:00
Alasdair Kergon
171b53fb25 export find_temporary_mirror() 2008-01-16 19:13:51 +00:00
Alasdair Kergon
e344497277 move removable_pvs checking 2008-01-16 19:11:39 +00:00
Alasdair Kergon
7d18ea22eb reorder funcs 2008-01-16 19:09:35 +00:00
Alasdair Kergon
72baf0c345 Maintain lists of stacked LV segments using each LV. 2008-01-16 19:00:59 +00:00
Alasdair Kergon
fb3226a3ed use scan_vgs_for_pvs to detect non-orphans without MDAs 2008-01-16 18:15:26 +00:00
Alasdair Kergon
a1ff319fda Don't use block_on_error with mirror targets above version 1.12. 2008-01-16 15:24:25 +00:00
Dave Wysochanski
8868a4ffc2 Move more parameter validation into the library.
Update vgrename to call validate_vg_rename_params().
Fix vgcreate and vgsplit default arguments by adding defaults parameter to
fill_vg_create_params().
Add t-vgrename-usage.sh test.
Bugzilla: bz251992
---
 tools/toollib.c  |   32 ++++++++------------------------
 tools/toollib.h  |    5 ++---
 tools/vgcreate.c |   35 +++++++++++++++++++++--------------
 tools/vgrename.c |   35 ++++++-----------------------------
 tools/vgsplit.c  |   21 ++++++++++++++-------
 5 files changed, 51 insertions(+), 77 deletions(-)
2008-01-15 22:56:30 +00:00
Dave Wysochanski
b8daca8570 Allow vgcreate options as input to vgsplit when new vg is split destination. 2008-01-14 21:07:58 +00:00
Dave Wysochanski
f1bf446893 Fix warning on conditional compile, unused variable 2008-01-11 17:44:26 +00:00
Alasdair Kergon
4d8033dc84 correct field name 2008-01-10 22:21:25 +00:00
Alasdair Kergon
114557c04b Add lv_convert field to default lvs output. 2008-01-10 19:25:07 +00:00
Alasdair Kergon
06ea7eaa27 Various lvconvert/polldaemon-related fixes from NEC. See lvm-devel
for original patches & explanations.
2008-01-10 18:35:51 +00:00
Petr Rockai
67961c7c10 Add snapshot dmeventd library (enables dmeventd snapshot monitoring). 2008-01-09 15:32:19 +00:00
Zdenek Kabelac
1c1b068ff8 readahead at least twice the strip size (same as raid0 driver does) 2008-01-08 16:47:10 +00:00
Milan Broz
a95892f77d Fix a segfault if using pvs with --all argument. (2.02.29) 2008-01-07 20:42:57 +00:00
Alasdair Kergon
ba0c495db7 lvconvert uses polldaemon now 2007-12-22 12:13:29 +00:00
Alasdair Kergon
b9c69aa63a a few more changes/fixes to recent code 2007-12-22 02:13:00 +00:00
Alasdair Kergon
1620864c35 more fixes 2007-12-20 23:12:27 +00:00
Alasdair Kergon
2b3dda7f72 various cleanups in recent patches 2007-12-20 22:37:42 +00:00
Alasdair Kergon
31e9db2690 stacked mirror support (incomplete) 2007-12-20 18:55:46 +00:00
Alasdair Kergon
ac089d9015 avoid some compiler warnings 2007-12-20 16:49:37 +00:00
Alasdair Kergon
a69ab65278 Major restructuring of pvmove and lvconvert layer manipulation code 2007-12-20 15:42:55 +00:00
Alasdair Kergon
1995c9ffb5 Build changes to replace fsadm C program with shell script. 2007-12-17 12:23:24 +00:00
Alasdair Kergon
dd007cfdd5 Append fields to report/pvsegs_cols_verbose.
Permit LV segment fields with PV segment reports.
  Add seg_start_pe and seg_pe_ranges to reports.
2007-12-14 21:53:02 +00:00
Alasdair Kergon
b680c5c677 export can_split parameter until rest of pvmove allocation restructuring gets done 2007-12-05 22:11:20 +00:00
Alasdair Kergon
9b6135dca4 round readahead to multiple of page size in tools 2007-12-05 19:24:32 +00:00
Patrick Caulfield
8a0a9a93d9 Tidy the clvmd backup code.
Move the backups inside the protection of the VG lock,
Don't backup if we have a suspended LV
Correct the vg_read() call
2007-12-05 13:17:18 +00:00
Patrick Caulfield
3303289137 When we unlock a VG tell the clvmds to see if a backup of the metadata needs
to be done.
2007-12-04 15:39:26 +00:00
Alasdair Kergon
fd0af4bd29 fix changed parms 2007-12-03 18:00:38 +00:00
Alasdair Kergon
69506f1dc4 uncomment libdevmapper readahead calls 2007-11-29 15:04:12 +00:00
Alasdair Kergon
940d710ece drop mirrored_pv/mirrored_pe from alloc handle 2007-11-22 14:54:35 +00:00
Alasdair Kergon
3da4613d7b Start refactoring pvmove allocation code. 2007-11-22 13:57:21 +00:00
Alasdair Kergon
3e50ea9eef Decode cluster locking state in log message. (untested)
Change file locking state messages from debug to very verbose.
2007-11-16 21:16:20 +00:00
Alasdair Kergon
a68d8ec833 move pvresize_single back under tools 2007-11-15 22:11:18 +00:00
Alasdair Kergon
57d921e953 more vg_read lock fixes 2007-11-15 21:30:52 +00:00
Alasdair Kergon
c6f8ef3814 define LCK_NONE for cases when vg_lock_and_read already holds lock
(temporary - library will use internal ref counting instead)
2007-11-15 02:55:22 +00:00
Alasdair Kergon
e5f7352bef Convert some vg_reads into vg_lock_and_reads 2007-11-15 02:20:03 +00:00
Alasdair Kergon
204a12e594 Accept sizes with --readahead argument.
Store size arguments as sectors internally.
2007-11-14 00:08:25 +00:00
Alasdair Kergon
a6b22cf317 readahead activation code (but no dm support yet) 2007-11-12 20:51:54 +00:00
Alasdair Kergon
b4068515e8 Enhance the management of readahead settings. 2007-11-09 16:51:54 +00:00
Alasdair Kergon
19c865437a Prevent lvconvert -s from using same LV as origin and snapshot. 2007-11-07 16:33:12 +00:00
Alasdair Kergon
00a7c302ea Add pv_mda_free and vg_mda_free fields to reports for raw text format. 2007-11-05 17:17:55 +00:00
Alasdair Kergon
40ec927b3f attempt to fix human-readable unit output when number of sectors is odd 2007-11-05 17:13:54 +00:00
Alasdair Kergon
180b4569e2 fix inverted orphan test 2007-11-05 17:12:50 +00:00
Alasdair Kergon
1f2ed21dde adjust sizes for metadata 2007-11-05 02:10:39 +00:00
Alasdair Kergon
fd4ff5d201 Show 'not usable' space when PV is too large for device in pvdisplay.
Ignore and fix up any excessive device size found in metadata.
2007-11-05 01:47:49 +00:00
Alasdair Kergon
2b0249ec42 Add LVM2 version to 'Generated by' comment in metadata. 2007-11-04 19:16:34 +00:00
Alasdair Kergon
b7940c98c1 fix new lvremove checks - mustn't fail when activation is disabled 2007-11-04 16:28:57 +00:00
Alasdair Kergon
612548c04d Fix error message when fixing up PV size in lvm2 metadata (2.02.11). 2007-11-04 15:43:50 +00:00
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
Alasdair Kergon
e1d586d70e explanation of md superblock location & avoid compilation warnings 2007-10-24 11:24:24 +00:00
Alasdair Kergon
47c06763b7 Detect md superblocks version 1.0, 1.1 and 1.2. 2007-10-24 00:51:05 +00:00
Alasdair Kergon
951e1064c9 refactor dev-md.c, separating out the magic number detection 2007-10-24 00:30:30 +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
Alasdair Kergon
6aca8e9297 Handle new sysfs subsystem/block/devices directory structure. 2007-10-10 11:31:21 +00:00
Jim Meyering
4df0c15074 Fix the fsadm build failure without using -llvm.
* lib/misc/util.c (last_path_component): Move definition to ...
* lib/misc/last-path-component.h (last_path_component): ...here.
New file.  Make the function "static inline".
* include/.symlinks: Add last-path-component.h.
* lib/misc/util.h (last_path_component): Remove declaration.
* tools/fsadm/fsadm.c: Include "last-path-component.h".
* tools/lvmcmdline.c: Likewise.

Author: Jim Meyering <meyering@redhat.com>
2007-10-03 16:10:04 +00:00
Dave Wysochanski
bf4f5b21a4 Some const fixups for previous checkins 2007-09-24 21:30:00 +00:00
Jim Meyering
7f8f8bfa09 Correct typo in comments: s/is part of the LVM2/is part of LVM2/.
Signed-off-by: Jim Meyering <jim@meyering.net>


Author: Jim Meyering <jim@meyering.net>
2007-09-21 10:16:45 +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
a0fe21ccb6 Undo previous checkin - output format not good, info already available in other form(s) 2007-09-11 13:49:52 +00:00
Dave Wysochanski
45ea446910 Add pvseg_free field to 'pvs' output 2007-09-10 20:05:29 +00:00
Jim Meyering
b45b846449 Include strerror string in dev_open_flags' stat failure message.
* lib/device/dev-io.c (dev_open_flags):
Use log_sys_error after failed stat to report strerror(errno).
Use a slightly different diagnostic to report mismatched device number.
2007-09-07 11:24:19 +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
Patrick Caulfield
5982271096 Locking P_global causes a cache refresh. 2007-08-23 15:43:20 +00:00
Alasdair Kergon
e935d21752 Introduce VG_GLOBAL lock type for vgscan/pvscan to trigger clvmd -R. 2007-08-23 15:02:26 +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
Alasdair Kergon
7a197a6220 Update to use autoconf 2.61, while still supporting 2.57. 2007-08-14 19:11:31 +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