From ff33ea5175b98e0df743ae3af7681fcf1e1e89eb Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Thu, 6 Dec 2012 16:46:57 +0530 Subject: rpcsvc: do a 'iobuf_ref()' on buffer while synctaskizing actor Starting rpc actors using synctask causes rpcsvc to return before the actor actually finishes its actions. This would cause the buffer to be unreffed by socket and be possibly reused, before the actor used it, leading to failures in the actor. This patch makes rpcsvc take a ref on the buffer when synctaskizing the actor and store it in the request structure, and then later unref it when the request structure is destroyed. This makes sure that the buffer is not reused before the actor has finished. Change-Id: I8f81e1fef8f3719db220471d2d8ffb8916958956 BUG: 884452 Signed-off-by: Kaushal M Reviewed-on: http://review.gluster.org/4277 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- tests/bugs/bug-884452.t | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 tests/bugs/bug-884452.t (limited to 'tests/bugs') diff --git a/tests/bugs/bug-884452.t b/tests/bugs/bug-884452.t new file mode 100644 index 00000000..420b4bc8 --- /dev/null +++ b/tests/bugs/bug-884452.t @@ -0,0 +1,47 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc + +cleanup; + +TEST glusterd +TEST pidof glusterd + +TEST $CLI volume create $V0 $H0:$B0/$V0 +TEST $CLI volume start $V0 + +TEST glusterfs -s $H0 --volfile-id $V0 $M0 +TEST touch $M0/{1..10000} + +function ls-loop +{ + while true; do + ls -lR $M0 1>/dev/null 2>&1 + done; +} +ls-loop & +LS_LOOP=$! + +function vol-status-loop +{ + for i in {1..1000}; do + $CLI volume status $V0 clients >/dev/null 2>&1 + if [ $? -ne 0 ]; then + return 1 + fi + done; + + return 0 +} + +TEST vol-status-loop + +kill $LS_LOOP >/dev/null 2>&1 +sleep 2 + +TEST umount $M0 + +cleanup; + + + -- cgit