diff options
author | Chris Mason <chris.mason@oracle.com> | 2012-03-21 12:09:56 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2012-03-26 17:04:23 -0400 |
commit | a098d8e8eec5a46a47b1bb74390746973d913a9c (patch) | |
tree | aa93b224046b29daeca6602176a05c980d58a3c1 /fs | |
parent | cfed81a04eb555f5606d1b6a54bdbabab0ee1ac3 (diff) | |
download | linux-a098d8e8eec5a46a47b1bb74390746973d913a9c.tar.bz2 |
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: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/extent_io.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index c1b898d590d7..b71cc4547d47 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -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; } } |