From 115b4093a44f6e23c28e5a382f82e72ddf73d97c Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Fri, 27 Dec 2013 12:41:58 +0530 Subject: cluster/afr: get virtual-xattrs only on valid xdata. Change-Id: I61fd891435faced25b2bdf617ec07a8af8ef057d BUG: 1046853 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/6605 Tested-by: Gluster Build System Reviewed-by: Ravishankar N Reviewed-by: Vijay Bellur --- xlators/cluster/afr/src/afr-common.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'xlators/cluster/afr/src/afr-common.c') diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index 953df5a67a4..4b39ff6039d 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -2512,17 +2512,19 @@ afr_lookup (call_frame_t *frame, xlator_t *this, /* By default assume ENOTCONN. On success it will be set to 0. */ local->op_errno = ENOTCONN; - ret = dict_get_int32 (xattr_req, "attempt-self-heal", - &local->attempt_self_heal); - dict_del (xattr_req, "attempt-self-heal"); + if (xattr_req) { + ret = dict_get_int32 (xattr_req, "attempt-self-heal", + &local->attempt_self_heal); + dict_del (xattr_req, "attempt-self-heal"); - ret = dict_get_int32 (xattr_req, "foreground-self-heal", - &local->foreground_self_heal); - dict_del (xattr_req, "foreground-self-heal"); + ret = dict_get_int32 (xattr_req, "foreground-self-heal", + &local->foreground_self_heal); + dict_del (xattr_req, "foreground-self-heal"); - ret = dict_get_int32 (xattr_req, "dry-run-self-heal", - &local->self_heal.dry_run); - dict_del (xattr_req, "dry-run-self-heal"); + ret = dict_get_int32 (xattr_req, "dry-run-self-heal", + &local->self_heal.dry_run); + dict_del (xattr_req, "dry-run-self-heal"); + } ret = afr_lookup_xattr_req_prepare (local, this, xattr_req, &local->loc, &gfid_req); -- cgit