[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080623125348.3133b30b@infradead.org>
Date: Mon, 23 Jun 2008 12:53:48 -0700
From: Arjan van de Ven <arjan@...radead.org>
To: Marcin Slusarz <marcin.slusarz@...il.com>
Cc: mchehab@...radead.org, linux-kernel@...r.kernel.org,
Al Viro <viro@....linux.org.uk>
Subject: Re: [PATCH] Fix open/close race in saa7134
On Mon, 23 Jun 2008 21:22:03 +0200
Marcin Slusarz <marcin.slusarz@...il.com> wrote:
>
> If dev->empress_users could be > 1 then ok - it could break, but it
> can only be 1 or 0. If it's 1 you won't open the device. If it's 0
> you won't reach ts_close.
>
> If you still see the race, please show me the sequence, because I
> don't (of course when decrementing is the last operation of ts_close).
a decrement in C, without locking, is NOT atomic.
It in fact is
"load variable into register"
"increment register value"
"write register to variable"
which the compiler then takes and orders for maximum performance....
--
If you want to reach me at my work email, use arjan@...ux.intel.com
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists