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

1124 Commits

Author SHA1 Message Date
Alasdair Kergon
ba14fff2af FMT_INSTANCE_PV is no longer used 2012-02-12 22:37:24 +00:00
Alasdair Kergon
f3f6c17250 use stack consistently if 0 is considered an error 2012-02-12 21:42:43 +00:00
Alasdair Kergon
2a434c479d missing error mesg 2012-02-12 21:37:03 +00:00
Alasdair Kergon
10670c641b remove unused bits after fid changes 2012-02-12 20:19:39 +00:00
Petr Rockai
6e41729eb8 Keep a global (per-format) orphan_vg and keep any and all orphan PVs linked to
it. Avoids the need for FMT_INSTANCE_PV and enables further simplifications. No
functional change, internal refactor only.
2012-02-10 02:53:03 +00:00
Petr Rockai
8e5f7cf3dc Move lvmcache data structures behind an API (making the structures private to
lvmcache.c). No functional change.
2012-02-10 01:28:27 +00:00
Peter Rajnoha
5fa417a9c0 Stop processing lvextend if trying to extend a mirror that is being recovered.
Missing correct return value in lv_extend fn.
2012-02-09 15:13:42 +00:00
Zdenek Kabelac
a7e2da0585 Thin add pool_below_threshold
Test both data and metadata percent usage.
2012-02-08 13:05:38 +00:00
Zdenek Kabelac
94f88a4f14 Fix test for lv_snapshot_percent
Do not check for PERCENT_MERGE_FAILED if the lv_snapshot_percent() failed.
(test for snap_percent would be testing uninitialized value).
2012-02-08 13:02:07 +00:00
Zdenek Kabelac
462835faa0 Switch to return void
List delete cannot fail, so there is no reason to test for error.
2012-02-08 12:52:58 +00:00
Zdenek Kabelac
d75c5f06f0 Replace snprintf with dm_snprintf
snprintf testing for negative is replaced with dm_snprintf where this
test really works.
Add missing test for result of dm_snprintf().
2012-02-08 11:40:02 +00:00
Alasdair Kergon
b167ca28b0 Adjust comments 2012-02-01 15:05:53 +00:00
Zdenek Kabelac
42b5c54092 Add synchornization point in mirror log init.
Put extra sync point when mirror log is deactivated and before
it's activated for the second time.
2012-02-01 13:50:36 +00:00
Alasdair Kergon
1368dc905a lost line 2012-02-01 02:11:43 +00:00
Alasdair Kergon
72abf1d880 Track unreserved space for all alloc policies and then permit NORMAL to place
log and data on same single PV.
2012-02-01 02:10:45 +00:00
Zdenek Kabelac
7012268499 Thin for_each_sub_lv
Adapt to scan thin dependency LVs
2012-01-26 21:39:32 +00:00
Zdenek Kabelac
42beb34826 Set missing header define 2012-01-25 22:37:48 +00:00
Zdenek Kabelac
9b1fe5a062 Thin clear stacked message for thin pool
Before removing thin pool LV always make sure, stacked message
for previous run are cleared - but allow to remove any
device that should have been created
(i.e. creation of snapshot failed - so the message for snapshot creation
may be replaced with delete message within unfinished transaction).

Also commit messages after lv remove - so free space is released in pool.
2012-01-25 11:27:42 +00:00
Zdenek Kabelac
89764fd494 Thin skip activation when there are no thin message
If the list with thin messages is empty, do not touch thin pool device.
2012-01-25 09:17:15 +00:00
Zdenek Kabelac
c771a70882 Thin correct activation order
When the message is passed only in resume path the order needs
to be corrected.
2012-01-25 09:15:44 +00:00
Zdenek Kabelac
3dadb176ce Thin use suspend/resume_lv_origin
Use origin_only support for thin volume when thin snapshot is created.
2012-01-25 09:14:25 +00:00
Zdenek Kabelac
2258242f6c Thin use origin_only for thin pools as well
Extend the usage of origin_only flag to allow resume of thin pool LV
(when it's active) to pass only the messages.

origin_only flag will skip detection of already resumed tree for thin_pool,
so we do not need to suspend the tree and we just send messages.
2012-01-25 09:13:10 +00:00
Zdenek Kabelac
1dede50c85 Thin check for lv_thin_pool_percent error status
Check has been missing.
2012-01-25 09:02:35 +00:00
Zdenek Kabelac
0926438aad Thin prevent removal of its data and metadata LVs
LVs cannot be removed while there are linked to thin pool.
(Gives better error message, than validation).
2012-01-25 08:57:25 +00:00
Zdenek Kabelac
d55aa53816 Thin fix transaction_id incrementation and code refactoring
Add pool_has_message and use it in attach_pool_message.
Also update header to make more obvious which segment type is
expected as parameter.
Rename  'read_only' to  'no_update' (no auto update transaction_id)
to better fit how it's used.
Fix problem when there was only one stacked message replaced with delete
message that caused unwanted transaction_id increase.
2012-01-25 08:55:19 +00:00
Zdenek Kabelac
c217690f4c Thin dependency scan support
Go through pool_lv and metadata_lv LVs when doing recursive scan.
2012-01-25 08:50:10 +00:00
Alasdair Kergon
3f61871f38 Caller is still entitled to reference an LV that's unlinked, so don't
tamper with struct contents.
2012-01-24 14:53:59 +00:00
Jonathan Earl Brassow
6cf3274732 Use suspend|resume_origin_only when up-converting RAID LVs, as mirrors do.
Failure to do so results in "Performing unsafe table load while X device(s) are
known to be suspended" errors.  While fixing the problem in this way works and
is consistent with the way the mirror segment type does it, it would be nice
to find a solution that uses the generic suspend/resume calls.

Also included in this check-in are additions to the test suite that perform
conversions on RAID LVs under a snapshot.  These tests are disabled for the
time being due to a kernel bug that is yet to be tracked down.
2012-01-24 14:33:38 +00:00
Milan Broz
095d95d0a8 Properly show LV removal message.
(Fix regression in commit 6e181ba96d)
2012-01-24 14:15:52 +00:00
Alasdair Kergon
46c67b5279 Use chunk_size consistently for thin_pool within LVM. 2012-01-24 00:55:03 +00:00
Alasdair Kergon
5c9eae9647 Reorder fns in libdm-deptree.
Tweak dm_config interface and remove FIXMEs.
2012-01-23 17:46:31 +00:00
Mike Snitzer
fc0f2d5031 Prompt if request is made to remove a snapshot whose "Merge failed". 2012-01-20 22:04:16 +00:00
Mike Snitzer
27e21a4adc Allow removal of an invalid snapshot that was to be merged on next activation.
Don't allow a user to merge an invalid snapshot.
2012-01-20 22:03:48 +00:00
Mike Snitzer
d658922f36 Use m and M lv_attr to indicate that a snapshot merge failed in lvs.
snapshot (m)erge failed, suspended snapshot (M)erge failed
2012-01-20 22:03:03 +00:00
Zdenek Kabelac
6515946e4d Thin cleanup
Reorder condition so the code is better readable (and shorter).
2012-01-20 10:56:30 +00:00
Zdenek Kabelac
f881095a69 Drop hack in segtype reporting
Since striped name function knows when to report 'linear' instead of
'stripe' type name - drop it from this place.

This fixes problem when reporting segtype e.g. for thin-pool which
is also using area_count=1 to store thin data device reference.

It also returns properly strduped memory instead of badly casted const char*.
2012-01-20 10:55:28 +00:00
Zdenek Kabelac
f82bddb76c Thin disable snapshot creation when pool is over the threshold.
Since snapshot needs to suspend origin - it might lead to pool userspace
deadlock (as the pool will wait for new space in case it would be overfilled,
but dmeventd would not be able to resize it, as the lvcreate operation would
have kept the VG lock.)
To minimize the risk of such scenario - we prevent to create new snapshot
in case we are over the threshold - but beware, there is still small timewindow,
so keep threshold at some reasonable level!
2012-01-19 15:39:41 +00:00
Zdenek Kabelac
e58b5dd8e8 Thin add new display field for lvs
New field Data% is able to display info about
thin_pool, thin, snapshot and has generic meaning here.

Simple Time/Host field are here to display host and time creation.
2012-01-19 15:34:32 +00:00
Zdenek Kabelac
53d7985fa1 Add support to keep info about creation time and host for each LV
Basic support to keep info when the LV was created.
Host and time is stored into LV mda section.

FIXME: Current version doesn't support configurable string via lvm.conf
and used fixed version strftime "%Y-%m-%d %T %z".
2012-01-19 15:31:45 +00:00
Zdenek Kabelac
d8106dfee2 Thin rename seg var pool_metadata_lv to metadata_lv
Better fits the code.
2012-01-19 15:23:50 +00:00
Alasdair Kergon
8f95d94b4f Show read-only activation in display tools. 2012-01-12 16:58:43 +00:00
Zdenek Kabelac
f582793f1b Thin rename internal thin pool segment
Use matching name as kernel target - useful when function like
_percent is using this for validation.
2011-12-21 12:54:19 +00:00
Alasdair Kergon
66e5b7f53c Reinstate support for format1 snapshots, but issue deprecated warning.
I anticipate removing support for snapshots with lvm1-formatted metadata in a
future release.
2011-12-20 00:02:18 +00:00
Alasdair Kergon
289ed221d0 update FIXMEs 2011-12-10 00:47:23 +00:00
Jonathan Earl Brassow
9711057499 Don't allow two images to be split and tracked from a RAID LV at one time
Also, don't allow a splitmirror operation on a RAID LV that is already tracking
a split, unless the operation is to stop the tracking and complete the split.
Example:
~> lvconvert --splitmirrors 1 --trackchanges vg/lv /dev/sdc1
# Now tracking changes - image can be merged back or split-off for good
~> lvconvert --splitmirrors 1 -n new_name vg/lv /dev/sdc1
# ^ Completes split ^

If a split is performed on a RAID that is tracking an already split image and
PVs are provided, we must ensure that
 1) the already split LV is represented in the PVs
 2) we are careful to split only the tracked image
2011-12-01 00:21:04 +00:00
Jonathan Earl Brassow
a927e401f1 Do not allow users to change the name of RAID sub-LVs or the name of the
RAID LV if it is tracking changes for a split image.
2011-12-01 00:09:34 +00:00
Jonathan Earl Brassow
2ba1e8fccc The LV_REBUILD flag is not internal - bad comments in metadata-exported.h updated 2011-11-30 02:20:13 +00:00
Jonathan Earl Brassow
0c506d9a40 Support the ability to replace specific devices in a RAID array.
RAID is not like traditional LVM mirroring.  LVM mirroring required failed
devices to be removed or the logical volume would simply hang.  RAID arrays can
keep on running with failed devices.  In fact, for RAID types other than RAID1,
removing a device would mean substituting an error target or converting to a
lower level RAID (e.g. RAID6 -> RAID5, or RAID4/5 to RAID0).  Therefore, rather
than removing a failed device unconditionally and potentially allocating a
replacement, RAID allows the user to "replace" a device with a new one.  This
approach is a 1-step solution vs the current 2-step solution.

example> lvconvert --replace <dev_to_remove> vg/lv [possible_replacement_PVs]

'--replace' can be specified more than once.

example> lvconvert --replace /dev/sdb1 --replace /dev/sdc1 vg/lv
2011-11-30 02:02:10 +00:00
Zdenek Kabelac
900f5f8187 Replace dynamic buffer allocations for PATH_MAX
Use static buffer instead of stack allocated buffer.
This reduces stack size usage of lvm tool and the
change is very simple.

Since the whole library is not thread safe - it should not
add any new problems - and if there will be some conversion
it's easy to convert this to use some preallocated buffer.
2011-11-18 19:31:09 +00:00
Zdenek Kabelac
8deeeb07ea Unlock memory for vg_write
For write we do not need to hold memory locked.
This relaxes many conditions and avoid problems when allocating
a lot of memory for writting metadata buffers.
(In case of huge MDA size this would lead to mismatch between
locked and unlocked memory region size).

Add also internal check we are not writing in critical section.
2011-11-18 19:28:00 +00:00