* [Cluster-devel] [PATCH] rgmanager: Fix race in shutdown vs. notification [RHEL6]
@ 2011-08-02 14:50 Lon Hohberger
2011-08-02 15:06 ` Fabio M. Di Nitto
0 siblings, 1 reply; 2+ messages in thread
From: Lon Hohberger @ 2011-08-02 14:50 UTC (permalink / raw)
To: cluster-devel.redhat.com
The check of db prior to taking the mutex was done as a tiny performance
gain in the event that there was no dbus connection, but causes
dbus_connection_get_is_connected() to crash the program if db is NULL.
Resolves: rhbz#697446
Signed-off-by: Lon Hohberger <lhh@redhat.com>
---
rgmanager/src/daemons/update-dbus.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/rgmanager/src/daemons/update-dbus.c b/rgmanager/src/daemons/update-dbus.c
index f465d1d..bff1644 100644
--- a/rgmanager/src/daemons/update-dbus.c
+++ b/rgmanager/src/daemons/update-dbus.c
@@ -149,12 +149,12 @@ _rgm_dbus_notify(const char *svcname,
DBusMessage *msg = NULL;
int ret = -1;
+ pthread_mutex_lock(&mu);
+
if (!db) {
- goto out_free;
+ goto out_unlock;
}
- pthread_mutex_lock(&mu);
-
/* Check to ensure the connection is still valid. If it
* isn't, clean up and shut down the dbus connection.
*
--
1.7.3.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [PATCH] rgmanager: Fix race in shutdown vs. notification [RHEL6]
2011-08-02 14:50 [Cluster-devel] [PATCH] rgmanager: Fix race in shutdown vs. notification [RHEL6] Lon Hohberger
@ 2011-08-02 15:06 ` Fabio M. Di Nitto
0 siblings, 0 replies; 2+ messages in thread
From: Fabio M. Di Nitto @ 2011-08-02 15:06 UTC (permalink / raw)
To: cluster-devel.redhat.com
ACK
Fabio
On 8/2/2011 4:50 PM, Lon Hohberger wrote:
> The check of db prior to taking the mutex was done as a tiny performance
> gain in the event that there was no dbus connection, but causes
> dbus_connection_get_is_connected() to crash the program if db is NULL.
>
> Resolves: rhbz#697446
>
> Signed-off-by: Lon Hohberger <lhh@redhat.com>
> ---
> rgmanager/src/daemons/update-dbus.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/rgmanager/src/daemons/update-dbus.c b/rgmanager/src/daemons/update-dbus.c
> index f465d1d..bff1644 100644
> --- a/rgmanager/src/daemons/update-dbus.c
> +++ b/rgmanager/src/daemons/update-dbus.c
> @@ -149,12 +149,12 @@ _rgm_dbus_notify(const char *svcname,
> DBusMessage *msg = NULL;
> int ret = -1;
>
> + pthread_mutex_lock(&mu);
> +
> if (!db) {
> - goto out_free;
> + goto out_unlock;
> }
>
> - pthread_mutex_lock(&mu);
> -
> /* Check to ensure the connection is still valid. If it
> * isn't, clean up and shut down the dbus connection.
> *
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-08-02 15:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-02 14:50 [Cluster-devel] [PATCH] rgmanager: Fix race in shutdown vs. notification [RHEL6] Lon Hohberger
2011-08-02 15:06 ` Fabio M. Di Nitto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).