[lkml]   [2005]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[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().

Please apply.

Signed-off-by: Zach Brown <>

Index: 2.6.13-git12-mb-lock-kiocb/fs/aio.c
--- 2.6.13-git12-mb-lock-kiocb.orig/fs/aio.c
+++ 2.6.13-git12-mb-lock-kiocb/fs/aio.c
@@ -562,6 +562,7 @@ static inline void lock_kiocb(struct kio
static inline void unlock_kiocb(struct kiocb *iocb)
+ smp_mb__after_clear_bit();
wake_up_bit(&iocb->ki_flags, KIF_LOCKED);

Signed-off-by: Zach Brown <>
aio.c | 1 +
1 files changed, 1 insertion(+)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at
 \ /
  Last update: 2005-09-13 01:48    [W:0.015 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site