Dear developers,
in pint-hint.c the hints->type_string may be NULL if the type is known
within PVFS2 (and no arbitrary type).
Maybe I tried to use named and unnamed hints at the same time.
However, in the function PINT_hint_get_value_by_name this condition is
not tested, instead a strcmp is done.
In the attached patch a fix for this issue and the hint encoding is
added (which can be applied to orangefs).
To all developers, have a happy new year,
regards,
Julian
diff --git a/PVFS2/orangefs-2.8.3-20101113/src/common/misc/pint-hint.c b/PVFS2/orangefs-2.8.3-20101113/src/common/misc/pint-hint.c
index 4af324a..6d4bf22 100644
--- a/PVFS2/orangefs-2.8.3-20101113/src/common/misc/pint-hint.c
+++ b/PVFS2/orangefs-2.8.3-20101113/src/common/misc/pint-hint.c
@@ -136,6 +137,7 @@ int PVFS_hint_add_internal(
}
new_hint->length = length;
+ new_hint->type_string = NULL;
new_hint->value = malloc(new_hint->length);
if(!new_hint->value)
{
@@ -242,11 +244,11 @@ int PVFS_hint_add(
free(new_hint);
return -PVFS_ENOMEM;
}
-
memcpy(new_hint->value, value, length);
-
+
if(info)
{
+ new_hint->type_string = NULL;
new_hint->type = info->type;
new_hint->flags = info->flags;
new_hint->encode = info->encode;
@@ -329,7 +331,7 @@ void encode_PINT_hint(char **pptr, const PINT_hint *hint)
}
/* encode the hint using the encode function provided */
- tmp_hint->encode(pptr, tmp_hint->value);
+ tmp_hint->encode(pptr, & tmp_hint->value);
}
tmp_hint = tmp_hint->next;
@@ -564,7 +566,7 @@ void *PINT_hint_get_value_by_name(
while(h)
{
- if(!strcmp(h->type_string, name))
+ if(h->type_string != NULL && !strcmp(h->type_string, name))
{
if(length)
{
_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers