1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/lvm2/lv-def-name.patch
3 # Copyright (C) 2023 The T2 SDE Project
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
8 # This patch file is dual-licensed. It is available under the license the
9 # patched project is licensed under, as long as it is an OpenSource license
10 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
11 # of the GNU General Public License version 2 as used by the T2 SDE.
12 # --- T2-COPYRIGHT-NOTE-END ---
14 Use more common and shorter lv%d names instead of the clunky lvol%d.
16 --- LVM2.2.03.15/lib/metadata/lv_manip.c.vanilla 2023-01-19 16:04:35.750961688 +0100
17 +++ LVM2.2.03.15/lib/metadata/lv_manip.c 2023-01-19 16:05:04.232962649 +0100
20 char uniq_name[NAME_LEN];
22 - /* If the name is in use, generate new lvol%d */
23 + /* If the name is in use, generate new lv%d */
24 if (lv_name_is_used_in_vg(lv->vg, new_name, NULL)) {
25 - if (!generate_lv_name(lv->vg, "lvol%d", uniq_name, sizeof(uniq_name))) {
26 + if (!generate_lv_name(lv->vg, "lv%d", uniq_name, sizeof(uniq_name))) {
27 log_error("Failed to generate unique name for unused logical volume.");
34 - if (!(lv = lv_create_empty(new_lv_name ? : "lvol%d", NULL,
35 + if (!(lv = lv_create_empty(new_lv_name ? : "lv%d", NULL,
36 status, lp->alloc, vg)))
39 --- LVM2.2.03.15/lib/metadata/pool_manip.c.vanilla 2023-01-19 16:04:35.734961688 +0100
40 +++ LVM2.2.03.15/lib/metadata/pool_manip.c 2023-01-19 16:04:55.735962362 +0100
45 - /* If the name is in use, generate new lvol%d */
46 + /* If the name is in use, generate new lv%d */
47 if (lv_name_is_used_in_vg(vg, new_name, NULL) &&
48 - !generate_lv_name(vg, "lvol%d", new_name, sizeof(new_name))) {
49 + !generate_lv_name(vg, "lv%d", new_name, sizeof(new_name))) {
50 log_error("Failed to generate unique name for "
51 "pool metadata spare logical volume.");
53 --- LVM2.2.03.15/lib/metadata/writecache_manip.c.vanilla 2023-01-19 16:04:35.720961687 +0100
54 +++ LVM2.2.03.15/lib/metadata/writecache_manip.c 2023-01-19 16:04:51.227962210 +0100
57 * Rename lv_fast back to its original name, without the _cvol
58 * suffix that was added when lv_fast was attached for caching.
59 - * If the name is in use, generate new lvol%d.
60 + * If the name is in use, generate new lv%d.
61 * Failing to rename is not really a problem, so we intentionally
62 * do not consider some things here as errors.
67 if (lv_name_is_used_in_vg(vg, cvol_name, NULL) &&
68 - !generate_lv_name(vg, "lvol%d", cvol_name, sizeof(cvol_name))) {
69 + !generate_lv_name(vg, "lv%d", cvol_name, sizeof(cvol_name))) {
70 log_warn("Failed to generate new unique name for unused LV %s", lv_fast->name);