From: Chris Mason Date: Wed, 21 Mar 2012 16:09:56 +0000 (-0400) Subject: Btrfs: loop waiting on writeback X-Git-Tag: v3.4-rc3~11^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a098d8e8eec5a46a47b1bb74390746973d913a9c;p=profile%2Fcommon%2Fkernel-common.git 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 --- diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index c1b898d..b71cc45 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; } }