diff options
author | Mohit Agrawal <moagrawa@redhat.com> | 2020-09-03 19:21:16 +0530 |
---|---|---|
committer | MOHIT AGRAWAL <moagrawa@redhat.com> | 2020-09-04 07:23:09 +0000 |
commit | c7154b84118b4b2ff25083d9be48aeee25a0294b (patch) | |
tree | 9a84f27dc7625abafc4a3850a2c367732d7a6fd6 /xlators | |
parent | 5797021ae85b43c4ea1fe2738af728c290b23a39 (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>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/features/index/src/index.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |