Re: [Fwd: FIO bug]

From: Jens Axboe <jens.axboe_at_oracle.com>
Date: Mon, 4 Feb 2008 09:23:03 +0100

applied

On Mon, Feb 04 2008, Zhang, Yanmin wrote:
> -------- Forwarded Message --------
> > From: Zhang, Yanmin <yanmin_zhang_at_linux.intel.com>
> > To: Jens Axboe <jens.axboe_at_oracle.com>
> > Subject: FIO bug
> > Date: Sun, 03 Feb 2008 16:49:26 +0800
> >
> > Jens,
> >
> > I tried again to integrate FIO into my automation testing system.
> > Last year, a coulpe of interns fixed a couple of bugs. But I found new
> > bug now.
> >
> > With the attached job file, fio hangs. Basically the sem->cond isn't initiated
> > correctly.
> >
> > Below patch fixes it.
> >
> > Yanmin
> >
> > ---
> >
> > --- fio-1.17.3/mutex.c 2007-03-09 19:39:14.000000000 +0800
> > +++ fio-1.17.3_work/mutex.c 2008-02-03 09:49:51.000000000 +0800
> > @@ -19,6 +19,8 @@ struct fio_sem *fio_sem_init(int value)
> > char sem_name[] = "/tmp/.fio_sem.XXXXXX";
> > struct fio_sem *sem = NULL;
> > pthread_mutexattr_t attr;
> > + pthread_condattr_t cond;
> > +
> > int fd;
> >
> > fd = mkstemp(sem_name);
> > @@ -53,6 +55,11 @@ struct fio_sem *fio_sem_init(int value)
> > perror("pthread_mutexattr_setpshared");
> > goto err;
> > }
> > +
> > + pthread_condattr_init (&cond);
> > + pthread_condattr_setpshared (&cond, PTHREAD_PROCESS_SHARED);
> > + pthread_cond_init (&sem->cond, &cond);
> > +
> > if (pthread_mutex_init(&sem->lock, &attr)) {
> > perror("pthread_mutex_init");
> > goto err;
> >
> >
>
>

-- 
Jens Axboe
Received on Mon Feb 04 2008 - 09:23:03 CET

This archive was generated by hypermail 2.2.0 : Mon Feb 04 2008 - 09:30:01 CET