lkml.org 
[lkml]   [2005]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[Patch] Add smp_mb__after_clear_bit() to unlock_kiocb()
Date
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 <zach.brown@oracle.com>

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)
{
kiocbClearLocked(iocb);
+ smp_mb__after_clear_bit();
wake_up_bit(&iocb->ki_flags, KIF_LOCKED);
}

Signed-off-by: Zach Brown <zach.brown@oracle.com>
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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-09-13 01:48    [W:0.016 / U:0.744 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site