Bug 1608991 - Remove code duplication in socket
Summary: Remove code duplication in socket
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: transport
Version: mainline
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-26 16:23 UTC by Krutika Dhananjay
Modified: 2018-10-23 15:15 UTC (History)
1 user (show)

Fixed In Version: glusterfs-5.0
Clone Of:
Environment:
Last Closed: 2018-10-23 15:15:30 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

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/


Note You need to log in before you can comment on or make changes to this bug.