diff options
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r-- | fs/btrfs/extent_io.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 88322684be6a..21597bea21fd 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -1025,7 +1025,8 @@ u64 find_lock_delalloc_range(struct extent_io_tree *tree, | |||
1025 | search_again: | 1025 | search_again: |
1026 | node = tree_search(tree, cur_start); | 1026 | node = tree_search(tree, cur_start); |
1027 | if (!node) { | 1027 | if (!node) { |
1028 | *end = (u64)-1; | 1028 | if (!found) |
1029 | *end = (u64)-1; | ||
1029 | goto out; | 1030 | goto out; |
1030 | } | 1031 | } |
1031 | 1032 | ||
@@ -1540,6 +1541,8 @@ static int end_bio_extent_readpage(struct bio *bio, | |||
1540 | start, end, state); | 1541 | start, end, state); |
1541 | if (ret == 0) { | 1542 | if (ret == 0) { |
1542 | state = NULL; | 1543 | state = NULL; |
1544 | uptodate = | ||
1545 | test_bit(BIO_UPTODATE, &bio->bi_flags); | ||
1543 | continue; | 1546 | continue; |
1544 | } | 1547 | } |
1545 | } | 1548 | } |
@@ -1555,10 +1558,11 @@ static int end_bio_extent_readpage(struct bio *bio, | |||
1555 | !(state->state & EXTENT_LOCKED)) | 1558 | !(state->state & EXTENT_LOCKED)) |
1556 | state = NULL; | 1559 | state = NULL; |
1557 | } | 1560 | } |
1558 | if (!state && uptodate) { | 1561 | if (!state) { |
1559 | spin_unlock_irqrestore(&tree->lock, flags); | 1562 | spin_unlock_irqrestore(&tree->lock, flags); |
1560 | set_extent_uptodate(tree, start, end, | 1563 | if (uptodate) |
1561 | GFP_ATOMIC); | 1564 | set_extent_uptodate(tree, start, end, |
1565 | GFP_ATOMIC); | ||
1562 | unlock_extent(tree, start, end, GFP_ATOMIC); | 1566 | unlock_extent(tree, start, end, GFP_ATOMIC); |
1563 | goto next_io; | 1567 | goto next_io; |
1564 | } | 1568 | } |