summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2015-02-25 15:49:11 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-02-27 21:16:11 -0800
commitb117d4d84becd25ef79c049ebf9b8ec6c4abca88 (patch)
tree3e989a4fc35b10a6179d63032960be9bfe10d657 /libglusterfs/src
parenta0f30e637e6ee32b113fd21268be17e0618d39df (diff)
socket: allow only one epoll thread to read msg fragments
__socket_read_reply function releases sock priv->lock briefly for notifying higher layers of message's xid. This could result in other epoll threads that are processing events on this socket to read further fragments of the same message. This may lead to incorrect fragment processing and result in a crash. Change-Id: I915665b2e54ca16f2ad65970e51bf76c65d954a4 BUG: 1197118 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Signed-off-by: Shyam <srangana@redhat.com> Reviewed-on: http://review.gluster.org/9742 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'libglusterfs/src')
-rw-r--r--libglusterfs/src/event-epoll.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libglusterfs/src/event-epoll.c b/libglusterfs/src/event-epoll.c
index 8d42fa71fb6..a8e9a08b93d 100644
--- a/libglusterfs/src/event-epoll.c
+++ b/libglusterfs/src/event-epoll.c
@@ -573,9 +573,11 @@ pre_unlock:
thread calling event_select_on_epoll() while this
thread was busy in handler()
*/
- event->events = slot->events;
- ret = epoll_ctl (event_pool->fd, EPOLL_CTL_MOD,
- fd, event);
+ if (slot->in_handler == 0) {
+ event->events = slot->events;
+ ret = epoll_ctl (event_pool->fd, EPOLL_CTL_MOD,
+ fd, event);
+ }
}
post_unlock:
UNLOCK (&slot->lock);