Skip to content

Commit

Permalink
Btrfs: loop waiting on writeback
Browse files Browse the repository at this point in the history
lock_extent_buffer_for_io needs to loop around and make sure the
writeback bits are not set.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason committed Mar 26, 2012
1 parent cfed81a commit a098d8e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -3010,12 +3010,12 @@ static int lock_extent_buffer_for_io(struct extent_buffer *eb,
flush_write_bio(epd);
flush = 1;
}
wait_on_extent_buffer_writeback(eb);
btrfs_tree_lock(eb);
if (test_bit(EXTENT_BUFFER_WRITEBACK, &eb->bflags)) {
printk(KERN_ERR "Um, ok?\n");
while (1) {
wait_on_extent_buffer_writeback(eb);
btrfs_tree_lock(eb);
if (!test_bit(EXTENT_BUFFER_WRITEBACK, &eb->bflags))
break;
btrfs_tree_unlock(eb);
return 0;
}
}

Expand Down

0 comments on commit a098d8e

Please sign in to comment.