mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-18 10:04:20 +03:00
cleanup: reduce couple debug lines
This commit is contained in:
parent
5e88d3a89b
commit
54741aeac5
29
lib/cache/lvmetad.c
vendored
29
lib/cache/lvmetad.c
vendored
@ -551,6 +551,7 @@ static int _token_update(int *replaced_update)
|
|||||||
daemon_reply reply;
|
daemon_reply reply;
|
||||||
const char *token_expected;
|
const char *token_expected;
|
||||||
const char *prev_token;
|
const char *prev_token;
|
||||||
|
const char *reply_str;
|
||||||
int update_pid;
|
int update_pid;
|
||||||
int ending_our_update;
|
int ending_our_update;
|
||||||
|
|
||||||
@ -567,13 +568,14 @@ static int _token_update(int *replaced_update)
|
|||||||
}
|
}
|
||||||
|
|
||||||
update_pid = (int)daemon_reply_int(reply, "update_pid", 0);
|
update_pid = (int)daemon_reply_int(reply, "update_pid", 0);
|
||||||
|
reply_str = daemon_reply_str(reply, "response", "");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A mismatch can only happen when this command attempts to set the
|
* A mismatch can only happen when this command attempts to set the
|
||||||
* token to filter:<hash> at the end of its update, but the update has
|
* token to filter:<hash> at the end of its update, but the update has
|
||||||
* been preempted in lvmetad by a new one (from update_pid).
|
* been preempted in lvmetad by a new one (from update_pid).
|
||||||
*/
|
*/
|
||||||
if (!strcmp(daemon_reply_str(reply, "response", ""), "token_mismatch")) {
|
if (!strcmp(reply_str, "token_mismatch")) {
|
||||||
token_expected = daemon_reply_str(reply, "expected", "");
|
token_expected = daemon_reply_str(reply, "expected", "");
|
||||||
|
|
||||||
ending_our_update = strcmp(_lvmetad_token, LVMETAD_TOKEN_UPDATE_IN_PROGRESS);
|
ending_our_update = strcmp(_lvmetad_token, LVMETAD_TOKEN_UPDATE_IN_PROGRESS);
|
||||||
@ -599,7 +601,7 @@ static int _token_update(int *replaced_update)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(daemon_reply_str(reply, "response", ""), "OK")) {
|
if (strcmp(reply_str, "OK")) {
|
||||||
log_error("Failed response from lvmetad for token update.");
|
log_error("Failed response from lvmetad for token update.");
|
||||||
daemon_reply_destroy(reply);
|
daemon_reply_destroy(reply);
|
||||||
return 0;
|
return 0;
|
||||||
@ -626,6 +628,7 @@ static int _lvmetad_handle_reply(daemon_reply reply, const char *id, const char
|
|||||||
{
|
{
|
||||||
const char *token_expected;
|
const char *token_expected;
|
||||||
const char *action;
|
const char *action;
|
||||||
|
const char *reply_str;
|
||||||
int action_modifies = 0;
|
int action_modifies = 0;
|
||||||
int daemon_in_update;
|
int daemon_in_update;
|
||||||
int we_are_in_update;
|
int we_are_in_update;
|
||||||
@ -670,8 +673,8 @@ static int _lvmetad_handle_reply(daemon_reply reply, const char *id, const char
|
|||||||
/*
|
/*
|
||||||
* Errors related to token mismatch.
|
* Errors related to token mismatch.
|
||||||
*/
|
*/
|
||||||
|
reply_str = daemon_reply_str(reply, "response", "");
|
||||||
if (!strcmp(daemon_reply_str(reply, "response", ""), "token_mismatch")) {
|
if (!strcmp(reply_str, "token_mismatch")) {
|
||||||
|
|
||||||
token_expected = daemon_reply_str(reply, "expected", "");
|
token_expected = daemon_reply_str(reply, "expected", "");
|
||||||
update_pid = (int)daemon_reply_int(reply, "update_pid", 0);
|
update_pid = (int)daemon_reply_int(reply, "update_pid", 0);
|
||||||
@ -769,14 +772,14 @@ static int _lvmetad_handle_reply(daemon_reply reply, const char *id, const char
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* All OK? */
|
/* All OK? */
|
||||||
if (!strcmp(daemon_reply_str(reply, "response", ""), "OK")) {
|
if (!strcmp(reply_str, "OK")) {
|
||||||
if (found)
|
if (found)
|
||||||
*found = 1;
|
*found = 1;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Unknown device permitted? */
|
/* Unknown device permitted? */
|
||||||
if (found && !strcmp(daemon_reply_str(reply, "response", ""), "unknown")) {
|
if (found && !strcmp(reply_str, "unknown")) {
|
||||||
log_very_verbose("Request to %s %s%sin lvmetad did not find any matching object.",
|
log_very_verbose("Request to %s %s%sin lvmetad did not find any matching object.",
|
||||||
action, object, *object ? " " : "");
|
action, object, *object ? " " : "");
|
||||||
*found = 0;
|
*found = 0;
|
||||||
@ -784,7 +787,7 @@ static int _lvmetad_handle_reply(daemon_reply reply, const char *id, const char
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Multiple VGs with the same name were found. */
|
/* Multiple VGs with the same name were found. */
|
||||||
if (found && !strcmp(daemon_reply_str(reply, "response", ""), "multiple")) {
|
if (found && !strcmp(reply_str, "multiple")) {
|
||||||
log_very_verbose("Request to %s %s%sin lvmetad found multiple matching objects.",
|
log_very_verbose("Request to %s %s%sin lvmetad found multiple matching objects.",
|
||||||
action, object, *object ? " " : "");
|
action, object, *object ? " " : "");
|
||||||
if (found)
|
if (found)
|
||||||
@ -1607,7 +1610,7 @@ int lvmetad_pv_found(struct cmd_context *cmd, const struct id *pvid, struct devi
|
|||||||
struct dm_config_tree *pvmeta, *vgmeta;
|
struct dm_config_tree *pvmeta, *vgmeta;
|
||||||
const char *status = NULL, *vgname = NULL;
|
const char *status = NULL, *vgname = NULL;
|
||||||
int64_t changed = 0;
|
int64_t changed = 0;
|
||||||
int result;
|
int result, seqno_after;
|
||||||
|
|
||||||
if (!lvmetad_used() || test_mode())
|
if (!lvmetad_used() || test_mode())
|
||||||
return 1;
|
return 1;
|
||||||
@ -1672,10 +1675,12 @@ int lvmetad_pv_found(struct cmd_context *cmd, const struct id *pvid, struct devi
|
|||||||
|
|
||||||
result = _lvmetad_handle_reply(reply, "pv_found", uuid, NULL);
|
result = _lvmetad_handle_reply(reply, "pv_found", uuid, NULL);
|
||||||
|
|
||||||
if (vg && result &&
|
if (vg && result) {
|
||||||
(daemon_reply_int(reply, "seqno_after", -1) != vg->seqno ||
|
seqno_after = daemon_reply_int(reply, "seqno_after", -1);
|
||||||
daemon_reply_int(reply, "seqno_after", -1) != daemon_reply_int(reply, "seqno_before", -1)))
|
if ((seqno_after != vg->seqno) ||
|
||||||
log_warn("WARNING: Inconsistent metadata found for VG %s", vg->name);
|
(seqno_after != daemon_reply_int(reply, "seqno_before", -1)))
|
||||||
|
log_warn("WARNING: Inconsistent metadata found for VG %s", vg->name);
|
||||||
|
}
|
||||||
|
|
||||||
if (result && found_vgnames) {
|
if (result && found_vgnames) {
|
||||||
status = daemon_reply_str(reply, "status", NULL);
|
status = daemon_reply_str(reply, "status", NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user