Skip to content

Commit

Permalink
[PATCH] Add smp_mb__after_clear_bit() to unlock_kiocb()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Zach Brown authored and Linus Torvalds committed Sep 17, 2005
1 parent 8ac2120 commit a464ade
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit a464ade

Please sign in to comment.