[patch] buffer: memorder fix

From: Nick Piggin
Date: Sat Jan 20 2007 - 02:06:17 EST



Anyone mind telling me why unlock_buffer, unlike unlock_page, thinks it can
clear the lock without ensuring the critical section is closed (ie. with a
barrier)?

Signed-off-by: Nick Piggin <npiggin@xxxxxxx>

Index: linux-2.6/fs/buffer.c
===================================================================
--- linux-2.6.orig/fs/buffer.c
+++ linux-2.6/fs/buffer.c
@@ -78,6 +78,7 @@ EXPORT_SYMBOL(__lock_buffer);

void fastcall unlock_buffer(struct buffer_head *bh)
{
+ smp_mb__before_clear_bit();
clear_buffer_locked(bh);
smp_mb__after_clear_bit();
wake_up_bit(&bh->b_state, BH_Lock);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/