mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
thin: preserve chunksize with lvconvert
When repairing thin pool or swapping thin pool metadata, preserve chunk_size property and avoid to be automatically changed later in the code to better match thin pool metadata size.
This commit is contained in:
parent
d2d3f0d747
commit
4f1309080a
@ -1,5 +1,6 @@
|
||||
Version 2.02.116 -
|
||||
====================================
|
||||
Preserve chunk size with repair and metadata swap of a thin pool.
|
||||
Fix raid --splitmirror 1 functionality (2.02.112).
|
||||
Fix tree preload to handle splitting raid images.
|
||||
Do not support unpartitioned DASD devices.
|
||||
|
@ -24,7 +24,9 @@ aux have_thin 1 0 0 || skip
|
||||
aux prepare_vg 4
|
||||
|
||||
# Create LV
|
||||
lvcreate -T -L20 -V10 -n $lv1 $vg/pool "$dev1" "$dev2"
|
||||
# TODO: investigate problem with --zero n and my repairable damage trick
|
||||
#lvcreate -T -L20 -V10 -n $lv1 $vg/pool --discards ignore --zero n --chunksize 128 "$dev1" "$dev2"
|
||||
lvcreate -T -L20 -V10 -n $lv1 $vg/pool --chunksize 128 --discards ignore "$dev1" "$dev2"
|
||||
lvcreate -T -V10 -n $lv2 $vg/pool
|
||||
|
||||
mkfs.ext2 "$DM_DEV_DIR/$vg/$lv1"
|
||||
@ -71,6 +73,11 @@ lvchange -an $vg
|
||||
# Swap repaired metadata back
|
||||
lvconvert -y -f --poolmetadata $vg/fixed --thinpool $vg/pool
|
||||
|
||||
# Check pool still preserves its original settings
|
||||
check lv_field $vg/pool chunksize "128.00k"
|
||||
check lv_field $vg/pool discards "ignore"
|
||||
check lv_field $vg/pool zero "zero"
|
||||
|
||||
# Activate pool - this should now work
|
||||
vgchange -ay $vg
|
||||
|
||||
|
@ -2956,6 +2956,7 @@ static int _lvconvert_pool(struct cmd_context *cmd,
|
||||
return 0;
|
||||
}
|
||||
|
||||
lp->passed_args |= PASS_ARG_CHUNK_SIZE | PASS_ARG_DISCARDS | PASS_ARG_ZERO;
|
||||
seg = first_seg(pool_lv);
|
||||
|
||||
/* Normally do NOT change chunk size when swapping */
|
||||
|
Loading…
Reference in New Issue
Block a user