[Devel] [RFC user-cr PATCH] mktree: handle CKPT_HDR_LSM_INFO header type

Serge E. Hallyn serue at us.ibm.com
Thu Sep 3 15:37:34 PDT 2009


[ This patch is against the userspace c/r code at
git://git.ncl.cs.columbia.edu/pub/git/user-cr.git ]

This is a variable length buffer type intended to contain
LSM-specific version information, for instance a policy
version number of sha1sum of the policy.

Signed-off-by: Serge E. Hallyn <serue at us.ibm.com>
---
 mktree.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/mktree.c b/mktree.c
index a9fb9c4..3785ebc 100644
--- a/mktree.c
+++ b/mktree.c
@@ -1751,6 +1751,11 @@ static int ckpt_read_header(struct ckpt_ctx *ctx)
 	if (ret < 0)
 		return ret;
 
+	ptr += ((struct ckpt_hdr *) ptr)->len;
+	ret = ckpt_read_obj_type(ctx, ptr, 200, CKPT_HDR_LSM_INFO);
+	if (ret < 0)
+		return ret;
+
 	/* FIXME: skip version validation for now */
 
 	return 0;
@@ -1833,6 +1838,11 @@ static int ckpt_write_header(struct ckpt_ctx *ctx)
 		return ret;
 	ptr += ((struct ckpt_hdr *) ptr)->len;
 	ret = ckpt_write_obj(ctx, (struct ckpt_hdr *) ptr);
+	if (ret < 0)
+		return ret;
+
+	ptr += ((struct ckpt_hdr *) ptr)->len;
+	ret = ckpt_write_obj(ctx, (struct ckpt_hdr *) ptr);
 
 	return ret;
 }
-- 
1.6.1.1

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list