mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Fix incorrect tests for dm_snprintf() failure
As the memory is preallocated based on arg size in these cases, the error would be quite hard to trigger here anyway.
This commit is contained in:
parent
a1eba521e3
commit
c67d2b4dd4
@ -1,5 +1,6 @@
|
||||
Version 2.02.85 -
|
||||
===================================
|
||||
Fix incorrect tests for dm_snprintf() failure.
|
||||
Fix some unmatching sign comparation gcc warnings in the code.
|
||||
Allow lv_extend() to work on zero length intrinsically layered LVs.
|
||||
Keep the cache content when the exported vg buffer is matching.
|
||||
|
@ -2296,7 +2296,7 @@ static int _rename_sub_lv(struct cmd_context *cmd,
|
||||
log_error("Failed to allocate space for new name");
|
||||
return 0;
|
||||
}
|
||||
if (!dm_snprintf(new_name, len, "%s%s", lv_name_new, suffix)) {
|
||||
if (dm_snprintf(new_name, len, "%s%s", lv_name_new, suffix) < 0) {
|
||||
log_error("Failed to create new name");
|
||||
return 0;
|
||||
}
|
||||
|
@ -1787,7 +1787,7 @@ static struct logical_volume *_set_up_mirror_log(struct cmd_context *cmd,
|
||||
} else if ((lv_name = strstr(lv->name, MIRROR_SYNC_LAYER))) {
|
||||
len = lv_name - lv->name + 1;
|
||||
if (!(tmp_name = alloca(len)) ||
|
||||
!dm_snprintf(tmp_name, len, "%s", lv->name)) {
|
||||
(dm_snprintf(tmp_name, len, "%s", lv->name) < 0)) {
|
||||
log_error("mirror log name allocation failed");
|
||||
return 0;
|
||||
}
|
||||
|
@ -481,7 +481,7 @@ int lvconvert_poll(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
if (!uuid || !lv_full_name)
|
||||
return_0;
|
||||
|
||||
if (!dm_snprintf(lv_full_name, len, "%s/%s", lv->vg->name, lv->name))
|
||||
if (dm_snprintf(lv_full_name, len, "%s/%s", lv->vg->name, lv->name) < 0)
|
||||
return_0;
|
||||
|
||||
memcpy(uuid, &lv->lvid, sizeof(lv->lvid));
|
||||
|
Loading…
Reference in New Issue
Block a user