summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/cluster/afr/src/afr-common.c20
1 files changed, 11 insertions, 9 deletions
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);