From 2e2bef28f00f505190c21bd42398f6a01268879c Mon Sep 17 00:00:00 2001 From: Mark Vitale Date: Fri, 6 Jun 2014 19:27:04 -0400 Subject: [PATCH] opr: opr_AssertionFailed undefined in kernel module The opr_Assert in opr_rbtree_remove is incompletely defined; the opr_Assert macro is defined in opr.h, but the definition for the opr_AssertionFailed routine it invokes is not included. This allows the kernel module to build successfully even though it retains a hidden undefined reference for opr_AssertionFailed. However, the logic in obr_rbtree_remove ensures that this particular opr_Assert can never fail - it is superfluous. Some compilers (e.g. gcc for Linux AFS kernel module builds) are able to recognize this and optimize it out. Others (e.g. Solaris 5.12) do not, and when this happens the OpenAFS build appears to succeed but the kernel module will fail to load due to the undefined symbol. Remove the superfluous opr_Assert. This partially reverts commit 9f8b765bbdbb8913fcadbde8d3362039e9dc8e61. Change-Id: I4ed2b1873c434e41dce0f2e474926bf8b449b819 Reviewed-on: http://gerrit.openafs.org/11296 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk Reviewed-by: Perry Ruiter Reviewed-by: Jeffrey Altman --- src/opr/rbtree.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/opr/rbtree.c b/src/opr/rbtree.c index 5190739..1236464 100644 --- a/src/opr/rbtree.c +++ b/src/opr/rbtree.c @@ -40,7 +40,6 @@ #else # include #endif -#include #include "rbtree.h" @@ -416,10 +415,8 @@ opr_rbtree_remove(struct opr_rbtree *head, struct opr_rbtree_node *node) if (node->left == NULL) child = node->right; - else { - opr_Assert(node->right == NULL); + else child = node->left; - } child->parent = node->parent; -- 1.9.4