From: Gris Ge <fge@redhat.com>
To: Bart Van Assche <Bart.VanAssche@wdc.com>
Cc: "dm-devel@redhat.com" <dm-devel@redhat.com>
Subject: Re: [PATCH] multipathd daemon: Fix incorrect use of CLOCK_MONOTONIC in pthread
Date: Thu, 10 Aug 2017 00:19:19 +0800 [thread overview]
Message-ID: <20170809161919.GA7163@redhat.com> (raw)
In-Reply-To: <1502290980.2356.1.camel@wdc.com>
[-- Attachment #1.1: Type: text/plain, Size: 913 bytes --]
On Wed, Aug 09, 2017 at 03:03:00PM +0000, Bart Van Assche wrote:
> > diff --git a/multipathd/main.c b/multipathd/main.c
> > index 4be2c579..67997d08 100644
> > --- a/multipathd/main.c
> > +++ b/multipathd/main.c
> > @@ -198,7 +198,7 @@ int set_config_state(enum daemon_status state)
> > if (running_state != DAEMON_IDLE) {
> > struct timespec ts;
> >
> > - clock_gettime(CLOCK_MONOTONIC, &ts);
> > + clock_gettime(CLOCK_REALTIME, &ts);
> > ts.tv_sec += 1;
> > rc = pthread_cond_timedwait(&config_cond,
> > &config_lock, &ts);
>
> But this change looks wrong to me. Have you noticed that
> pthread_condattr_setclock(&attr, CLOCK_MONOTONIC) is used to make
> config_cond use the monotonic clock? See also libmultipath/time-util.c.
>
> Bart.
Hi Bart,
I missed the pthread_cond_init_mono().
Will send V2 patch without this change.
Thanks.
--
Gris Ge
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2017-08-09 16:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-09 13:22 [PATCH] multipathd daemon: Fix incorrect use of CLOCK_MONOTONIC in pthread Gris Ge
2017-08-09 15:03 ` Bart Van Assche
2017-08-09 16:19 ` Gris Ge [this message]
2017-08-09 16:21 ` [PATCH V2] " Gris Ge
2017-08-09 16:25 ` Bart Van Assche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170809161919.GA7163@redhat.com \
--to=fge@redhat.com \
--cc=Bart.VanAssche@wdc.com \
--cc=dm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.