1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

Use empty string instead of /dev// for LV path when there's no VG.

Don't allocate unused VG mempool in _pvsegs_sub_single.
This commit is contained in:
Alasdair Kergon 2011-03-09 12:44:42 +00:00
parent ee12300a56
commit 2f25c320fb
3 changed files with 9 additions and 6 deletions

View File

@ -1,6 +1,8 @@
Version 2.02.85 -
===================================
Send 1 byte shorted fully initialised local clvmd messages.
Use empty string instead of /dev// for LV path when there's no VG.
Don't allocate unused VG mempool in _pvsegs_sub_single.
Remove uninitialised byte from end of local clvmd messages.
Support --help option for clvmd and return error for unknown option.
Use system page size and not hardcoded value in locking code check.
Fix reading of released memory for printing segment type.

View File

@ -160,6 +160,9 @@ char *lv_path_dup(struct dm_pool *mem, const struct logical_volume *lv)
char *repstr;
size_t len;
if (!*lv->vg->name)
return dm_pool_strdup(mem, "");
len = strlen(lv->vg->cmd->dev_dir) + strlen(lv->vg->name) +
strlen(lv->name) + 2;
@ -173,6 +176,7 @@ char *lv_path_dup(struct dm_pool *mem, const struct logical_volume *lv)
log_error("lvpath snprintf failed");
return 0;
}
return repstr;
}

View File

@ -51,7 +51,6 @@ static int _segs_single(struct cmd_context *cmd __attribute__((unused)),
return ECMD_PROCESSED;
}
static int _pvsegs_sub_single(struct cmd_context *cmd,
struct volume_group *vg,
struct pv_segment *pvseg, void *handle)
@ -62,11 +61,9 @@ static int _pvsegs_sub_single(struct cmd_context *cmd,
struct volume_group _free_vg = {
.cmd = cmd,
.name = "",
.vgmem = NULL,
};
if (!(_free_vg.vgmem = dm_pool_create("_free_vg", 10240)))
return ECMD_FAILED;
struct logical_volume _free_logical_volume = {
.vg = vg ?: &_free_vg,
.name = "",
@ -109,8 +106,8 @@ static int _pvsegs_sub_single(struct cmd_context *cmd,
ret = ECMD_FAILED;
goto_out;
}
out:
free_vg(&_free_vg);
return ret;
}