1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-25 01:34:38 +03:00
Commit Graph

5356 Commits

Author SHA1 Message Date
Zdenek Kabelac
23b5c9b9e5 Use backward compatible configuration for test
Currently the test are not properly working with new code.
Use settings for the previous behaviour.

FIXME: update tests to properly test new allocation policies.
2011-02-28 19:44:21 +00:00
Alasdair Kergon
179139735c mention vgreduce in pvremove man page 2011-02-28 19:40:04 +00:00
Alasdair Kergon
9938f0c674 Improve pvremove error message when PV belongs to a VG. 2011-02-28 19:35:09 +00:00
Peter Rajnoha
0de865f20b Add a hint for manual revert if there's an error in pv_write, vg_write, vg_commit for pvresize. 2011-02-28 17:08:09 +00:00
Peter Rajnoha
fc04cb0266 Use pv->vg_name directly instead of pv->vg->name in _text_pv_write.
This also prevents a possible segfault during an automatic repair
when the PV does not belong to a VG anymore and we call pv_write_orphan.
2011-02-28 17:05:48 +00:00
Peter Rajnoha
7f250ab142 Allow non-orphan PVs with two metadata areas to be resized.
We allow writing non-orphan PVs only for resize now. The "orphan PV" assert
in pv_write fn uses the "allow_non_orphan" parameter to control this assert.
However, we should find a more elaborate solution so we can remove this
restriction altogether (pv_write together with vg_write is not atomic, we
need to find a safe mechanism so there's an easy revert possible in case of
an error).
2011-02-28 13:19:02 +00:00
Alasdair Kergon
eb9b172ec0 Fix check for log-only allocation in new alloc normal loop. 2011-02-27 01:16:52 +00:00
Alasdair Kergon
a499caabfb Various changes to the allocation algorithms: Expect some fallout.
There is a lot to test.

Two new config settings added that are intended to make the code behave
closely to the way it did before - worth a try if you find problems.
2011-02-27 00:38:31 +00:00
Peter Rajnoha
c4dbd497b2 vgconvert is fixed now to work with the changes in metadata area handling - enable the tests.
Add a small fix that preserves pe_start for lvm1 PVs when being converted.

(this fix needs to be replaced with something more clever, but let's have this working now)
2011-02-25 14:12:14 +00:00
Peter Rajnoha
ed08b81e18 Allow only orphan PVs to be resized even with two metadata areas. 2011-02-25 14:08:54 +00:00
Peter Rajnoha
8a7a401cae Revert the patch for vgconvert to work with recent changes in metadata area handling.
This should work now with the help of the patch from previous commit.
2011-02-25 14:02:53 +00:00
Peter Rajnoha
cb38146acb Read PV metadata information from cache if pv_setup called with pv->fid == vg->fid.
If the PV is already part of the VG (so the pv->fid == vg->fid), it makes no
sense to attach the mdas information from PV to a VG. Instead, we read new
PV metadata information from cache and attach it to the VG fid.
2011-02-25 13:59:47 +00:00
Peter Rajnoha
1d96b805e1 Fix a bug in metadata location calculation, cleanup pv_add_metadata_area fn.
This bug (a missing line) caused the 2nd MDA area location to be calculated
incorrectly and it didn't fit the disk size properly.

(https://www.redhat.com/archives/lvm-devel/2011-February/msg00127.html)
2011-02-25 13:50:02 +00:00
Peter Rajnoha
65a3e6454b Remove a few size_t type warnings. 2011-02-22 10:01:11 +00:00
Mike Snitzer
96171b0c03 Add inactive table query support for kernel driver >= 4.11.6 (RHEL 5.7). 2011-02-21 16:26:23 +00:00
Peter Rajnoha
4dd4e14fd8 %ld -> PRIu64 2011-02-21 13:09:27 +00:00
Peter Rajnoha
01a0facd7e WHATS_NEW 2011-02-21 12:40:46 +00:00
Peter Rajnoha
7ef77b52a8 Temporarily disable 'convert a VG from lvm2 to lvm1 format' test until a known issue is resolved.
Otherwise we get an error:

  PV segment VG free_count mismatch: 32 != 33
  PV segment VG extent_count mismatch: 32 != 33
2011-02-21 12:37:33 +00:00
Peter Rajnoha
249d85882f Fix metadata balance code to work with recent changes in metadata handling
interface (with the changes in format_instance).
2011-02-21 12:33:16 +00:00
Peter Rajnoha
5261cc0402 Add old_uuid field to struct physical_volume so we can still reference a PV
with its old UUID when we're changig it (the cache as well as metadata area
index has the old uuid that we need to use to access the information!)
2011-02-21 12:31:28 +00:00
Peter Rajnoha
5cbb49ed94 Fix vgconvert code to work with changes in metadata area handling and changes
in format_instance. Add new 'vg_convert' function.
2011-02-21 12:29:21 +00:00
Peter Rajnoha
c7c59e41cd Change pvresize code to work with new metadata handling interface and allow
resizing a PV with two metadata areas.
2011-02-21 12:27:26 +00:00
Peter Rajnoha
771b5db044 Change pv_write code to work with the changes in metadata handling interface
and changes in format_instance.
2011-02-21 12:26:27 +00:00
Peter Rajnoha
d0ffde9114 Remove unused _mda_setup fn. This functionality is covered by new pv_add_metadata_area fn. 2011-02-21 12:25:16 +00:00
Peter Rajnoha
12353bda0a Change the code throughout to use new pv_initialise and modified pv_setup fn.
Change pv_create code to work with these changes together with using new
pv_add_metadata_area fn to add metadata areas for a PV being created.
2011-02-21 12:24:15 +00:00
Peter Rajnoha
e1b1f2f961 Separate new pv_initialise function out of the original pv_setup code.
pv_initiliase initialises a new PV
pv_setup sets up an existing PV with a VG
2011-02-21 12:20:18 +00:00
Peter Rajnoha
d58036bc42 Add new pv_remove_metadata_area interface function. 2011-02-21 12:17:54 +00:00
Peter Rajnoha
83f5538979 Add new pv_add_metadata_area interface function. 2011-02-21 12:17:26 +00:00
Peter Rajnoha
cdc08fcc63 Remove useless mdas parameter for pv_read (from now on, we store mdas in a
format instance)
2011-02-21 12:15:59 +00:00
Peter Rajnoha
ec441b4c5b Add format instance support for pv_read code. 2011-02-21 12:13:40 +00:00
Peter Rajnoha
f78aec2b52 Initialise a new PV-based format instance for a PV that is being created. 2011-02-21 12:12:32 +00:00
Peter Rajnoha
afc29a3d69 Add vg_set_fid function to change VG format instance.
This function also sets a reference to a new VG format instance for all PVs
that are part of the VG so the PV-VG interconnection is consistent after the
change.
2011-02-21 12:10:58 +00:00
Peter Rajnoha
251029609d Change the code throughout for recent changes in format_instance handling. 2011-02-21 12:07:03 +00:00
Peter Rajnoha
3a760ad8cd Change create_instance to create PV-based as well as VG-based format instances.
Add supporting functions to work with the format instance and metadata area
structures stored within the format instance. Add support for simple indexing
of metadata areas using PV id and mda order (for on-disk PV only for now, we
can extend the indexing even for other mdas if needed - we only need to define
a proper key for the index).
2011-02-21 12:05:49 +00:00
Peter Rajnoha
37c5724db2 Change and generalise struct format_instance for PV and VG use. 2011-02-21 12:01:22 +00:00
Alasdair Kergon
1ebe15e7ce Handle decimal digits with --units instead of ignoring them silently.
Fix remaining warnings and compile with -Wpointer-arith.
2011-02-18 23:09:55 +00:00
Zdenek Kabelac
aed211833d Fix gcc warnings for unused variables
Put dead assigment code into comment.
2011-02-18 16:17:56 +00:00
Zdenek Kabelac
e382b2b990 Add debug message for open_count failure
Report  open_count problem as debug.

Function using _node_has_closed_parents decides whether
it's error or could be ignored.
2011-02-18 16:13:56 +00:00
Zdenek Kabelac
2045501076 Use return_0 to get bactrace 2011-02-18 15:05:40 +00:00
Zdenek Kabelac
f43f5f7004 Add some backtraces for error paths in process_each_lv 2011-02-18 15:02:25 +00:00
Zdenek Kabelac
16aa248a35 Memory unlock allows 1 page difference
As the kernel seems to be doing weird things during
mlock -> munlock -  allow 1 page locking difference without
warning - and log just debug message for a 1 page difference.

Allocation happens outside critical section probably during
log_warn printing.

Should make tests passing for now.
2011-02-18 14:51:04 +00:00
Zdenek Kabelac
e50d9e2c57 Const fixing
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.
2011-02-18 14:47:28 +00:00
Zdenek Kabelac
dad7e11288 API change - support more const arg
As dm_report_field_string() doesn't modify content of data pointer,
it can be marked as const.

It's slight API change - but doesn't require any change on the user side
and supports wider range of arguments without const casting.
(i.e. we may use as paramater const lv struct this way:  &lv->name)
2011-02-18 14:38:47 +00:00
Zdenek Kabelac
f09295a4bd Void* arithmetic replaced with char* 2011-02-18 14:34:41 +00:00
Zdenek Kabelac
c0a8ab7699 Fix !DEVMAPPER_SUPPORT build
Fix build when devmapper is disabled.
2011-02-18 14:29:39 +00:00
Zdenek Kabelac
b11dd1f7b3 Remove fs_unlock after failed suspend
Explicit fs_unlock() after failed suspend is not need -
as it will happen automatically with nearest lv_info()
or vg_unlock().
2011-02-18 14:26:31 +00:00
Zdenek Kabelac
6bea349da8 Critical section
New strategy for memory locking to decrease the number of call to
to un/lock memory when processing critical lvm functions.

Introducing functions for critical section.

Inside the critical section - memory is always locked.
When leaving the critical section, the memory stays locked
until memlock_unlock() is called - this happens with
sync_local_dev_names() and sync_dev_names() function call.

memlock_reset() is needed to reset locking numbers after fork
(polldaemon).

The patch itself is mostly rename:

memlock_inc  -> critical_section_inc
memlock_dec  -> critical_section_dec
memlock      -> critical_section

Daemons (clmvd, dmevent) are using memlock_daemon_inc&dec
(mlockall()) thus they will never release or relock memory they've
already locked memory.

Macros sync_local_dev_names() and sync_dev_names() are functions.
It's better for debugging - and also we do not need to add memlock.h
to locking.h header (for memlock_unlock() prototyp).
2011-02-18 14:16:11 +00:00
Zdenek Kabelac
02c2036731 Replace PV_MIN_SIZE with function pv_min_size()
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
2011-02-18 14:11:22 +00:00
Zdenek Kabelac
42ebbfa703 Support 64bit ints in config 2011-02-18 14:08:22 +00:00
Jonathan Earl Brassow
8f1cc91a84 Fix for bug 677739: removing final exclusive cmirror snapshot,
results in clvmd deadlock

When a logical volume is activated exclusively in a cluster, the
local (non-cluster-aware) target is used.  However, when creating
a snapshot on the exclusive LV, the resulting suspend/resume fails
to load the appropriate device-mapper table - instead loading the
cluster-aware target.

This patch adds an 'exclusive' parameter to the pertinent resume
functions to allow for the right target type to be loaded.
2011-02-18 00:36:04 +00:00