]> bbs.cooldavid.org Git - net-next-2.6.git/commit
Fix race with shared tag queue maps
authorJens Axboe <jens.axboe@oracle.com>
Thu, 13 Sep 2007 12:26:53 +0000 (14:26 +0200)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 13 Sep 2007 15:20:25 +0000 (08:20 -0700)
commitf3da54ba140c6427fa4a32913e1bf406f41b5dda
treee39f3c21a06abbf23944e03fc5ec422fc434fc00
parent9ca2152e173554e7ffb7919dc4916a7c61f8be1a
Fix race with shared tag queue maps

There's a race condition in blk_queue_end_tag() for shared tag maps,
users include stex (promise supertrak thingy) and qla2xxx.  The former
at least has reported bugs in this area, not sure why we haven't seen
any for the latter.  It could be because the window is narrow and that
other conditions in the qla2xxx code hide this.  It's a real bug,
though, as the stex smp users can attest.

We need to ensure two things - the tag bit clearing needs to happen
AFTER we cleared the tag pointer, as the tag bit clearing/setting is
what protects this map.  Secondly, we need to ensure that the visibility
of the tag pointer and tag bit clear are ordered properly.

[ I removed the SMP barriers - "test_and_clear_bit()" already implies
  all the required barriers.  -- Linus ]

Also see http://bugzilla.kernel.org/show_bug.cgi?id=7842

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
block/ll_rw_blk.c