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

5350 Commits

Author SHA1 Message Date
Alasdair Kergon
1a52fa6858 Fix check for log-only allocation in new alloc normal loop. 2011-02-27 01:16:52 +00:00
Alasdair Kergon
92ffcda183 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
4b8f066c19 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
4a304dc1d8 Allow only orphan PVs to be resized even with two metadata areas. 2011-02-25 14:08:54 +00:00
Peter Rajnoha
f74bd57ec9 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
38b0564cab 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
ea4a41e961 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
93cca5c1c8 Remove a few size_t type warnings. 2011-02-22 10:01:11 +00:00
Mike Snitzer
7d9c99e8e7 Add inactive table query support for kernel driver >= 4.11.6 (RHEL 5.7). 2011-02-21 16:26:23 +00:00
Peter Rajnoha
c901a92aa5 %ld -> PRIu64 2011-02-21 13:09:27 +00:00
Peter Rajnoha
e924615f32 WHATS_NEW 2011-02-21 12:40:46 +00:00
Peter Rajnoha
812f4ca12a 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
9c0035c129 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
51aed1992f 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
6bdc80743e 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
cb2396730a 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
17ad2b1115 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
903d7db050 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
94d91fdda1 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
617b900d85 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
981895a860 Add new pv_remove_metadata_area interface function. 2011-02-21 12:17:54 +00:00
Peter Rajnoha
8d5d20a526 Add new pv_add_metadata_area interface function. 2011-02-21 12:17:26 +00:00
Peter Rajnoha
305816232d 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
6e0b348d34 Add format instance support for pv_read code. 2011-02-21 12:13:40 +00:00
Peter Rajnoha
56280d0d3a Initialise a new PV-based format instance for a PV that is being created. 2011-02-21 12:12:32 +00:00
Peter Rajnoha
f8b78ec613 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
c0c21864c6 Change the code throughout for recent changes in format_instance handling. 2011-02-21 12:07:03 +00:00
Peter Rajnoha
88129db5e1 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
716c4ebe52 Change and generalise struct format_instance for PV and VG use. 2011-02-21 12:01:22 +00:00
Alasdair Kergon
a8d13f9499 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
faf2288895 Fix gcc warnings for unused variables
Put dead assigment code into comment.
2011-02-18 16:17:56 +00:00
Zdenek Kabelac
eb4188830e 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
45afc15547 Use return_0 to get bactrace 2011-02-18 15:05:40 +00:00
Zdenek Kabelac
0a62e0145a Add some backtraces for error paths in process_each_lv 2011-02-18 15:02:25 +00:00
Zdenek Kabelac
476ef1886f 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
aec2115410 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
2f321615f2 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
4ebc6404ee Void* arithmetic replaced with char* 2011-02-18 14:34:41 +00:00
Zdenek Kabelac
ab8b85fb80 Fix !DEVMAPPER_SUPPORT build
Fix build when devmapper is disabled.
2011-02-18 14:29:39 +00:00
Zdenek Kabelac
44376ffe22 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
b1bcff7424 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
794e94fe16 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
9dd091e4f4 Support 64bit ints in config 2011-02-18 14:08:22 +00:00
Jonathan Earl Brassow
c054e7cc56 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
Petr Rockai
21849a8587 Fix an lv_postorder bug where it failed to clear temporary flags, making it
impossible to use twice with the same LV(s). Discovered by Milan.
2011-02-14 19:27:05 +00:00
Petr Rockai
228fbb6f84 Avoid flooding syslog with redundant messages when a snapshot is invalidated
(reported by Corey).
2011-02-14 14:26:36 +00:00
Jonathan Earl Brassow
84d2039b7f bug 659264: more examples for pvmove 2011-02-09 22:24:55 +00:00
Petr Rockai
d79ce8aa05 Allow overriding the DM_DEV_DIR used by the test suite (fixes BZ 672796). Use
like this:

# LVM_TEST_DEVDIR=/tmp/dev make check
2011-02-09 17:57:14 +00:00
Petr Rockai
94a0d58cd1 Fix a typo in pvmove.8 (fixes BZ 673618, spotted by John Bradshaw). 2011-02-09 17:42:15 +00:00
Alasdair Kergon
7ad6a7d911 post-release 2011-02-09 12:11:21 +00:00