summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohit Agrawal <moagrawa@redhat.com>2020-09-03 19:21:16 +0530
committerMOHIT AGRAWAL <moagrawa@redhat.com>2020-09-04 07:23:09 +0000
commitc7154b84118b4b2ff25083d9be48aeee25a0294b (patch)
tree9a84f27dc7625abafc4a3850a2c367732d7a6fd6
parent5797021ae85b43c4ea1fe2738af728c290b23a39 (diff)
core: Avoid dict OR key is NULL message in brick logs
Problem: At the time of mount a volume server_first_lookup call's syncop_lookup with a NULL xattr so index_lookup is throwing a message at the time of fetching "link-count" from a dictionary Solution: Call dict_get_str_sizen instead of calling dict_get_str to avoid a warning message Fixes: #1464 Change-Id: I2b1ee3123ab817fa09f3abe39998c0d66ac0b824 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
-rw-r--r--xlators/features/index/src/index.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c
index 4ece7ff..f674f0b 100644
--- a/xlators/features/index/src/index.c
+++ b/xlators/features/index/src/index.c
@@ -2104,7 +2104,7 @@ index_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req)
worker_enqueue(this, stub);
return 0;
normal:
- ret = dict_get_str(xattr_req, "link-count", &flag);
+ ret = dict_get_str_sizen(xattr_req, "link-count", &flag);
if ((ret == 0) && (strcmp(flag, GF_XATTROP_INDEX_COUNT) == 0)) {
STACK_WIND(frame, index_lookup_cbk, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->lookup, loc, xattr_req);