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

7776 Commits

Author SHA1 Message Date
Petr Rockai
28160cb04a tests: set up global_filter instead of just filter
For testing setup global_filter.
2013-06-02 00:50:09 +02:00
Petr Rockai
e4cb88009a tests: skip the double log failure test on 2.6
On 2.6 kernels this deadlocks.
2013-06-02 00:50:09 +02:00
Petr Rockai
249ea4c34c tests: add hide_dev/unhide_dev to aux
Add helper func for easy filter adjustment.
2013-06-02 00:50:08 +02:00
Petr Rockai
1f73e992ef lvmetad: no use of persistent filter with lvmetad 2013-06-02 00:49:55 +02:00
Petr Rockai
e7878da921 filters: toplevel filter not persistent
Add a generic dump operation to filters and make the composite filter call
through to its components. Previously, when global filter was set, the code
would treat the toplevel composite filter's private area as if it belonged a
persistent filter, trying to write nonsense into a non-sensical file.
Also deal with NULL cmd->filter gracefully.
2013-06-02 00:48:58 +02:00
Petr Rockai
05bf4b8cc3 vgimportclone: override global_filter in lvm.conf
The global filter in system's lvm.conf may conflict with the custom filter we
set up in vgimportclone (they can easily fail to intersect). Since we explicitly
avoid talking to lvmetad in vgimportclone, it is safe and reasonable to do so.
2013-06-02 00:47:17 +02:00
Zdenek Kabelac
c5f7d401e5 tests: missed skip in test 2013-05-31 21:58:51 +02:00
Zdenek Kabelac
db2b65704c tests: test mirrors in clustered way
Make the clustered testing using cluster locking for most of the tests.
Use exclusive activation for mirrors and snapshot origins.
2013-05-31 21:42:32 +02:00
Zdenek Kabelac
e9e7421c8e tests: move raid test to separate file 2013-05-31 21:42:32 +02:00
Zdenek Kabelac
274eae592f tests: skip if the system already uses tested minor 2013-05-31 21:42:32 +02:00
Zdenek Kabelac
1c83c15963 tests: min snap chunk count is 3 2013-05-31 21:42:31 +02:00
Zdenek Kabelac
31f3274ed8 mirror: implement check for remotely active LV
If the mirror is active exclusively and locally, then we may proceed.
2013-05-31 21:42:31 +02:00
Zdenek Kabelac
e5baaf4ac9 lvcreate: update thin validation
Merge duplicate code that was validating lvcreate args
for creation of thin and snapshot.

Keep most of thin checks in _check_thin_parameters().

Update couple error messages.
2013-05-31 21:40:07 +02:00
Zdenek Kabelac
e01fbd9d8d lvcreate: update snapshot test
With last commit, there has been missing test for valid setting
of extents - there is no need to test max size when creating
thin snapshots.
2013-05-31 21:30:44 +02:00
Jonathan Brassow
562c678ee2 DM RAID: Add ability to throttle sync operations for RAID LVs.
This patch adds the ability to set the minimum and maximum I/O rate for
sync operations in RAID LVs.  The options are available for 'lvcreate' and
'lvchange' and are as follows:
  --minrecoveryrate <Rate> [bBsSkKmMgG]
  --maxrecoveryrate <Rate> [bBsSkKmMgG]
The rate is specified in size/sec/device.  If a suffix is not given,
kiB/sec/device is assumed.  Setting the rate to 0 removes the preference.
2013-05-31 11:25:52 -05:00
Jonathan Brassow
7061b74ec6 Clean-up: Fix copy-n-paste error
Description for --with-raid should be s/mirror/raid/.
2013-05-31 11:14:37 -05:00
Zdenek Kabelac
09cc5f65db tests: snapshot needs 3 chunks 2013-05-30 17:56:47 +02:00
Zdenek Kabelac
6f9366696c cleanup: fix tabs 2013-05-30 17:56:41 +02:00
Zdenek Kabelac
a766ea16b8 tests: snapshot testing 2013-05-30 17:35:23 +02:00
Zdenek Kabelac
cd9350198e tests: drop testing of raids in cluster
Since raid is not clustered yet - drop it from testing in cluster phase.
(saving running some time)
2013-05-30 17:35:23 +02:00
Zdenek Kabelac
e4dfa785d1 libdm: compensate suspend counter for live table
This patch may not be fully correct. It tries to solve
the imbalanced suspend counter.

The problem starts when some LV is created and fails in resume path.
(i.e. resuming to large PV (enforced) over small loop devices)

This fails in _resume_node() after dm_task_run(). And while
existing device with empty table is left in inactive table,
further calls are reporting this device is in suspend state.

When later the lvm2 tries to rollback created device and deactivate it,
it will end with internal error, when we try to decrement
never incremented suspend counter.

As an 'easy fix' for now update suspend counter only for live nodes.

TODO: explore better fix.
2013-05-30 17:35:23 +02:00
Zdenek Kabelac
b08c346489 lvresize: drop monitoring of 100% covered origin 2013-05-30 17:35:23 +02:00
Zdenek Kabelac
3ced1bf694 lvresize: check for max snapshot size
As for lvcreate, lvresize also doesn't need to grow bigger then needed.
2013-05-30 17:35:23 +02:00
Zdenek Kabelac
bd3ece0128 lvcreate: reduce too large cow
Detect maximum usable size of snapshot COW device,
and do not waste more space for such LV then needed.
2013-05-30 17:35:14 +02:00
Zdenek Kabelac
eb7e206a73 snapshot: add cow_max_extents
Add more precise calculation of the maximum usable snapshot size.
Using only percentage fails for small size of snapshot and extents.
2013-05-30 17:30:15 +02:00
Zdenek Kabelac
59962d8d3e snapshot: require 3 chunks for creation
There is no point in creation of 2chunks snapshot,
since the snapshot is invalidated immeditelly with the first write
as there is no free chunk for COW blocks
(2 chunks are used by the snap header and the 1st. metadata chunk).

Enhance error message about the lowest usable size.
2013-05-30 17:28:03 +02:00
Zdenek Kabelac
39705ed201 cleanup: test for -1 value for lseek error
Error is defined as -1.
Yet it seems we are unable to seek to 0 for devices > 8Exabytes.
2013-05-30 17:26:42 +02:00
Zdenek Kabelac
56779c32c5 snapshot: fix resize of 100% full cow
When the COW area is using all the available space (100%) it can be still
a valid snapshot which may need a resize. So support it.
2013-05-30 17:26:20 +02:00
Zdenek Kabelac
99f0483580 args: do not accept >=16EiB sizes
Instead of seeing wierd overflows inside the lvm code,
giving false error messages, kill the user experiment in the begining.

Who needs to use more then 16EiB with lvm2 and 64bit anyway...
2013-05-30 17:23:51 +02:00
Zdenek Kabelac
c5c452a137 libdm: add public macro DM_TO_STRING
Since this stringifying macro is usable in more places,
move it to the public header with DM_ prefix.
2013-05-30 16:53:59 +02:00
Zdenek Kabelac
2f1a571c97 fid: fix reset of PV fid
Avoid hitting memory corruption (double free) in code path,
where PV FID has been already destroyed and the released pointer
was left in PV structure and could have been tried to be released
from there 2nd. time with final context destruction.
2013-05-30 16:52:39 +02:00
Zdenek Kabelac
55f42944bd dmeventd: revert back percent to int
int is perfectly ok here.
2013-05-30 16:46:58 +02:00
Peter Rajnoha
5e7cdd60f0 man: ea_start/ea_size -> ba_start/ba_size 2013-05-30 11:45:44 +02:00
Peter Rajnoha
798ed9ea1c WHATS_NEW: return success on dmeventd -V 2013-05-29 13:24:16 +02:00
Peter Rajnoha
6ad17fd712 dmeventd: always return success on dmevetnd -V 2013-05-29 12:54:42 +02:00
Peter Rajnoha
be25f7ac83 WHATS_NEW: ea_start,ea_size -> ba_start,ba_size 2013-05-28 12:43:26 +02:00
Peter Rajnoha
732859d21f refactor: rename embedding area -> bootloader area 2013-05-28 12:37:22 +02:00
Zdenek Kabelac
9966842810 snapshot: skip monitor for large cows
If snapshot cow device is already big enough to
cover whole origin, do not monitor it.
2013-05-27 10:35:43 +02:00
Zdenek Kabelac
77952151af snapshot: add lv_is_cow_covering_origin
Add function to check is size of cow is already big enough
to cover whole origin.
2013-05-27 10:34:53 +02:00
Zdenek Kabelac
e992cb253c dmeventd: use dm_get_status_snapshot()
Switch to use libdm dm_get_status_snapshot() function for
reading status info.
This fixes bug, where the code was using 32bit integers,
while the snapshot target is able to return 64bit sizes.
However this also means, someone is using >1TB snapshot
cow devices, which is actually very bad idea anyway, since the
perfomance and memory usage in this case is very bad.
2013-05-27 10:33:06 +02:00
Zdenek Kabelac
06e8ff29ff snapshot: use dm_get_status_snapshot()
Replace code with libdm call to dm_get_status_snapshot().
2013-05-27 10:32:02 +02:00
Zdenek Kabelac
cb587fd100 libdm: free mem pool on err path
Since we use get_status also in dmeventd, which may use one pool
for a single device, in case it would be repeatedly returning error,
it may not be freeing the pool and would cause slow but steady growth.
To stay safe in the error path release any allocated memory.
2013-05-27 10:30:55 +02:00
Zdenek Kabelac
4707ac7200 libdm: add dm_get_status_snapshot
Add dm_get_status_snapshot() for parsing snapshot status.
2013-05-27 10:30:51 +02:00
Zdenek Kabelac
3ba3bc0d66 cleanup: drop backtrace
After log_error/log_warn there is no point to show <backtrace>
in debug log trace from the next code line.
2013-05-27 10:28:32 +02:00
Zdenek Kabelac
58a2e5e2df cleanup: use last_seg
Use function to obtain last segment type.
2013-05-27 10:28:32 +02:00
Zdenek Kabelac
8cbacd2474 lv_manip: use lv_is_active
Updated reverted commit.
The usage of lv_is_active() is needed here, so the
(!lv_is_active_exclusive_locally) gives the correct
report.
2013-05-20 16:47:33 +02:00
Zdenek Kabelac
2ada982e73 vgchange: check for mounted fs
Check for mounted fs also for vgchange command, not just lvchange.

NOTE: Code is using lv_info() just like lvs_in_vg_opened().
It should be probably converted into  lv_is_active_locally().
2013-05-20 16:47:33 +02:00
Zdenek Kabelac
810bc4f8c1 dmeventd: use dm_mountinfo_read
Reuse mountinfo reading code from libdm.
2013-05-20 16:47:33 +02:00
Zdenek Kabelac
7fab9a9dda libdm: improve detection of mounted fs
To detect mounted device, use also /proc/self/mountinfo
as so far the check was only able to detect ext4 mounted filesystem.

TODO:
Once proper testing for this feature is added, it may appear,
mountinfo check is enough and covers all cases and sysfs check
could be removed.
2013-05-20 16:47:31 +02:00
Zdenek Kabelac
1f30e5a052 libdm: introduce dm_mountinfo_read
Add function for parsing /proc/self/mountinfo entries.
This can be used to detected mounted device.
2013-05-20 16:28:30 +02:00