diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2021-03-10 22:02:38 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2021-03-11 00:18:01 +0100 |
commit | dac827470195f46393522b20ef5678136f72126b (patch) | |
tree | 9ca61533862c4c999110a52f6340ff30360a626c /tools/toollib.c | |
parent | 7a99dac9ad44f0097fb64c48f7fe14a10aea07b7 (diff) | |
download | lvm2-dac827470195f46393522b20ef5678136f72126b.tar.gz |
toollib: prioritize processing thin-pool first
When generating list of processed LV, add thin-pool to the head of the
list, while other LVs are added on tail.
This makes it easier when removing many thin volumes, to recognize easily
when its thin-pool is also supposed to be removed.
Diffstat (limited to 'tools/toollib.c')
-rw-r--r-- | tools/toollib.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/toollib.c b/tools/toollib.c index 3c81de26b..de51632a6 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -3082,7 +3082,11 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg, goto out; } final_lvl->lv = lvl->lv; - dm_list_add(&final_lvs, &final_lvl->list); + if (lv_is_thin_pool(lvl->lv)) { + /* Add to the front of the list */ + dm_list_add_h(&final_lvs, &final_lvl->list); + } else + dm_list_add(&final_lvs, &final_lvl->list); } log_set_report_object_name_and_id(NULL, NULL); |