提交 a464adeb 编写于 作者: Z Zach Brown 提交者: Linus Torvalds

[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: NZach Brown <zach.brown@oracle.com>
Acked-by: NBenjamin LaHaise <bcrl@linux.intel.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 8ac2120d
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册