Bug 1428049

Summary: dict_t: make dict_t a real dictionary
Product: [Community] GlusterFS Reporter: Vijay Bellur <vbellur>
Component: coreAssignee: bugs <bugs>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: mainlineCC: atumball, bugs
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-04-17 11:45:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vijay Bellur 2017-03-01 19:04:42 UTC
dict_t: make dict_t a real dictionary

Summary:
- During testing, I found dict_t actually always has a hash_size
of 1. So basically it's not a dictionary. It's list. This diff fixed that problem.
A bug in dictionary is also fixed here. SuperFastHash generates
uint32_t, but it was assigned to a int, which could suffer from
overflow. Previously the hash_size is always 1, so the bug was not triggered.
Under new hash_size, it's easy to trigger that bug.

- For existing GlusterFS codebase, dict_new need to be calling dict_t
*get_new_dict_full (uint32_t size_hint) to use the new logic. An
estimated number of items you are going to insert into the dictionary
is the input for that function.

- This is a port of D3736252 to 3.8

Test Plan: Prove tests

Reviewed By: kvigor

Signed-off-by: Shreyas Siravara <sshreyas>

Change-Id: Ic760eabed82e58881076acbaa46a295dc23e0634
Reviewed-on: http://review.gluster.org/16061
Tested-by: Shreyas Siravara <sshreyas>
Smoke: Gluster Build System <jenkins.org>
NetBSD-regression: NetBSD Build System <jenkins.org>
CentOS-regression: Gluster Build System <jenkins.org>
Reviewed-by: Kevin Vigor <kvigor>

Comment 1 Worker Ant 2017-03-02 20:10:15 UTC
REVIEW: https://review.gluster.org/16830 (dict_t: make dict_t a real dictionary) posted (#1) for review on master by Vijay Bellur (vbellur)

Comment 2 Yaniv Kaul 2019-04-17 11:45:25 UTC
Merged long time ago.