* [Cluster-devel] [PATCH] dlm: Avoid LVB truncation
@ 2013-06-26 12:27 Bart Van Assche
2013-06-26 16:41 ` David Teigland
0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2013-06-26 12:27 UTC (permalink / raw)
To: cluster-devel.redhat.com
For lockspaces with an LVB length above 64 bytes, avoid truncating
the LVB while exchanging it with another node in the cluster.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: David Teigland <teigland@redhat.com>
---
fs/dlm/lock.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 1b11466..e223a91 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -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];
if (b == 1) {
int len = receive_extralen(ms);
- if (len > DLM_RESNAME_MAXLEN)
- len = DLM_RESNAME_MAXLEN;
+ if (len > r->res_ls->ls_lvblen)
+ len = r->res_ls->ls_lvblen;
memcpy(lkb->lkb_lvbptr, ms->m_extra, len);
lkb->lkb_lvbseq = ms->m_lvbseq;
}
@@ -3893,8 +3893,8 @@ static int receive_lvb(struct dlm_ls *ls, struct dlm_lkb *lkb,
if (!lkb->lkb_lvbptr)
return -ENOMEM;
len = receive_extralen(ms);
- if (len > DLM_RESNAME_MAXLEN)
- len = DLM_RESNAME_MAXLEN;
+ if (len > ls->ls_lvblen)
+ len = ls->ls_lvblen;
memcpy(lkb->lkb_lvbptr, ms->m_extra, len);
}
return 0;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [PATCH] dlm: Avoid LVB truncation
2013-06-26 12:27 [Cluster-devel] [PATCH] dlm: Avoid LVB truncation Bart Van Assche
@ 2013-06-26 16:41 ` David Teigland
0 siblings, 0 replies; 2+ messages in thread
From: David Teigland @ 2013-06-26 16:41 UTC (permalink / raw)
To: cluster-devel.redhat.com
On Wed, Jun 26, 2013 at 02:27:57PM +0200, Bart Van Assche wrote:
> For lockspaces with an LVB length above 64 bytes, avoid truncating
> the LVB while exchanging it with another node in the cluster.
Thanks, I've added this to next.
Dave
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-06-26 16:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-26 12:27 [Cluster-devel] [PATCH] dlm: Avoid LVB truncation Bart Van Assche
2013-06-26 16:41 ` David Teigland
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).