dlm for 3.15

This set includes a couple trivial cleanups and changes recovery
 log messages from DEBUG to INFO.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.15 (GNU/Linux)
 
 iQIcBAABAgAGBQJTPCtSAAoJEDgbc8f8gGmqn3IQALyqRO6spT5fGgPHktLo5lZx
 Qp6uFn1dHwPncQbdCOQPsFNBnCKE76+lfY09NjABCYnJdEyZFye1MwwYDyqQjqEt
 6kUi8LLrkF39KUkOPivV19fUfwNVMoNwAIUKzTSo8wuWE/1+0NL+FIxCUd3rGqxv
 A5yg1nXGTIBPNvZArq8bi49tfriCu167/QXLPlVWIRkyJ69H5ErC+sewufSP/Z5m
 S4yDFGOLy6pu+snT0GHGZcTRAfz37YpHdpAjlxUiurEZFXGvCagF55DaZIiRhf0K
 RDXrm1rgyNQ7H1gfKa92TOijGx62nOYR9F3zlc8c4tQB+eDaWTQWGR0+lgI/PklZ
 VPMHG+lqauaEv9YwKS5UL+E3BuyiAVuwF41mue8lOSA0t+D5P4O2gB+BFuYSpUy1
 Kwt2+S38sqiPwEqRcS/n+x/qx+uaGHxtsQh6cEJw4YM5cslJukkRSx8SUqgoETNB
 uUGjD+pG1lReyUUzzjG74UKRvb7dV+psWRDb56hx2nJrZ2H24s4h7FEHaHJWKoX+
 5H4K3b+E3lqwHp4ARu/yuUYgg/PCsGTsL986135nVnvjV/cHaG4u5N8KP+a9hSyW
 PkubO7kUO34KKH45yhSh79ELsWyw4gFgy0mls2BoDpE31phGkoYbKB+hbIkbeKVQ
 EZLmwKt2aijdo3z0g4bO
 =Ljna
 -----END PGP SIGNATURE-----

Merge tag 'dlm-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm

Pull dlm updates from David Teigland:
 "This set includes a couple trivial cleanups and changes recovery log
  messages from DEBUG to INFO"

* tag 'dlm-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
  dlm: use INFO for recovery messages
  fs: Include appropriate header file in dlm/ast.c
  dlm: silence a harmless use after free warning
This commit is contained in:
Linus Torvalds 2014-04-04 15:33:30 -07:00
commit 56c225fe39
8 changed files with 48 additions and 47 deletions

View File

@ -14,6 +14,7 @@
#include "dlm_internal.h"
#include "lock.h"
#include "user.h"
#include "ast.h"
static uint64_t dlm_cb_seq;
static DEFINE_SPINLOCK(dlm_cb_seq_spin);
@ -308,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);
}

View File

@ -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;
@ -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);

View File

@ -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 { \

View File

@ -687,6 +687,7 @@ static int find_rsb_dir(struct dlm_ls *ls, char *name, int len,
log_error(ls, "find_rsb new from_other %d dir %d our %d %s",
from_nodeid, dir_nodeid, our_nodeid, r->res_name);
dlm_free_rsb(r);
r = NULL;
error = -ENOTBLK;
goto out_unlock;
}
@ -5462,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);
}
@ -5536,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);
}
@ -5695,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;

View File

@ -190,7 +190,7 @@ 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 */
@ -198,7 +198,7 @@ static int do_uevent(struct dlm_ls *ls, int in)
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;
@ -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;
@ -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 */

View File

@ -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) {
@ -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)
@ -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++) {
@ -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);
@ -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;
}
@ -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++;
}
@ -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);
}
@ -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) {
@ -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;
}

View File

@ -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) {
@ -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:
@ -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:
@ -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 */
@ -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);
}

View File

@ -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);
@ -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;
}
@ -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;
}
@ -103,7 +103,7 @@ 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;
}
@ -111,11 +111,11 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv)
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);
/*
@ -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;
}
@ -154,7 +154,7 @@ 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;
}
@ -162,11 +162,11 @@ 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;
}
log_debug(ls, "dlm_recover_locks %u in",
log_rinfo(ls, "dlm_recover_locks %u in",
ls->ls_recover_locks_in);
/*
@ -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;
}
}
@ -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;
}
@ -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);
@ -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;