summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSage Weil2010-02-04 18:42:20 +0100
committerSage Weil2010-02-11 00:04:48 +0100
commit07c8739c521cb029d0f3549556aae2d304513978 (patch)
tree096f9775bfa1ca3092e9a5e223b0df4d5bcf0bc0
parentceph: allow renewal of auth credentials (diff)
downloadkernel-qcow2-linux-07c8739c521cb029d0f3549556aae2d304513978.tar.gz
kernel-qcow2-linux-07c8739c521cb029d0f3549556aae2d304513978.tar.xz
kernel-qcow2-linux-07c8739c521cb029d0f3549556aae2d304513978.zip
ceph: add struct version to auth encoding
Inlucde struct version in encoding. This will streamline future protocol changes. Signed-off-by: Sage Weil <sage@newdream.net>
-rw-r--r--fs/ceph/auth.c3
-rw-r--r--fs/ceph/auth_none.c1
2 files changed, 4 insertions, 0 deletions
diff --git a/fs/ceph/auth.c b/fs/ceph/auth.c
index d5872d4f92bf..b34ce0e41b4c 100644
--- a/fs/ceph/auth.c
+++ b/fs/ceph/auth.c
@@ -107,8 +107,11 @@ int ceph_auth_build_hello(struct ceph_auth_client *ac, void *buf, size_t len)
lenp = p;
p += sizeof(u32);
+ ceph_decode_need(&p, end, 1 + sizeof(u32), bad);
+ ceph_encode_8(&p, 1);
num = ARRAY_SIZE(supported_protocols);
ceph_encode_32(&p, num);
+ ceph_decode_need(&p, end, num * sizeof(u32), bad);
for (i = 0; i < num; i++)
ceph_encode_32(&p, supported_protocols[i]);
diff --git a/fs/ceph/auth_none.c b/fs/ceph/auth_none.c
index 631017eb7117..b4ef6f0a6c85 100644
--- a/fs/ceph/auth_none.c
+++ b/fs/ceph/auth_none.c
@@ -62,6 +62,7 @@ static int ceph_auth_none_create_authorizer(
if (!ai->built_authorizer) {
p = au->buf;
end = p + sizeof(au->buf);
+ ceph_encode_8(&p, 1);
ret = ceph_entity_name_encode(ac->name, &p, end - 8);
if (ret < 0)
goto bad;