From: Zach Brown Date: Sat, 17 Sep 2005 02:28:09 +0000 (-0700) Subject: [PATCH] Add smp_mb__after_clear_bit() to unlock_kiocb() X-Git-Tag: v2.6.14-rc2~5^2~21 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=a464adeb7e8f1cd65ca911e20a7c02e452dc2c17;p=linux-2.6-omap-h63xx.git [PATCH] Add smp_mb__after_clear_bit() to unlock_kiocb() Add smp_mb__after_clear_bit() to unlock_kiocb() AIO's use of wait_on_bit_lock()/wake_up_bit() forgot to add a barrier between clearing its lock bit and calling wake_up_bit() so wake_up_bit()'s unlocked waitqueue_active() can race. This puts AIO's use in line with the others and the comment above wake_up_bit(). Signed-off-by: Zach Brown Acked-by: Benjamin LaHaise Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/aio.c b/fs/aio.c index 38f62680fd6..0e11e31dbb7 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -562,6 +562,7 @@ static inline void lock_kiocb(struct kiocb *iocb) static inline void unlock_kiocb(struct kiocb *iocb) { kiocbClearLocked(iocb); + smp_mb__after_clear_bit(); wake_up_bit(&iocb->ki_flags, KIF_LOCKED); }