diff options
author | Joel Becker <Joel.Becker@oracle.com> | 2008-01-25 20:02:21 -0500 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2008-02-06 19:11:29 -0500 |
commit | d24fbcda0c4988322949df3d759f1cfb32b32953 (patch) | |
tree | d8454796d58649126005001472e9dcee8bd557ca /fs/ocfs2/dlm/userdlm.c | |
parent | 3e6bdf473f489664dac4d7511d26c7ac3dfdc748 (diff) |
ocfs2: Negotiate locking protocol versions.
Currently, when ocfs2 nodes connect via TCP, they advertise their
compatibility level. If the versions do not match, two nodes cannot speak
to each other and they disconnect. As a result, this provides no forward or
backwards compatibility.
This patch implements a simple protocol negotiation at the dlm level by
introducing a major/minor version number scheme for entities that
communicate. Specifically, o2dlm has a major/minor version for interaction
with o2dlm on other nodes, and ocfs2 itself has a major/minor version for
interacting with the filesystem on other nodes.
This will allow rolling upgrades of ocfs2 clusters when changes to the
locking or network protocols can be done in a backwards compatible manner.
In those cases, only the minor number is changed and the negotatied protocol
minor is returned from dlm join. In the far less likely event that a
required protocol change makes backwards compatibility impossible, we simply
bump the major number.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/dlm/userdlm.c')
-rw-r--r-- | fs/ocfs2/dlm/userdlm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ocfs2/dlm/userdlm.c b/fs/ocfs2/dlm/userdlm.c index 7d2f578b267d..4cb1d3dae250 100644 --- a/fs/ocfs2/dlm/userdlm.c +++ b/fs/ocfs2/dlm/userdlm.c | |||
@@ -645,7 +645,8 @@ bail: | |||
645 | return status; | 645 | return status; |
646 | } | 646 | } |
647 | 647 | ||
648 | struct dlm_ctxt *user_dlm_register_context(struct qstr *name) | 648 | struct dlm_ctxt *user_dlm_register_context(struct qstr *name, |
649 | struct dlm_protocol_version *proto) | ||
649 | { | 650 | { |
650 | struct dlm_ctxt *dlm; | 651 | struct dlm_ctxt *dlm; |
651 | u32 dlm_key; | 652 | u32 dlm_key; |
@@ -661,7 +662,7 @@ struct dlm_ctxt *user_dlm_register_context(struct qstr *name) | |||
661 | 662 | ||
662 | snprintf(domain, name->len + 1, "%.*s", name->len, name->name); | 663 | snprintf(domain, name->len + 1, "%.*s", name->len, name->name); |
663 | 664 | ||
664 | dlm = dlm_register_domain(domain, dlm_key); | 665 | dlm = dlm_register_domain(domain, dlm_key, proto); |
665 | if (IS_ERR(dlm)) | 666 | if (IS_ERR(dlm)) |
666 | mlog_errno(PTR_ERR(dlm)); | 667 | mlog_errno(PTR_ERR(dlm)); |
667 | 668 | ||