mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
cleanup: cache updates messages
Passing non cached device is an internal error. Print messages at non-error level. Shorten sleep delay for cache flush.
This commit is contained in:
parent
e2ea3cd7ba
commit
9cb053339e
@ -185,8 +185,10 @@ int lv_cache_remove(struct logical_volume *cache_lv)
|
|||||||
struct logical_volume *corigin_lv;
|
struct logical_volume *corigin_lv;
|
||||||
struct logical_volume *cache_pool_lv;
|
struct logical_volume *cache_pool_lv;
|
||||||
|
|
||||||
if (!lv_is_cache(cache_lv))
|
if (!lv_is_cache(cache_lv)) {
|
||||||
return_0;
|
log_error(INTERNAL_ERROR "LV %s is not cached.", cache_lv->name);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Active volume is needed (writeback only?) */
|
/* Active volume is needed (writeback only?) */
|
||||||
if (!activate_lv(cache_lv->vg->cmd, cache_lv)) {
|
if (!activate_lv(cache_lv->vg->cmd, cache_lv)) {
|
||||||
@ -214,7 +216,7 @@ int lv_cache_remove(struct logical_volume *cache_lv)
|
|||||||
|
|
||||||
if (strcmp(policy_name, "cleaner")) {
|
if (strcmp(policy_name, "cleaner")) {
|
||||||
/* We must swap in the cleaner to flush the cache */
|
/* We must swap in the cleaner to flush the cache */
|
||||||
log_error("Flushing cache for %s", cache_lv->name);
|
log_print_unless_silent("Flushing cache for %s.", cache_lv->name);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Is there are clean way to free the memory for the name
|
* Is there are clean way to free the memory for the name
|
||||||
@ -240,10 +242,10 @@ int lv_cache_remove(struct logical_volume *cache_lv)
|
|||||||
if (!lv_cache_block_info(cache_lv, NULL,
|
if (!lv_cache_block_info(cache_lv, NULL,
|
||||||
&dirty_blocks, NULL, NULL))
|
&dirty_blocks, NULL, NULL))
|
||||||
return_0;
|
return_0;
|
||||||
log_error("%" PRIu64 " blocks must still be flushed.",
|
log_print_unless_silent("%" PRIu64 " blocks must still be flushed.",
|
||||||
dirty_blocks);
|
dirty_blocks);
|
||||||
if (dirty_blocks)
|
if (dirty_blocks)
|
||||||
sleep(5);
|
sleep(1);
|
||||||
} while (dirty_blocks);
|
} while (dirty_blocks);
|
||||||
|
|
||||||
cache_pool_lv = cache_seg->pool_lv;
|
cache_pool_lv = cache_seg->pool_lv;
|
||||||
|
Loading…
Reference in New Issue
Block a user