From 2a2f1130689d388f26b41f5df3e0bf572e0addb5 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Fri, 29 Aug 2014 10:42:02 +0000 Subject: glusterfs: allow setxattr of keys with null values. Disk based file systems allow to get/set extended attribute key-value pairs where value can be null. Fuse/libgfapi clients must be able to do the same on a gluster volume. Change-Id: Ifc11134cc07f1a3ede43f9d027554dcd10b5c930 BUG: 1135514 Signed-off-by: Ravishankar N Reviewed-on: http://review.gluster.org/8567 Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri Reviewed-by: Jeff Darcy Reviewed-by: Vijay Bellur --- libglusterfs/src/dict.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'libglusterfs/src/dict.c') diff --git a/libglusterfs/src/dict.c b/libglusterfs/src/dict.c index cf4a3ce644c..5062f509940 100644 --- a/libglusterfs/src/dict.c +++ b/libglusterfs/src/dict.c @@ -2452,13 +2452,10 @@ _dict_serialize (dict_t *this, char *buf) buf += keylen; *buf++ = '\0'; - if (!pair->value->data) { - gf_log ("dict", GF_LOG_ERROR, - "pair->value->data is null!"); - goto out; + if (pair->value->data) { + memcpy (buf, pair->value->data, vallen); + buf += vallen; } - memcpy (buf, pair->value->data, vallen); - buf += vallen; pair = pair->next; count--; -- cgit