1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

pool: avoid using artificial name internally

This commit is contained in:
Zdenek Kabelac 2023-06-29 13:53:43 +02:00
parent 3596558861
commit e84b00964f
3 changed files with 3 additions and 7 deletions

View File

@ -916,7 +916,7 @@ struct lv_status_thin {
const char *get_pool_discards_name(thin_discards_t discards);
int set_pool_discards(thin_discards_t *discards, const char *str);
struct logical_volume *alloc_pool_metadata(struct logical_volume *pool_lv,
const char *name, uint32_t read_ahead,
uint32_t read_ahead,
uint32_t stripes, uint32_t stripe_size,
uint32_t extents, alloc_policy_t alloc,
struct dm_list *pvh);

View File

@ -607,7 +607,7 @@ bad:
}
struct logical_volume *alloc_pool_metadata(struct logical_volume *pool_lv,
const char *name, uint32_t read_ahead,
uint32_t read_ahead,
uint32_t stripes, uint32_t stripe_size,
uint32_t extents, alloc_policy_t alloc,
struct dm_list *pvh)
@ -639,9 +639,6 @@ struct logical_volume *alloc_pool_metadata(struct logical_volume *pool_lv,
if (!(metadata_lv = lv_create_single(pool_lv->vg, &lvc)))
return_0;
if (!lv_rename_update(pool_lv->vg->cmd, metadata_lv, name, 0))
return_0;
return metadata_lv;
}

View File

@ -3269,7 +3269,6 @@ static int _lvconvert_to_pool(struct cmd_context *cmd,
meta_alloc = (alloc_policy_t) arg_uint_value(cmd, alloc_ARG, ALLOC_INHERIT);
if (!(metadata_lv = alloc_pool_metadata(lv,
meta_name,
meta_readahead,
meta_stripes,
meta_stripe_size,
@ -3426,7 +3425,7 @@ static int _lvconvert_to_pool(struct cmd_context *cmd,
* Rename deactivated metadata LV to have _tmeta suffix.
* Implicit checks if metadata_lv is visible.
*/
if (pool_metadata_name &&
if ((strcmp(metadata_lv->name, meta_name) != 0) &&
!lv_rename_update(cmd, metadata_lv, meta_name, 0))
goto_bad;