mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
lvremove: remove attached cachevol with removed LV
When an LV is removed that has an attached cachevol, also remove the cachevol LV.
This commit is contained in:
parent
3b36de573e
commit
56aadd7fe2
@ -6283,10 +6283,16 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
return_0;
|
||||
|
||||
if (lv_is_cache(lv) && lv_is_cache_vol(first_seg(lv)->pool_lv)) {
|
||||
struct logical_volume *cachevol_lv = first_seg(lv)->pool_lv;
|
||||
|
||||
if (!lv_detach_cache_vol(lv, 0)) {
|
||||
log_error("Failed to detach cache from %s", display_lvname(lv));
|
||||
return 0;
|
||||
}
|
||||
if (!lv_remove_single(cmd, cachevol_lv, force, suppress_remove_message)) {
|
||||
log_error("Failed to remove cachevol %s.", display_lvname(cachevol_lv));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME Ensure not referred to by another existing LVs */
|
||||
|
Loading…
Reference in New Issue
Block a user