xlators/lib: Handle NULL 'name' for marker xattrs

Change-Id: I18f00b7e92f483673250821c457d1e8be2eef081
BUG: 1200372
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/10015
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
This commit is contained in:
Pranith Kumar K 2015-03-26 21:08:12 +05:30 committed by Vijay Bellur
parent c8a723ac7c
commit d15dedd8c9
2 changed files with 5 additions and 0 deletions

View File

@ -30,6 +30,7 @@ TEST kill_brick $V0 $H0 $B0/${V0}-0
TEST "getfattr -n $xtime $M1 | grep -q ${xtime}="
TEST getfattr -d -m. -e hex $M1
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M1
@ -65,6 +66,7 @@ TEST kill_brick $V0 $H0 $B0/${V0}-0
TEST "getfattr -n $xtime $M1 | grep -q ${xtime}="
TEST getfattr -d -m. -e hex $M1
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M1

View File

@ -458,6 +458,9 @@ cluster_handle_marker_getxattr (call_frame_t *frame, loc_t *loc,
if (GF_CLIENT_PID_GSYNCD != frame->root->pid)
return -EINVAL;
if (name == NULL)
return -EINVAL;
if (strcmp (GF_XATTR_MARKER_KEY, name) == 0) {
type = MARKER_UUID_TYPE;
memcpy (gauge, marker_uuid_default_gauge, sizeof (gauge));