Commit 3c45e4d6 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] fix wait_on_buffer() debug code

The wait_on_buffer() debug code is generating false warnings when called from
__block_prepare_write().  It is legal to wait on a zero-ref buffer when its
page is locked.  The page lock keeps try_to_free_buffers() away.

This debug code hasn't found any bugs yet.
parent faedca65
......@@ -123,7 +123,8 @@ void __wait_on_buffer(struct buffer_head * bh)
wait_queue_head_t *wqh = bh_waitq_head(bh);
DEFINE_WAIT(wait);
if (atomic_read(&bh->b_count) == 0)
if (atomic_read(&bh->b_count) == 0 &&
(!bh->b_page || !PageLocked(bh->b_page)))
buffer_error();
do {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment