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:
parent
ee12300a56
commit
2f25c320fb
@ -1,6 +1,8 @@
|
|||||||
Version 2.02.85 -
|
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.
|
Support --help option for clvmd and return error for unknown option.
|
||||||
Use system page size and not hardcoded value in locking code check.
|
Use system page size and not hardcoded value in locking code check.
|
||||||
Fix reading of released memory for printing segment type.
|
Fix reading of released memory for printing segment type.
|
||||||
|
@ -160,6 +160,9 @@ char *lv_path_dup(struct dm_pool *mem, const struct logical_volume *lv)
|
|||||||
char *repstr;
|
char *repstr;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
|
if (!*lv->vg->name)
|
||||||
|
return dm_pool_strdup(mem, "");
|
||||||
|
|
||||||
len = strlen(lv->vg->cmd->dev_dir) + strlen(lv->vg->name) +
|
len = strlen(lv->vg->cmd->dev_dir) + strlen(lv->vg->name) +
|
||||||
strlen(lv->name) + 2;
|
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");
|
log_error("lvpath snprintf failed");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return repstr;
|
return repstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,6 @@ static int _segs_single(struct cmd_context *cmd __attribute__((unused)),
|
|||||||
|
|
||||||
return ECMD_PROCESSED;
|
return ECMD_PROCESSED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _pvsegs_sub_single(struct cmd_context *cmd,
|
static int _pvsegs_sub_single(struct cmd_context *cmd,
|
||||||
struct volume_group *vg,
|
struct volume_group *vg,
|
||||||
struct pv_segment *pvseg, void *handle)
|
struct pv_segment *pvseg, void *handle)
|
||||||
@ -62,11 +61,9 @@ static int _pvsegs_sub_single(struct cmd_context *cmd,
|
|||||||
struct volume_group _free_vg = {
|
struct volume_group _free_vg = {
|
||||||
.cmd = cmd,
|
.cmd = cmd,
|
||||||
.name = "",
|
.name = "",
|
||||||
|
.vgmem = NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!(_free_vg.vgmem = dm_pool_create("_free_vg", 10240)))
|
|
||||||
return ECMD_FAILED;
|
|
||||||
|
|
||||||
struct logical_volume _free_logical_volume = {
|
struct logical_volume _free_logical_volume = {
|
||||||
.vg = vg ?: &_free_vg,
|
.vg = vg ?: &_free_vg,
|
||||||
.name = "",
|
.name = "",
|
||||||
@ -109,8 +106,8 @@ static int _pvsegs_sub_single(struct cmd_context *cmd,
|
|||||||
ret = ECMD_FAILED;
|
ret = ECMD_FAILED;
|
||||||
goto_out;
|
goto_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
free_vg(&_free_vg);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user