Re: [PATCH 2/3] relay: Fix race condition which occurs when readingacross CPUs.

From: Eduard - Gabriel Munteanu
Date: Thu Jun 12 2008 - 19:16:19 EST


On Fri, 13 Jun 2008 00:58:01 +0200 (MEST)
Andrea Righi <righi.andrea@xxxxxxxxx> wrote:

> If you just break here buf->rw_lock will be unlocked twice. Maybe a
> better way is:
> if (desc->error < 0)
> goto out;
> ...
> } while (desc->count && ret);
> spin_unlock_irqrestore(&buf->rw_lock, flags);
> out:
> mutex_unlock(&filp->f_path.dentry->d_inode->i_mutex);
>
> return desc->written;

Thanks, I did not notice. Will fix and resubmit.


Eduard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/