From c7154b84118b4b2ff25083d9be48aeee25a0294b Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Thu, 3 Sep 2020 19:21:16 +0530 Subject: 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 --- xlators/features/index/src/index.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index 4ece7ff6fc8..f674f0b7b64 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); -- cgit