Bug 764902 (GLUSTER-3170)

Summary: Uninitialized mutex and cond in io-threads
Product: [Community] GlusterFS Reporter: Anand Avati <aavati>
Component: io-threadsAssignee: shishir gowda <sgowda>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: mainlineCC: chrisw, gluster-bugs, nsathyan, rahulcs
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: RTNR Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Anand Avati 2011-07-14 16:30:40 UTC
Shishir, please submit this as a git patch with acknowledgments to Emmanuel in the commit log

--

Emmanuel Dreyfus <manu> wrote:

> It seems there have been some refactoring of xlatorx/io-threads since 3.1.
> It does not use sem_timedwait() anymore, that was replaced by
> pthread_cond_timedwait().

Here is the fix. You were quite lucky that Linux managed to get it
working.

--- xlators/performance/io-threads/src/io-threads.c.orig
+++ xlators/performance/io-threads/src/io-threads.c
@@ -2181,8 +2181,20 @@
                        "out of memory");
                goto out;
        }

+       if ((ret = pthread_cond_init(&conf->cond, NULL)) != 0) {
+                gf_log (this->name, GF_LOG_ERROR,
+                        "pthread_cond_init failed (%d)", ret);
+                goto out;
+       }
+
+       if ((ret = pthread_mutex_init(&conf->mutex, NULL)) != 0) {
+                gf_log (this->name, GF_LOG_ERROR,
+                        "pthread_mutex_init failed (%d)", ret);
+                goto out;
+       }
+
        set_stack_size (conf);

        thread_count = IOT_DEFAULT_THREADS;



--
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu

Comment 1 Anand Avati 2011-07-17 11:44:58 UTC
PATCH: http://patches.gluster.com/patch/7929 in master (io-threads: Initialize mutex and cond)

Comment 2 Anand Avati 2011-07-17 11:46:17 UTC
PATCH: http://patches.gluster.com/patch/7932 in release-3.1 (io-threads: Initialize mutex and cond)

Comment 3 Anand Avati 2011-07-17 11:47:31 UTC
PATCH: http://patches.gluster.com/patch/7930 in release-3.2 (io-threads: Initialize mutex and cond)

Comment 4 Rahul C S 2011-07-29 07:56:39 UTC
Verified bug as code change has appeared on master/3.1/3.2