qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/3] Add helper functions to enable virtio-9p ma


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 3/3] Add helper functions to enable virtio-9p make use of the threadlets
Date: Wed, 10 Nov 2010 13:54:50 +0000

On Wed, Nov 10, 2010 at 1:19 PM, Arun R Bharadwaj
<address@hidden> wrote:
> +static void v9fs_process_post_ops(void *arg)
> +{
> +    int count = 0;
> +    struct V9fsPostOp *post_op;
> +    int ret;
> +    char byte;
> +
> +    qemu_mutex_lock(&v9fs_async_struct.lock);

I don't think it is necessary to lock across rfd/wfd read()/write().
rfd/wfd are never changed once v9fs_async_struct has been set up.

Only post_op_list needs to be protected.

> +    do {
> +        ret = read(v9fs_async_struct.rfd, &byte, sizeof(byte));
> +    } while (ret > 1 || (ret == -1 && errno == EINTR));

ret > 1 looks like a typo, should be ret > 0.  sizeof(byte) == 1 means
ret > 1 is impossible.

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]