Commit a098d8e8 authored by Chris Mason's avatar Chris Mason

Btrfs: loop waiting on writeback

lock_extent_buffer_for_io needs to loop around and make sure the
writeback bits are not set.
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent cfed81a0
...@@ -3010,12 +3010,12 @@ static int lock_extent_buffer_for_io(struct extent_buffer *eb, ...@@ -3010,12 +3010,12 @@ static int lock_extent_buffer_for_io(struct extent_buffer *eb,
flush_write_bio(epd); flush_write_bio(epd);
flush = 1; flush = 1;
} }
wait_on_extent_buffer_writeback(eb); while (1) {
btrfs_tree_lock(eb); wait_on_extent_buffer_writeback(eb);
if (test_bit(EXTENT_BUFFER_WRITEBACK, &eb->bflags)) { btrfs_tree_lock(eb);
printk(KERN_ERR "Um, ok?\n"); if (!test_bit(EXTENT_BUFFER_WRITEBACK, &eb->bflags))
break;
btrfs_tree_unlock(eb); btrfs_tree_unlock(eb);
return 0;
} }
} }
......
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