diff options
author | Zach Brown <zach.brown@oracle.com> | 2005-09-16 22:28:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-17 14:50:02 -0400 |
commit | a464adeb7e8f1cd65ca911e20a7c02e452dc2c17 (patch) | |
tree | f55ea0606247dd2fef36905c9ae817060cfae149 /fs | |
parent | 8ac2120d90273c590cf7662f03d103519101685b (diff) |
[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 <zach.brown@oracle.com>
Acked-by: Benjamin LaHaise <bcrl@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/aio.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -562,6 +562,7 @@ static inline void lock_kiocb(struct kiocb *iocb) | |||
562 | static inline void unlock_kiocb(struct kiocb *iocb) | 562 | static inline void unlock_kiocb(struct kiocb *iocb) |
563 | { | 563 | { |
564 | kiocbClearLocked(iocb); | 564 | kiocbClearLocked(iocb); |
565 | smp_mb__after_clear_bit(); | ||
565 | wake_up_bit(&iocb->ki_flags, KIF_LOCKED); | 566 | wake_up_bit(&iocb->ki_flags, KIF_LOCKED); |
566 | } | 567 | } |
567 | 568 | ||