Skip to content

Commit

Permalink
dlm: use INFO for recovery messages
Browse files Browse the repository at this point in the history
The log messages relating to the progress of recovery
are minimal and very often useful.  Change these to
the KERN_INFO level so they are always available.

Signed-off-by: David Teigland <[email protected]>
  • Loading branch information
teigland committed Feb 14, 2014
1 parent 9505857 commit 075f017
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 47 deletions.
2 changes: 1 addition & 1 deletion fs/dlm/ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,6 @@ void dlm_callback_resume(struct dlm_ls *ls)
mutex_unlock(&ls->ls_cb_mutex);

if (count)
log_debug(ls, "dlm_callback_resume %d", count);
log_rinfo(ls, "dlm_callback_resume %d", count);
}

4 changes: 2 additions & 2 deletions fs/dlm/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int dlm_recover_directory(struct dlm_ls *ls)
uint16_t namelen;
unsigned int count = 0, count_match = 0, count_bad = 0, count_add = 0;

log_debug(ls, "dlm_recover_directory");
log_rinfo(ls, "dlm_recover_directory");

if (dlm_no_directory(ls))
goto out_status;
Expand Down Expand Up @@ -189,7 +189,7 @@ int dlm_recover_directory(struct dlm_ls *ls)
error = 0;
dlm_set_recover_status(ls, DLM_RS_DIR);

log_debug(ls, "dlm_recover_directory %u in %u new",
log_rinfo(ls, "dlm_recover_directory %u in %u new",
count, count_add);
out_free:
kfree(last_name);
Expand Down
2 changes: 2 additions & 0 deletions fs/dlm/dlm_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ struct dlm_mhandle;
printk(KERN_ERR "dlm: "fmt"\n" , ##args)
#define log_error(ls, fmt, args...) \
printk(KERN_ERR "dlm: %s: " fmt "\n", (ls)->ls_name , ##args)
#define log_rinfo(ls, fmt, args...) \
printk(KERN_INFO "dlm: %s: " fmt "\n", (ls)->ls_name , ##args);

#define log_debug(ls, fmt, args...) \
do { \
Expand Down
6 changes: 3 additions & 3 deletions fs/dlm/lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -5463,7 +5463,7 @@ void dlm_recover_purge(struct dlm_ls *ls)
up_write(&ls->ls_root_sem);

if (lkb_count)
log_debug(ls, "dlm_recover_purge %u locks for %u nodes",
log_rinfo(ls, "dlm_recover_purge %u locks for %u nodes",
lkb_count, nodes_count);
}

Expand Down Expand Up @@ -5537,7 +5537,7 @@ void dlm_recover_grant(struct dlm_ls *ls)
}

if (lkb_count)
log_debug(ls, "dlm_recover_grant %u locks on %u resources",
log_rinfo(ls, "dlm_recover_grant %u locks on %u resources",
lkb_count, rsb_count);
}

Expand Down Expand Up @@ -5696,7 +5696,7 @@ int dlm_recover_master_copy(struct dlm_ls *ls, struct dlm_rcom *rc)
put_rsb(r);
out:
if (error && error != -EEXIST)
log_debug(ls, "dlm_recover_master_copy remote %d %x error %d",
log_rinfo(ls, "dlm_recover_master_copy remote %d %x error %d",
from_nodeid, remid, error);
rl->rl_result = cpu_to_le32(error);
return error;
Expand Down
8 changes: 4 additions & 4 deletions fs/dlm/lockspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,15 @@ static int do_uevent(struct dlm_ls *ls, int in)
else
kobject_uevent(&ls->ls_kobj, KOBJ_OFFLINE);

log_debug(ls, "%s the lockspace group...", in ? "joining" : "leaving");
log_rinfo(ls, "%s the lockspace group...", in ? "joining" : "leaving");

/* dlm_controld will see the uevent, do the necessary group management
and then write to sysfs to wake us */

error = wait_event_interruptible(ls->ls_uevent_wait,
test_and_clear_bit(LSFL_UEVENT_WAIT, &ls->ls_flags));

log_debug(ls, "group event done %d %d", error, ls->ls_uevent_result);
log_rinfo(ls, "group event done %d %d", error, ls->ls_uevent_result);

if (error)
goto out;
Expand Down Expand Up @@ -640,7 +640,7 @@ static int new_lockspace(const char *name, const char *cluster,

dlm_create_debug_file(ls);

log_debug(ls, "join complete");
log_rinfo(ls, "join complete");
*lockspace = ls;
return 0;

Expand Down Expand Up @@ -835,7 +835,7 @@ static int release_lockspace(struct dlm_ls *ls, int force)
dlm_clear_members(ls);
dlm_clear_members_gone(ls);
kfree(ls->ls_node_array);
log_debug(ls, "release_lockspace final free");
log_rinfo(ls, "release_lockspace final free");
kobject_put(&ls->ls_kobj);
/* The ls structure will be freed when the kobject is done with */

Expand Down
27 changes: 12 additions & 15 deletions fs/dlm/member.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,15 @@ void dlm_slots_copy_out(struct dlm_ls *ls, struct dlm_rcom *rc)

#define SLOT_DEBUG_LINE 128

static void log_debug_slots(struct dlm_ls *ls, uint32_t gen, int num_slots,
struct rcom_slot *ro0, struct dlm_slot *array,
int array_size)
static void log_slots(struct dlm_ls *ls, uint32_t gen, int num_slots,
struct rcom_slot *ro0, struct dlm_slot *array,
int array_size)
{
char line[SLOT_DEBUG_LINE];
int len = SLOT_DEBUG_LINE - 1;
int pos = 0;
int ret, i;

if (!dlm_config.ci_log_debug)
return;

memset(line, 0, sizeof(line));

if (array) {
Expand All @@ -95,7 +92,7 @@ static void log_debug_slots(struct dlm_ls *ls, uint32_t gen, int num_slots,
}
}

log_debug(ls, "generation %u slots %d%s", gen, num_slots, line);
log_rinfo(ls, "generation %u slots %d%s", gen, num_slots, line);
}

int dlm_slots_copy_in(struct dlm_ls *ls)
Expand Down Expand Up @@ -129,7 +126,7 @@ int dlm_slots_copy_in(struct dlm_ls *ls)
ro->ro_slot = le16_to_cpu(ro->ro_slot);
}

log_debug_slots(ls, gen, num_slots, ro0, NULL, 0);
log_slots(ls, gen, num_slots, ro0, NULL, 0);

list_for_each_entry(memb, &ls->ls_nodes, list) {
for (i = 0, ro = ro0; i < num_slots; i++, ro++) {
Expand Down Expand Up @@ -274,7 +271,7 @@ int dlm_slots_assign(struct dlm_ls *ls, int *num_slots, int *slots_size,

gen++;

log_debug_slots(ls, gen, num, NULL, array, array_size);
log_slots(ls, gen, num, NULL, array, array_size);

max_slots = (dlm_config.ci_buffer_size - sizeof(struct dlm_rcom) -
sizeof(struct rcom_config)) / sizeof(struct rcom_slot);
Expand Down Expand Up @@ -447,7 +444,7 @@ static int ping_members(struct dlm_ls *ls)
break;
}
if (error)
log_debug(ls, "ping_members aborted %d last nodeid %d",
log_rinfo(ls, "ping_members aborted %d last nodeid %d",
error, ls->ls_recover_nodeid);
return error;
}
Expand Down Expand Up @@ -539,7 +536,7 @@ int dlm_recover_members(struct dlm_ls *ls, struct dlm_recover *rv, int *neg_out)
count as a negative change so the "neg" recovery steps will happen */

list_for_each_entry(memb, &ls->ls_nodes_gone, list) {
log_debug(ls, "prev removed member %d", memb->nodeid);
log_rinfo(ls, "prev removed member %d", memb->nodeid);
neg++;
}

Expand All @@ -551,10 +548,10 @@ int dlm_recover_members(struct dlm_ls *ls, struct dlm_recover *rv, int *neg_out)
continue;

if (!node) {
log_debug(ls, "remove member %d", memb->nodeid);
log_rinfo(ls, "remove member %d", memb->nodeid);
} else {
/* removed and re-added */
log_debug(ls, "remove member %d comm_seq %u %u",
log_rinfo(ls, "remove member %d comm_seq %u %u",
memb->nodeid, memb->comm_seq, node->comm_seq);
}

Expand All @@ -571,7 +568,7 @@ int dlm_recover_members(struct dlm_ls *ls, struct dlm_recover *rv, int *neg_out)
if (dlm_is_member(ls, node->nodeid))
continue;
dlm_add_member(ls, node);
log_debug(ls, "add member %d", node->nodeid);
log_rinfo(ls, "add member %d", node->nodeid);
}

list_for_each_entry(memb, &ls->ls_nodes, list) {
Expand All @@ -591,7 +588,7 @@ int dlm_recover_members(struct dlm_ls *ls, struct dlm_recover *rv, int *neg_out)
complete(&ls->ls_members_done);
}

log_debug(ls, "dlm_recover_members %d nodes", ls->ls_num_nodes);
log_rinfo(ls, "dlm_recover_members %d nodes", ls->ls_num_nodes);
return error;
}

Expand Down
10 changes: 5 additions & 5 deletions fs/dlm/recover.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ int dlm_recover_masters(struct dlm_ls *ls)
int nodir = dlm_no_directory(ls);
int error;

log_debug(ls, "dlm_recover_masters");
log_rinfo(ls, "dlm_recover_masters");

down_read(&ls->ls_root_sem);
list_for_each_entry(r, &ls->ls_root_list, res_root_list) {
Expand All @@ -552,7 +552,7 @@ int dlm_recover_masters(struct dlm_ls *ls)
}
up_read(&ls->ls_root_sem);

log_debug(ls, "dlm_recover_masters %u of %u", count, total);
log_rinfo(ls, "dlm_recover_masters %u of %u", count, total);

error = dlm_wait_function(ls, &recover_idr_empty);
out:
Expand Down Expand Up @@ -685,7 +685,7 @@ int dlm_recover_locks(struct dlm_ls *ls)
}
up_read(&ls->ls_root_sem);

log_debug(ls, "dlm_recover_locks %d out", count);
log_rinfo(ls, "dlm_recover_locks %d out", count);

error = dlm_wait_function(ls, &recover_list_empty);
out:
Expand Down Expand Up @@ -883,7 +883,7 @@ void dlm_recover_rsbs(struct dlm_ls *ls)
up_read(&ls->ls_root_sem);

if (count)
log_debug(ls, "dlm_recover_rsbs %d done", count);
log_rinfo(ls, "dlm_recover_rsbs %d done", count);
}

/* Create a single list of all root rsb's to be used during recovery */
Expand Down Expand Up @@ -950,6 +950,6 @@ void dlm_clear_toss(struct dlm_ls *ls)
}

if (count)
log_debug(ls, "dlm_clear_toss %u done", count);
log_rinfo(ls, "dlm_clear_toss %u done", count);
}

34 changes: 17 additions & 17 deletions fs/dlm/recoverd.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv)
unsigned long start;
int error, neg = 0;

log_debug(ls, "dlm_recover %llu", (unsigned long long)rv->seq);
log_rinfo(ls, "dlm_recover %llu", (unsigned long long)rv->seq);

mutex_lock(&ls->ls_recoverd_active);

Expand All @@ -76,7 +76,7 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv)

error = dlm_recover_members(ls, rv, &neg);
if (error) {
log_debug(ls, "dlm_recover_members error %d", error);
log_rinfo(ls, "dlm_recover_members error %d", error);
goto fail;
}

Expand All @@ -90,7 +90,7 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv)

error = dlm_recover_members_wait(ls);
if (error) {
log_debug(ls, "dlm_recover_members_wait error %d", error);
log_rinfo(ls, "dlm_recover_members_wait error %d", error);
goto fail;
}

Expand All @@ -103,19 +103,19 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv)

error = dlm_recover_directory(ls);
if (error) {
log_debug(ls, "dlm_recover_directory error %d", error);
log_rinfo(ls, "dlm_recover_directory error %d", error);
goto fail;
}

dlm_set_recover_status(ls, DLM_RS_DIR);

error = dlm_recover_directory_wait(ls);
if (error) {
log_debug(ls, "dlm_recover_directory_wait error %d", error);
log_rinfo(ls, "dlm_recover_directory_wait error %d", error);
goto fail;
}

log_debug(ls, "dlm_recover_directory %u out %u messages",
log_rinfo(ls, "dlm_recover_directory %u out %u messages",
ls->ls_recover_dir_sent_res, ls->ls_recover_dir_sent_msg);

/*
Expand Down Expand Up @@ -144,7 +144,7 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv)

error = dlm_recover_masters(ls);
if (error) {
log_debug(ls, "dlm_recover_masters error %d", error);
log_rinfo(ls, "dlm_recover_masters error %d", error);
goto fail;
}

Expand All @@ -154,19 +154,19 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv)

error = dlm_recover_locks(ls);
if (error) {
log_debug(ls, "dlm_recover_locks error %d", error);
log_rinfo(ls, "dlm_recover_locks error %d", error);
goto fail;
}

dlm_set_recover_status(ls, DLM_RS_LOCKS);

error = dlm_recover_locks_wait(ls);
if (error) {
log_debug(ls, "dlm_recover_locks_wait error %d", error);
log_rinfo(ls, "dlm_recover_locks_wait error %d", error);
goto fail;
}

log_debug(ls, "dlm_recover_locks %u in",
log_rinfo(ls, "dlm_recover_locks %u in",
ls->ls_recover_locks_in);

/*
Expand All @@ -186,7 +186,7 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv)

error = dlm_recover_locks_wait(ls);
if (error) {
log_debug(ls, "dlm_recover_locks_wait error %d", error);
log_rinfo(ls, "dlm_recover_locks_wait error %d", error);
goto fail;
}
}
Expand All @@ -205,7 +205,7 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv)

error = dlm_recover_done_wait(ls);
if (error) {
log_debug(ls, "dlm_recover_done_wait error %d", error);
log_rinfo(ls, "dlm_recover_done_wait error %d", error);
goto fail;
}

Expand All @@ -217,25 +217,25 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv)

error = enable_locking(ls, rv->seq);
if (error) {
log_debug(ls, "enable_locking error %d", error);
log_rinfo(ls, "enable_locking error %d", error);
goto fail;
}

error = dlm_process_requestqueue(ls);
if (error) {
log_debug(ls, "dlm_process_requestqueue error %d", error);
log_rinfo(ls, "dlm_process_requestqueue error %d", error);
goto fail;
}

error = dlm_recover_waiters_post(ls);
if (error) {
log_debug(ls, "dlm_recover_waiters_post error %d", error);
log_rinfo(ls, "dlm_recover_waiters_post error %d", error);
goto fail;
}

dlm_recover_grant(ls);

log_debug(ls, "dlm_recover %llu generation %u done: %u ms",
log_rinfo(ls, "dlm_recover %llu generation %u done: %u ms",
(unsigned long long)rv->seq, ls->ls_generation,
jiffies_to_msecs(jiffies - start));
mutex_unlock(&ls->ls_recoverd_active);
Expand All @@ -245,7 +245,7 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv)

fail:
dlm_release_root_list(ls);
log_debug(ls, "dlm_recover %llu error %d",
log_rinfo(ls, "dlm_recover %llu error %d",
(unsigned long long)rv->seq, error);
mutex_unlock(&ls->ls_recoverd_active);
return error;
Expand Down

0 comments on commit 075f017

Please sign in to comment.