[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] posix-aio: don't set aiocb->ret/active outside
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] posix-aio: don't set aiocb->ret/active outside critical section |
Date: |
Tue, 15 May 2012 13:49:37 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 |
Il 15/05/2012 13:34, Kevin Wolf ha scritto:
>> static void qemu_paio_submit(struct qemu_paiocb *aiocb)
>> {
>> + mutex_lock(&lock);
>> aiocb->ret = -EINPROGRESS;
>> aiocb->active = 0;
>> - mutex_lock(&lock);
>> if (idle_threads == 0 && cur_threads < max_threads)
>> spawn_thread();
>> QTAILQ_INSERT_TAIL(&request_list, aiocb, node);
>> mutex_unlock(&lock);
>> cond_signal(&cond);
>> }
>
> This is just silencing coverity, not really fixing a bug, right? aiocb
> is inserted into request_lists only afterwards, and before it is in the
> list, other threads can't find it.
Indeed... I don't like the patch, the access is out of the lock for a
reason.
Paolo