Bug 1608991

Summary: Remove code duplication in socket
Product: [Community] GlusterFS Reporter: Krutika Dhananjay <kdhananj>
Component: transportAssignee: bugs <bugs>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: mainlineCC: bugs
Target Milestone: ---Keywords: CodeChange, Improvement, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-5.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-23 15:15:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Krutika Dhananjay 2018-07-26 16:23:39 UTC
Description of problem:

While I was reading code, I saw that socket_submit_request() and socket_submit_reply() are identical except for @a_byte and
the source of @msg object being different.


Check https://github.com/gluster/glusterfs/blob/2836e158f38eb9ed070de88b64a3a8758cd2d4c0/rpc/rpc-transport/socket/src/socket.c#L3741 and https://github.com/gluster/glusterfs/blob/2836e158f38eb9ed070de88b64a3a8758cd2d4c0/rpc/rpc-transport/socket/src/socket.c#L3815 and spot the difference yourself!

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Worker Ant 2018-07-26 16:25:15 UTC
REVIEW: https://review.gluster.org/20571 (socket: Remove code duplication) posted (#1) for review on master by Krutika Dhananjay

Comment 2 Worker Ant 2018-08-02 02:59:03 UTC
COMMIT: https://review.gluster.org/20571 committed in master by "Raghavendra G" <rgowdapp> with a commit message- socket: Remove code duplication

While I was reading code, I saw that socket_submit_request()
and socket_submit_reply() are identical except for @a_byte and
the source of @msg object being different.

This patch moves all of the common code to a new function with
the differing vars passed as parameters by the callers.

Change-Id: I7a62ae72f10c34dc8de01b250d89a77ec5ab490d
fixes: bz#1608991
Signed-off-by: Krutika Dhananjay <kdhananj>

Comment 3 Shyamsundar 2018-10-23 15:15:30 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-5.0, please open a new bug report.

glusterfs-5.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] https://lists.gluster.org/pipermail/announce/2018-October/000115.html
[2] https://www.gluster.org/pipermail/gluster-users/