From a1ece79c84c0306d38cb42cfa947dbc387af3ad0 Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Mon, 29 Jul 2013 11:18:49 -0400 Subject: performance/io-threads: fix potential use after free crash do_iot_schedule() enqueues the stub and kicks the worker thread. The stub is eventually destroyed after it has been resumed and thus unsafe to access after being enqueued. Though likely difficult to reproduce in a real deployment, a crash is reproducible by running a smallfile benchmark on a replica 2 volume on a single vm. Reorder the debug log message prior to the do_iot_schedule() call to avoid the crash. BUG: 989579 Change-Id: Ifc6502c02ae455c959a90ff1ca62a690e31ceafb Signed-off-by: Brian Foster Reviewed-on: http://review.gluster.org/5418 Reviewed-by: Santosh Pradhan Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/performance/io-threads/src/io-threads.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/performance') diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index c6bdc3754..d9a218780 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -323,9 +323,9 @@ iot_schedule (call_frame_t *frame, xlator_t *this, call_stub_t *stub) break; } out: - ret = do_iot_schedule (this->private, stub, pri); gf_log (this->name, GF_LOG_DEBUG, "%s scheduled as %s fop", gf_fop_list[stub->fop], iot_get_pri_meaning (pri)); + ret = do_iot_schedule (this->private, stub, pri); return ret; } -- cgit