]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] aio: don't ref kioctx after decref in put_ioctx
authorZach Brown <zach.brown@oracle.com>
Mon, 14 Nov 2005 00:07:35 +0000 (16:07 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 14 Nov 2005 02:14:16 +0000 (18:14 -0800)
commit3ea924dbad6e08be059fc60ca29a89b28e70f8f6
tree8431e60b0f5ebb4f22b0f4bffbc6f0ebb0faf601
parent3d742e5a2a1d25a874223f4ef00961675ceed30e
[PATCH] aio: don't ref kioctx after decref in put_ioctx

put_ioctx's refcount debugging was doing an atomic_read after dropping its
reference when it wasn't the last ref, leaving a tiny race for another freeing
thread to sneak into.  This shifts the debugging before the ops, uses BUG_ON,
and reformats the defines a little.  Sadly, moving to inlines increased the
code size but this change decreases the code size by a whole 9 bytes :)

Signed-off-by: Zach Brown <zach.brown@oracle.com>
Cc: Benjamin LaHaise <bcrl@kvack.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/aio.h