1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

6127 Commits

Author SHA1 Message Date
Zdenek Kabelac
f0df05e1dd Cleanup unsuccessfully created thin LV
If something fails during creation of thin LV remove such LV
and deactivate in case it's been already tried to activate
(i.e. thin kernel driver fails for some reason.)
2011-10-30 22:02:18 +00:00
Zdenek Kabelac
96279ac1c0 Make detach_pool_message visible for tools
Move there also vg_write and vg_commit.
2011-10-30 22:01:39 +00:00
Zdenek Kabelac
f8d46bd256 Thin cleanups
Fix/cleanup several error messages.
Remove test for seg_is_thin which could never be true there.
Replace (1<<24) with predefined constant.
2011-10-30 22:00:57 +00:00
Zdenek Kabelac
ade2b9345f Cleanup for lvmetad passing uninit structure
Shown by clang analyzer.
2011-10-30 21:58:59 +00:00
Zdenek Kabelac
8009588314 Improve valgrind support when compiled with DEBUG_MEM 2011-10-28 20:37:31 +00:00
Zdenek Kabelac
070f717131 Continue with lvcreate man page update
Already in WHATS_NEW.
2011-10-28 20:36:05 +00:00
Zdenek Kabelac
5cc2f9a257 Avoid creation of /dev/vg/thinpool 2011-10-28 20:34:45 +00:00
Zdenek Kabelac
620ff9e967 Thin option documentation 2011-10-28 20:33:50 +00:00
Zdenek Kabelac
0968dfcd03 Thin support for stripe
Support stripe options to create thin data pool LV.

TODO: combine chunk size and stripe size.
2011-10-28 20:32:54 +00:00
Zdenek Kabelac
daa10ad0fd Thin pool resize support for data LV
Support for extension of pool data LV.

TODO: figure out thin volume for suspend/resume in cluster.
2011-10-28 20:31:01 +00:00
Zdenek Kabelac
e5b12b305f Thin support for lvrename
Rename pool's metadata lv _tmeta together with pool and _tdata.
2011-10-28 20:29:32 +00:00
Zdenek Kabelac
ed32476c67 Thin works only with exclusive activation
Enforce exclusive activation with thin targets.
2011-10-28 20:29:06 +00:00
Zdenek Kabelac
a1d5aaf725 Thin pool activation change
To ensure we properly handle LV cluster locking - explicitely do
not allow to change the availability of the thin pool that is in use
for some thin LV.

As soon as the thin volume is created the only way to activate pool
is via implicit dependency.

Ignore thinpool open count for lv/vgchange operations.
2011-10-28 20:28:00 +00:00
Zdenek Kabelac
2721175d55 Thin output data_block_size via outsize
Use outsize to get nice size hint.
2011-10-28 20:25:08 +00:00
Zdenek Kabelac
2b71bcd0cb Improve lv_extend stack reporting
and some code cleanup with setting return value.
2011-10-28 20:23:24 +00:00
Zdenek Kabelac
c590a9cdbc Thin error messages clenaup and some indent 2011-10-28 20:19:26 +00:00
Zdenek Kabelac
dd3bb2bac3 Remove thin code from mirror/raid lv_extend 2011-10-28 20:18:32 +00:00
Zdenek Kabelac
2fa836e843 Extend virtual segment instead of adding new one
Before adding a new virtual segment to LV, check first whether
the last segment isn't already of the same type. In this case
extend last segment instead of creating the new one.

Thin volumes should have always only 1 virtual segment, but it
helps also to virtual snapshot or error segtype..
2011-10-28 20:17:55 +00:00
Zdenek Kabelac
bd4b840879 Add last_seg
Implement a function to return the last segment in a LV.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
2011-10-28 20:12:54 +00:00
Zdenek Kabelac
4ce43894d2 Trying to fix the retry logic
There should be no need for retry for our internal devices - it would be hinding
our own bug in the tree processing.
Update error messages to show also also device name.
No WHATS_NEW - in release fix.
2011-10-28 20:11:21 +00:00
Zdenek Kabelac
5a6ae6f5aa Fix core on buggy config file
Since fixed within unreleased version so no WHATS_NEW
2011-10-28 20:07:38 +00:00
Zdenek Kabelac
7ad1c43b48 Add find_config_tree_str_allow_empty
Add function to allow read of empty strings as valid arguments.
Add a warning message if string argument has ignored value.
2011-10-28 20:06:49 +00:00
Zdenek Kabelac
35d462dafc Update header comment 2011-10-28 20:04:17 +00:00
Jonathan Earl Brassow
e4eaed8136 Update lvconvert man page to describe '--type <segtype>' argument
Man page changes were not included when the ability to convert from
"mirror" -> "raid1" or "linear" -> "raid1" were made.
2011-10-25 13:24:23 +00:00
Jonathan Earl Brassow
682309e0b8 Disallow 'mirrored' log for cluster mirrors.
Git commit ID 0864378250 was meant to disallow
'mirrored' logs for cluster mirrors.  However, when add_mirror_log is used
to create the log (as is now the case when using 'lvcreate' or converting only
the log) the check is bypassed.

This patch adds the check to add_mirror_log.
2011-10-25 13:17:04 +00:00
Zdenek Kabelac
eafbdf3029 Don't print char type[8] as a plain string
pvck prints 'extra' character from the label since there is no '\0'
after the struct label entry and just uint64_t follows directly.
So avoid it by limiting 8 chars to be printed.

https://www.redhat.com/archives/lvm-devel/2011-January/msg00109.html

Signed-off-by: Paul Bolle <pebolle tiscali nl>
2011-10-24 10:24:39 +00:00
Zdenek Kabelac
faf7c493f8 Test with -F flag
grep need -F to check what we really want to test.
Add better test for existing device.

Currently this test DOES NOT work with real /dev handle via udev
since our tool does not see such device listet through udev.

FIXME: We might be able to see it at least through dmsetup table and
use for lvm.
2011-10-23 21:24:27 +00:00
Zdenek Kabelac
f2c56bc3b6 Drop mempool parameter from read functions
Use implicit vgmem pool.
2011-10-23 16:05:45 +00:00
Zdenek Kabelac
72ff89d279 Always use vg memory pool for allocated lv segment
Remove mem pool parameter from alloc_lv_segment()
Since we should always allocate LV segment from the vg mempool.
2011-10-23 16:02:01 +00:00
Zdenek Kabelac
c13f82579c Used device name instead of device path
Udev is tricky here - since with udev the node does not exists until
it resume happens.  So we need to resume devices via its name.
2011-10-23 15:43:10 +00:00
Zdenek Kabelac
cb8c101885 Do not make link in the real /dev
Skip trying to make link when real /dev dir is used for test.
2011-10-23 15:40:15 +00:00
Zdenek Kabelac
c6676c2e57 Expect failure with real /dev dir
As udev is for now incapable to create such devices
turn this test error into warning.
2011-10-23 15:39:08 +00:00
Zdenek Kabelac
fd6a1bfb74 Fix usage of DEBUG_ENFORCE_POOL_LOCKING with DEBUG_MEM
Since DEBUG_MEM is storing own extra structure within returned memory chunk,
glibc free must be used directly for posix_memaling() allocated block.
2011-10-23 15:38:02 +00:00
Petr Rockai
d0d516eb5e In t-lvcreate-large, do not create a clustered VG. LV activation/suspend does
not work yet with singlenode clvmd in clustered VGs.
2011-10-23 14:30:51 +00:00
Zdenek Kabelac
9e453cab1c Reduce stack size usage in print_log
As the buf2[] and locn[] can't be used at the same time, safe 1 page from
stack memory.
2011-10-22 16:52:00 +00:00
Zdenek Kabelac
aef13649ea Remove old thin code from _lv_insert_empty_sublvs
Since thin is not able to use _lv_insert_empty_sublvs,
remove its appearence from this function.

Start to use extend_pool() function for desired functionality
and modify lv_extend() for this.
2011-10-22 16:48:59 +00:00
Zdenek Kabelac
c35bcc8bdf Ensure thin LVs take an exclusive activation 2011-10-22 16:47:23 +00:00
Zdenek Kabelac
dc225f58a9 Remove extra empty check
dm_list_splice handles empty list itself, no need to duplicate code.
2011-10-22 16:46:34 +00:00
Zdenek Kabelac
5d8f78a6c0 Consistently use metadata LV as the first in MDA
Cosmetic cleanup.
Mark LV as thin pool before calling attach_pool functions.
2011-10-22 16:45:25 +00:00
Zdenek Kabelac
f4c77bd0e3 Recoded way to insert thin pool into vg
Code in _lv_insert_empty_sublvs  was not able to provide proper
initialization order for thin pool LV.

New function extend_pool() first adds metadata segment to pool LV which
is still visible. Such LV is activate and cleared.

Then new meta LV is created and metadata segments are moved there.
Now the preallocated pool data segment is attached to the pool LV
and layer _tpool is created. Finaly segment is marked as thin_pool.
2011-10-22 16:44:23 +00:00
Zdenek Kabelac
06b8248d63 Make move_lv_segment non-static
This function could be useful for other _manip source files.

Use dm_list manipulation function for provided functionality,
which make the code more readable and avoid touching list
internal details here.
2011-10-22 16:42:10 +00:00
Alasdair Kergon
dbd60cf576 Pass exclusive LV locks to all nodes in the cluster.
This was the intended behaviour, as described in the lvchange man page, so you
have complete control through volume_list in lvm.conf, but the code seems to
have been treating -ae as local-only for a very long time.
2011-10-21 15:49:45 +00:00
Zdenek Kabelac
f0c9160df4 Store transaction_id with created thin lv
So we know the creation history and this should be useful with vgcfgrestore.
2011-10-21 11:38:35 +00:00
Zdenek Kabelac
4d925f5785 Remove double-hack for setting metadata size
Drop the second lv_extend and set 128MB directly in the first hack place.
2011-10-21 09:55:50 +00:00
Zdenek Kabelac
3bc417488d Thin pool now support chunk size as well
Use chunksize option to specify data_block_size for thin pool target.
Drop low_water_mark to zero.
2011-10-21 09:55:07 +00:00
Zdenek Kabelac
4d83891a67 Make units for chunksize more obvious 2011-10-21 09:53:16 +00:00
Zdenek Kabelac
e597d5a487 Aling structure chunk on default aling size
Since we use 8 bytes by default for the pool allocation,
keep the structure aligned with this size.
(Somehow it was not applied in previous commit.)
2011-10-20 14:43:33 +00:00
Zdenek Kabelac
3bdcf7c5e6 Mark chunk memory for free as defined again for valgrind
When DEBUG_MEM is used, the memory is trashed with extra pattern before real
free() is called, and as this memory was marked as non accessible when used with
valgrind, make it again usable.
2011-10-20 13:39:57 +00:00
Zdenek Kabelac
df0200e510 Aling structure chunk on default aling size
Since we use 8 bytes by default for the pool allocation,
keep the structure aligned with this size.
2011-10-20 13:36:13 +00:00
Zdenek Kabelac
e3359201cf Simplify some pointer operations 2011-10-20 13:33:41 +00:00