When we are given an existing LV name - it needs to be allowed
to pass in even restricted name as the LV could have existed
long before we introduced some new restriction on prefix/suffix.i
Fix the regression on name limits and drop restriction to be applied
on any existing LVs - only the new created LV names have to be
complient with current name restrictions.
FIXME: we are currently using restricted names incorrectly in few
other places - device_is_usable() skips restricted names,
and udev flags are also incorrectly set for restricted names
so these LVs are not getting links properly.
!(lp->segtype = get_segtype_from_string(vg->cmd, "thin-pool")))
return_NULL;
+ if (lp->pool_name && !apply_lvname_restrictions(lp->pool_name))
+ return_NULL;
+
if (!(lv = _lv_create_an_lv(vg, lp, lp->pool_name)))
return_NULL;
"cache-pool")))
return_NULL;
+ if (lp->pool_name && !apply_lvname_restrictions(lp->pool_name))
+ return_NULL;
+
if (!(lv = _lv_create_an_lv(vg, lp, lp->pool_name)))
return_NULL;
if (!validate_lvname_param(cmd, &lp->vg_name, &lp->lv_name))
return_0;
+ if (lp->lv_name && !apply_lvname_restrictions(lp->lv_name))
+ return_0;
+
lp->pool_name = arg_str_value(cmd, thinpool_ARG, NULL)
? : arg_str_value(cmd, cachepool_ARG, NULL);
if (!validate_lvname_param(cmd, &lp->vg_name, &lp->pool_name))
*lv_name = lvname;
}
- if (!apply_lvname_restrictions(*lv_name))
- return_0;
-
if (!validate_name(*lv_name)) {
log_error("Logical volume name \"%s\" is invalid.",
*lv_name);