mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
lvremove: drop flushing dm cache before remove
Since cached LV is going to be removed together with its cache, there is not much to gain if we try to flush cache first. User may use 'vgcfgrestore' to get back origin + cache. Assuming user is not using issue_discards. When data are discarded after remove there is nothing to restore! This change allows to futher reduce number of commits during lvremove/vgremove.
This commit is contained in:
parent
5141a510bd
commit
664d3b0f22
@ -6663,31 +6663,6 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
}
|
||||
}
|
||||
|
||||
if (lv_is_cache(lv) && !lv_is_pending_delete(lv)) {
|
||||
/* Handles both cachepool & cachevol based cached LVs.
|
||||
* It's placed before deactivation, so it can try to uncache
|
||||
* 'active' LV if possible
|
||||
*/
|
||||
struct logical_volume *cachevol_lv = first_seg(lv)->pool_lv;
|
||||
|
||||
if (!archive(vg))
|
||||
return_0;
|
||||
|
||||
if (!lv_cache_remove(lv))
|
||||
return_0;
|
||||
|
||||
if (!lv_remove_single(cmd, cachevol_lv, force,
|
||||
suppress_remove_message)) {
|
||||
if (force < DONT_PROMPT_OVERRIDE) {
|
||||
log_error("Failed to uncache %s.", display_lvname(lv));
|
||||
return 0;
|
||||
}
|
||||
/* Proceed with -ff */
|
||||
log_print_unless_silent("Ignoring uncache failure of %s.",
|
||||
display_lvname(lv));
|
||||
}
|
||||
}
|
||||
|
||||
/* Used cache pool, COW or historical LV cannot be activated */
|
||||
if (!lv_is_used_cache_pool(lv) &&
|
||||
!lv_is_cache_vol(lv) &&
|
||||
|
Loading…
Reference in New Issue
Block a user