aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2012-03-21 12:09:56 -0400
committerChris Mason <chris.mason@oracle.com>2012-03-26 17:04:23 -0400
commita098d8e8eec5a46a47b1bb74390746973d913a9c (patch)
treeaa93b224046b29daeca6602176a05c980d58a3c1 /fs
parentcfed81a04eb555f5606d1b6a54bdbabab0ee1ac3 (diff)
downloadlinux-hpc-a098d8e8eec5a46a47b1bb74390746973d913a9c.tar.gz
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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index c1b898d590d70e..b71cc4547d4746 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;
}
}