aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 8dcfb77678de..1c462f895c98 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -694,10 +694,8 @@ static void uncache_state(struct extent_state **cached_ptr)
694{ 694{
695 if (cached_ptr && (*cached_ptr)) { 695 if (cached_ptr && (*cached_ptr)) {
696 struct extent_state *state = *cached_ptr; 696 struct extent_state *state = *cached_ptr;
697 if (state->state & (EXTENT_IOBITS | EXTENT_BOUNDARY)) { 697 *cached_ptr = NULL;
698 *cached_ptr = NULL; 698 free_extent_state(state);
699 free_extent_state(state);
700 }
701 } 699 }
702} 700}
703 701
@@ -1764,7 +1762,7 @@ static void end_bio_extent_readpage(struct bio *bio, int err)
1764 1762
1765 spin_lock(&tree->lock); 1763 spin_lock(&tree->lock);
1766 state = find_first_extent_bit_state(tree, start, 0); 1764 state = find_first_extent_bit_state(tree, start, 0);
1767 if (state) { 1765 if (state && state->start == start) {
1768 /* 1766 /*
1769 * take a reference on the state, unlock will drop 1767 * take a reference on the state, unlock will drop
1770 * the ref 1768 * the ref