Hi, Milan Broz writes: > Now depencecy tree calculation tries to add log device using > "_mlog" layer. It is wrong because log device do not use layering > (it has its own UUID without layer suffix). > It currently works because query is done only by name. > > Because I plan to change all kernel dm info queries to use UUID only, > it must be rewritten to use proper UUID. > In ideal world we can use log_lv directly. Unfortunately the lvconvert > code is currently broken, so code must search for log_lv according to name > (it doesn't provide log_lv when it should). I have double-checked and this is not true. See below. > (mornfall: please can we fix lvconvert to use proper LV struct > with log lv prepared? See _lv_update_log_type() confusion where > new log_lv get lost...) If I was a little more careful to check the patch, this could have been easy... You have moved the _mlog from _add_lv_to_dtree to _create_partial_dtree -- but this is not correct! The following patch works: (The problem with the proposed patch is that when a nested mirror is created -- which happens upon lvconvert -m+1, for example, the partial tree will only contain the toplevel (temporary) mirror and the two images -- one regular and one mirrored... the mirrored one will however not get any of its dependencies in the tree, hence *partial*... this breaks lvconvert since the suspend/resume cycle leaves the _mlog device, which is not included in the partial trees, in the wrong state.) --- lib/activate/dev_manager.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Index: lvm2/lib/activate/dev_manager.c =================================================================== --- lvm2.orig/lib/activate/dev_manager.c +++ lvm2/lib/activate/dev_manager.c @@ -840,7 +840,8 @@ static int _add_lv_to_dtree(struct dev_m if (!_add_dev_to_dtree(dm, dtree, lv, "cow")) return_0; - if (!_add_dev_to_dtree(dm, dtree, lv, "_mlog")) + if ((lv->status & MIRRORED) && first_seg(lv)->log_lv && + !_add_dev_to_dtree(dm, dtree, first_seg(lv)->log_lv, NULL)) return_0; return 1;