mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-17 06:04:23 +03:00
Use id_equal instead of strncmp()
More consistent and easier to read.
This commit is contained in:
parent
6076185b70
commit
1bedd3a97b
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.85 -
|
Version 2.02.85 -
|
||||||
===================================
|
===================================
|
||||||
|
Replace several strncmp() calls with id_equal().
|
||||||
Fix lvmcache_info transfer to orphan_vginfo in _lvmcache_update_vgname().
|
Fix lvmcache_info transfer to orphan_vginfo in _lvmcache_update_vgname().
|
||||||
Fix -Wold-style-definition gcc warnings.
|
Fix -Wold-style-definition gcc warnings.
|
||||||
Fixes for lvconvert (including --repair) of temporary mirror stacks.
|
Fixes for lvconvert (including --repair) of temporary mirror stacks.
|
||||||
|
@ -3043,8 +3043,7 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strncmp((char *)vg->id.uuid,
|
if (!id_equal(&vg->id, &correct_vg->id)) {
|
||||||
(char *)correct_vg->id.uuid, ID_LEN)) {
|
|
||||||
inconsistent = 1;
|
inconsistent = 1;
|
||||||
inconsistent_vgid = 1;
|
inconsistent_vgid = 1;
|
||||||
}
|
}
|
||||||
@ -3292,7 +3291,7 @@ static struct volume_group *_vg_read_by_vgid(struct cmd_context *cmd,
|
|||||||
vginfo->vgname && !is_orphan_vg(vginfo->vgname)) {
|
vginfo->vgname && !is_orphan_vg(vginfo->vgname)) {
|
||||||
if ((vg = _vg_read(cmd, NULL, vgid, 1,
|
if ((vg = _vg_read(cmd, NULL, vgid, 1,
|
||||||
&consistent, precommitted)) &&
|
&consistent, precommitted)) &&
|
||||||
!strncmp((char *)vg->id.uuid, vgid, ID_LEN)) {
|
id_equal(&vg->id, (const struct id *)vgid)) {
|
||||||
if (!consistent)
|
if (!consistent)
|
||||||
log_error("Volume group %s metadata is "
|
log_error("Volume group %s metadata is "
|
||||||
"inconsistent", vg->name);
|
"inconsistent", vg->name);
|
||||||
@ -3323,7 +3322,7 @@ static struct volume_group *_vg_read_by_vgid(struct cmd_context *cmd,
|
|||||||
consistent = 0;
|
consistent = 0;
|
||||||
if ((vg = _vg_read(cmd, vgname, vgid, 1, &consistent,
|
if ((vg = _vg_read(cmd, vgname, vgid, 1, &consistent,
|
||||||
precommitted)) &&
|
precommitted)) &&
|
||||||
!strncmp((char *)vg->id.uuid, vgid, ID_LEN)) {
|
id_equal(&vg->id, (const struct id *)vgid)) {
|
||||||
if (!consistent) {
|
if (!consistent) {
|
||||||
log_error("Volume group %s metadata is "
|
log_error("Volume group %s metadata is "
|
||||||
"inconsistent", vgname);
|
"inconsistent", vgname);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user