Skip to content

Commit 6072a93

Browse files
committed
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
2 parents 3f490f7 + cfa805f commit 6072a93

File tree

4 files changed

+149
-50
lines changed

4 files changed

+149
-50
lines changed

fs/dlm/config.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,9 @@ static ssize_t cluster_cluster_name_read(struct dlm_cluster *cl, char *buf)
138138
static ssize_t cluster_cluster_name_write(struct dlm_cluster *cl,
139139
const char *buf, size_t len)
140140
{
141-
strncpy(dlm_config.ci_cluster_name, buf, DLM_LOCKSPACE_LEN);
142-
strncpy(cl->cl_cluster_name, buf, DLM_LOCKSPACE_LEN);
141+
strlcpy(dlm_config.ci_cluster_name, buf,
142+
sizeof(dlm_config.ci_cluster_name));
143+
strlcpy(cl->cl_cluster_name, buf, sizeof(cl->cl_cluster_name));
143144
return len;
144145
}
145146

fs/dlm/lock.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,8 +2038,8 @@ static void set_lvb_lock_pc(struct dlm_rsb *r, struct dlm_lkb *lkb,
20382038
b = dlm_lvb_operations[lkb->lkb_grmode + 1][lkb->lkb_rqmode + 1];
20392039
if (b == 1) {
20402040
int len = receive_extralen(ms);
2041-
if (len > DLM_RESNAME_MAXLEN)
2042-
len = DLM_RESNAME_MAXLEN;
2041+
if (len > r->res_ls->ls_lvblen)
2042+
len = r->res_ls->ls_lvblen;
20432043
memcpy(lkb->lkb_lvbptr, ms->m_extra, len);
20442044
lkb->lkb_lvbseq = ms->m_lvbseq;
20452045
}
@@ -3893,8 +3893,8 @@ static int receive_lvb(struct dlm_ls *ls, struct dlm_lkb *lkb,
38933893
if (!lkb->lkb_lvbptr)
38943894
return -ENOMEM;
38953895
len = receive_extralen(ms);
3896-
if (len > DLM_RESNAME_MAXLEN)
3897-
len = DLM_RESNAME_MAXLEN;
3896+
if (len > ls->ls_lvblen)
3897+
len = ls->ls_lvblen;
38983898
memcpy(lkb->lkb_lvbptr, ms->m_extra, len);
38993899
}
39003900
return 0;

fs/dlm/lockspace.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,17 +883,24 @@ int dlm_release_lockspace(void *lockspace, int force)
883883
void dlm_stop_lockspaces(void)
884884
{
885885
struct dlm_ls *ls;
886+
int count;
886887

887888
restart:
889+
count = 0;
888890
spin_lock(&lslist_lock);
889891
list_for_each_entry(ls, &lslist, ls_list) {
890-
if (!test_bit(LSFL_RUNNING, &ls->ls_flags))
892+
if (!test_bit(LSFL_RUNNING, &ls->ls_flags)) {
893+
count++;
891894
continue;
895+
}
892896
spin_unlock(&lslist_lock);
893897
log_error(ls, "no userland control daemon, stopping lockspace");
894898
dlm_ls_stop(ls);
895899
goto restart;
896900
}
897901
spin_unlock(&lslist_lock);
902+
903+
if (count)
904+
log_print("dlm user daemon left %d lockspaces", count);
898905
}
899906

0 commit comments

Comments
 (0)