Commit 6072a93b authored by Linus Torvalds's avatar Linus Torvalds

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

Pull dlm updates from David Teigland:
 "This set includes a number of SCTP related fixes in the dlm, and a few
  other minor fixes and changes."

* tag 'dlm-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
  dlm: Avoid LVB truncation
  dlm: log an error for unmanaged lockspaces
  dlm: config: using strlcpy instead of strncpy
  dlm: remove duplicated include from lowcomms.c
  dlm: disable nagle for SCTP
  dlm: retry failed SCTP sends
  dlm: try other IPs when sctp init assoc fails
  dlm: clear correct bit during sctp init failure handling
  dlm: set sctp assoc id during setup
  dlm: clear correct init bit during sctp setup
parents 3f490f7f cfa805f6
...@@ -138,8 +138,9 @@ static ssize_t cluster_cluster_name_read(struct dlm_cluster *cl, char *buf) ...@@ -138,8 +138,9 @@ static ssize_t cluster_cluster_name_read(struct dlm_cluster *cl, char *buf)
static ssize_t cluster_cluster_name_write(struct dlm_cluster *cl, static ssize_t cluster_cluster_name_write(struct dlm_cluster *cl,
const char *buf, size_t len) const char *buf, size_t len)
{ {
strncpy(dlm_config.ci_cluster_name, buf, DLM_LOCKSPACE_LEN); strlcpy(dlm_config.ci_cluster_name, buf,
strncpy(cl->cl_cluster_name, buf, DLM_LOCKSPACE_LEN); sizeof(dlm_config.ci_cluster_name));
strlcpy(cl->cl_cluster_name, buf, sizeof(cl->cl_cluster_name));
return len; return len;
} }
......
...@@ -2038,8 +2038,8 @@ static void set_lvb_lock_pc(struct dlm_rsb *r, struct dlm_lkb *lkb, ...@@ -2038,8 +2038,8 @@ static void set_lvb_lock_pc(struct dlm_rsb *r, struct dlm_lkb *lkb,
b = dlm_lvb_operations[lkb->lkb_grmode + 1][lkb->lkb_rqmode + 1]; b = dlm_lvb_operations[lkb->lkb_grmode + 1][lkb->lkb_rqmode + 1];
if (b == 1) { if (b == 1) {
int len = receive_extralen(ms); int len = receive_extralen(ms);
if (len > DLM_RESNAME_MAXLEN) if (len > r->res_ls->ls_lvblen)
len = DLM_RESNAME_MAXLEN; len = r->res_ls->ls_lvblen;
memcpy(lkb->lkb_lvbptr, ms->m_extra, len); memcpy(lkb->lkb_lvbptr, ms->m_extra, len);
lkb->lkb_lvbseq = ms->m_lvbseq; lkb->lkb_lvbseq = ms->m_lvbseq;
} }
...@@ -3893,8 +3893,8 @@ static int receive_lvb(struct dlm_ls *ls, struct dlm_lkb *lkb, ...@@ -3893,8 +3893,8 @@ static int receive_lvb(struct dlm_ls *ls, struct dlm_lkb *lkb,
if (!lkb->lkb_lvbptr) if (!lkb->lkb_lvbptr)
return -ENOMEM; return -ENOMEM;
len = receive_extralen(ms); len = receive_extralen(ms);
if (len > DLM_RESNAME_MAXLEN) if (len > ls->ls_lvblen)
len = DLM_RESNAME_MAXLEN; len = ls->ls_lvblen;
memcpy(lkb->lkb_lvbptr, ms->m_extra, len); memcpy(lkb->lkb_lvbptr, ms->m_extra, len);
} }
return 0; return 0;
......
...@@ -883,17 +883,24 @@ int dlm_release_lockspace(void *lockspace, int force) ...@@ -883,17 +883,24 @@ int dlm_release_lockspace(void *lockspace, int force)
void dlm_stop_lockspaces(void) void dlm_stop_lockspaces(void)
{ {
struct dlm_ls *ls; struct dlm_ls *ls;
int count;
restart: restart:
count = 0;
spin_lock(&lslist_lock); spin_lock(&lslist_lock);
list_for_each_entry(ls, &lslist, ls_list) { list_for_each_entry(ls, &lslist, ls_list) {
if (!test_bit(LSFL_RUNNING, &ls->ls_flags)) if (!test_bit(LSFL_RUNNING, &ls->ls_flags)) {
count++;
continue; continue;
}
spin_unlock(&lslist_lock); spin_unlock(&lslist_lock);
log_error(ls, "no userland control daemon, stopping lockspace"); log_error(ls, "no userland control daemon, stopping lockspace");
dlm_ls_stop(ls); dlm_ls_stop(ls);
goto restart; goto restart;
} }
spin_unlock(&lslist_lock); spin_unlock(&lslist_lock);
if (count)
log_print("dlm user daemon left %d lockspaces", count);
} }
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment