[PATCH 2/3] use ckpt_err in ckpt_obj_fetch()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Serge E. Hallyn <serue@xxxxxxxxxx>

Signed-off-by: Serge E. Hallyn <serue@xxxxxxxxxx>
---
 checkpoint/objhash.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/checkpoint/objhash.c b/checkpoint/objhash.c
index 9b1b2f4..1f7ce0e 100644
--- a/checkpoint/objhash.c
+++ b/checkpoint/objhash.c
@@ -1004,8 +1004,14 @@ void *ckpt_obj_fetch(struct ckpt_ctx *ctx, int objref, enum obj_type type)
 	struct ckpt_obj *obj;
 
 	obj = obj_find_by_objref(ctx, objref);
-	if (!obj)
+	if (!obj) {
+		ckpt_err(ctx, -EINVAL, "%(O)No such object\n", objref);
 		return ERR_PTR(-EINVAL);
+	}
 	ckpt_debug("%s ref %d\n", obj->ops->obj_name, obj->objref);
-	return (obj->ops->obj_type == type ? obj->ptr : ERR_PTR(-ENOMSG));
+	if (obj->ops->obj_type == type)
+		return obj->ptr;
+	ckpt_err(ctx, -ENOMSG, "%(O)Hashed objed was type %d, not %d\n",
+		 objref, obj->ops->obj_type, type);
+	return ERR_PTR(-ENOMSG);
 }
-- 
1.6.1

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

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux