On Tue, May 08, 2012 at 05:34:25PM +0800, Liu Yuan wrote:
> +     if (!uatomic_add_return(&zk_notify_blocked, 0)
> +             && uatomic_add_return(&nr_zk_levents, 0)) {

Shouldn't these use uatomic_read?

> +             nr_levents = uatomic_sub_return(&nr_zk_levents, 1) + 1;

The combination of a read and an atomic_sub later looks racy to me, what
prevents nr_zk_levents from changing between the two calls?

> +             if (uatomic_add_return(&nr_zk_levents, 0) || rc == ZOK) {

uatomic_read again?

> +     if (uatomic_add_return(&zk_notify_blocked, 0))

here as well.

-- 
sheepdog mailing list
[email protected]
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to