1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 03:27:58 +03:00

thin: cleanup _thin_pool_add_message

Make this code a bit more readable for Coverity as otherwise
it marks the "type" variable in the "_thin_pool_add_message" fn
as undefined for certain path (...which is normally unreachable anyway,
but let's clean this up).
This commit is contained in:
Peter Rajnoha 2014-01-08 10:56:05 +01:00
parent 0a13815e68
commit de3abfa622

View File

@ -62,16 +62,10 @@ static int _thin_pool_add_message(struct lv_segment *seg,
lv_name);
/* FIXME: switch to _SNAP later, if the created LV has an origin */
type = DM_THIN_MESSAGE_CREATE_THIN;
}
if (!dm_config_get_uint32(sn, "delete", &delete_id)) {
if (!lv)
return SEG_LOG_ERROR("Unknown message in");
} else {
if (lv)
return SEG_LOG_ERROR("Unsupported message format in");
} else if (dm_config_get_uint32(sn, "delete", &delete_id))
type = DM_THIN_MESSAGE_DELETE;
}
else
return SEG_LOG_ERROR("Unknown message in");
if (!attach_pool_message(seg, type, lv, delete_id, 1))
return_0;