Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c57798463078325a…
Commit: c57798463078325a7b7b1221d154312a20678e93
Parent: bc5376b151f4a5993c223de51f0218aa95184471
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 31 12:00:20 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 31 12:21:40 2016 +0200
tests: fixed cache target reacts faster
After kernel fixed in 4.6 cache target reacts promptly
and switches to Fail-ed state when disk error is detected.
Handle both cases in test...
---
test/shell/lvconvert-repair-cache.sh | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/test/shell/lvconvert-repair-cache.sh b/test/shell/lvconvert-repair-cache.sh
index 60b0b5d..1fdfd3f 100644
--- a/test/shell/lvconvert-repair-cache.sh
+++ b/test/shell/lvconvert-repair-cache.sh
@@ -101,13 +101,15 @@ sync
# Seriously damage cache metadata
aux error_dev "$dev1" 2054:2
-# Here we usually for the 1st. notice needs_check
-check lv_attr_bit state $vg/$lv1 "c"
-
-sleep .1
-
-# And now cache is finaly Failed
-check lv_attr_bit health $vg/$lv1 "F"
+# On fixed kernel we get instant Fail here
+get lv_field $vg/$lv1 lv_attr | tee out
+grep "Cwi-a-C-F-" out || {
+ # while on older unfixed we just notice needs_check
+ grep "Cwi-c-C---" out
+ sleep .1
+ # And now cache is finaly Failed
+ check lv_attr_bit health $vg/$lv1 "F"
+}
check lv_field $vg/$lv1 lv_health_status "failed"
aux disable_dev "$dev1"
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bc5376b151f4a599…
Commit: bc5376b151f4a5993c223de51f0218aa95184471
Parent: 5034bb8d180a496fc24cd0ac0d8dde2332d28bc2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Mar 31 11:59:55 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 31 12:21:40 2016 +0200
tests: do not test settings when MQ is emulated by SMQ
---
test/shell/lvchange-cache.sh | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvchange-cache.sh b/test/shell/lvchange-cache.sh
index ca7522a..06d2f09 100644
--- a/test/shell/lvchange-cache.sh
+++ b/test/shell/lvchange-cache.sh
@@ -48,7 +48,8 @@ get lv_field $vg/corigin kernel_cache_settings | grep 'migration_threshold=333'
lvchange --cachesettings 'migration_threshold = 233 sequential_threshold = 13' $vg/corigin
get lv_field $vg/corigin kernel_cache_settings | tee out
grep 'migration_threshold=233' out
-grep 'sequential_threshold=13' out
+
+if grep 'sequential_threshold=13' out ; then
lvchange --cachesettings 'migration_threshold = 17' $vg/corigin
get lv_field $vg/corigin kernel_cache_settings | tee out
@@ -79,4 +80,10 @@ grep 'migration_threshold=2048' out
grep 'sequential_threshold=13' out
grep 'random_threshold=4' out
+else
+# When MQ is emulated by SMQ policy it does not hold settings.
+# So just skip testing of param changes when sequential_threshold=0
+grep 'sequential_threshold=0' out
+fi
+
vgremove -f $vg
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5034bb8d180a496f…
Commit: 5034bb8d180a496fc24cd0ac0d8dde2332d28bc2
Parent: b10253ab4d932565dc69e5b3b6715177bb593ba8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 30 10:16:09 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 31 12:21:40 2016 +0200
cleanup: use local var to read struct
---
lib/activate/dev_manager.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index de07f96..5341b54 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -1332,10 +1332,10 @@ int dev_manager_cache_status(struct dev_manager *dm,
* ->target_percent() API is able to transfer only a single value.
* Needs to be able to pass whole structure.
*/
- if (!dm_get_status_cache(dm->mem, params, &((*status)->cache)))
+ if (!dm_get_status_cache(dm->mem, params, &c))
goto_out;
- c = (*status)->cache;
+ (*status)->cache = c;
(*status)->mem = dm->mem; /* User has to destroy this mem pool later */
if (c->fail || c->error) {
(*status)->data_usage =
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8bbec41bd482175e…
Commit: 8bbec41bd482175ee61478bef65cc58c7e814abf
Parent: fe7ae37f5e4af4f73aee5439dbef93d4facfaadf
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 30 10:16:41 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Mar 31 12:15:47 2016 +0200
thin: no thin-pool flush when reading metadata status
Previous fix missed the fact the we do query for 'percent' with
seg value either set or unset (API overload...)
When 'seg' was unset, we still issue flush with status.
Fix it by cheking segtype by target_type.
As we check for segtype - we could also skip whole percentage
if the 'segtype' is unknown by code directly.
Reported-by: Ming-Hung Tsai <mingnus gmail com
---
WHATS_NEW | 1 +
lib/activate/dev_manager.c | 11 +++++------
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index dae6a10..3237e0a 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.149 -
==================================
+ Do not flush thin-pool when checking metadata fullness.
Remove spurious error about no value in /sys/dev/block/major:minor/dm/uuid.
Fix device mismatch detection for LV if persistent .cache file is used.
Fix holder device not being found in /dev while sysfs has it during dev scan.
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 5761ede..2696c56 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -884,20 +884,22 @@ static int _percent_run(struct dev_manager *dm, const char *name,
char *params = NULL;
const struct dm_list *segh = lv ? &lv->segments : NULL;
struct lv_segment *seg = NULL;
- struct segment_type *segtype;
int first_time = 1;
dm_percent_t percent = DM_PERCENT_INVALID;
-
uint64_t total_numerator = 0, total_denominator = 0;
+ struct segment_type *segtype;
*overall_percent = percent;
+ if (!(segtype = get_segtype_from_string(dm->cmd, target_type)))
+ return_0;
+
if (!(dmt = _setup_task(name, dlid, event_nr,
wait ? DM_DEVICE_WAITEVENT : DM_DEVICE_STATUS, 0, 0, 0)))
return_0;
/* No freeze on overfilled thin-pool, read existing slightly outdated data */
- if (lv && lv_is_thin_pool(lv) &&
+ if (segtype_is_thin(segtype) &&
!dm_task_no_flush(dmt))
log_warn("Can't set no_flush flag."); /* Non fatal */
@@ -926,9 +928,6 @@ static int _percent_run(struct dev_manager *dm, const char *name,
if (!type || !params)
continue;
- if (!(segtype = get_segtype_from_string(dm->cmd, target_type)))
- continue;
-
if (strcmp(type, target_type)) {
/* If kernel's type isn't an exact match is it compatible? */
if (!segtype->ops->target_status_compatible ||