]> git.hungrycats.org Git - linux/commitdiff
zygo: apply for_zygo.patch from fdmanana
authorZygo Blaxell <zblaxell@thirteen.furryterror.org>
Mon, 25 May 2015 14:14:02 +0000 (10:14 -0400)
committerZygo Blaxell <zblaxell@thirteen.furryterror.org>
Mon, 25 May 2015 14:14:02 +0000 (10:14 -0400)
Hi Zygo,

So I was able to make this more easy to reproduce here using different
qemu/kvm, and I believe I found the reason and a fix. Can you help
test the following patch (added as an attachment)? I'll give it some
more testing and after getting feedback from you too I'll add a
changelog and submit it properly. Thanks!

fs/btrfs/inode.c

index 8bb013672aee061e81eb03fcba6d51db9cd169af..200bea7aac631ecc58975bd22925ce737aaee50e 100644 (file)
@@ -4988,22 +4988,15 @@ static void evict_inode_truncate_pages(struct inode *inode)
 
        spin_lock(&io_tree->lock);
        while (!RB_EMPTY_ROOT(&io_tree->state)) {
-               struct extent_state *state;
                struct extent_state *cached_state = NULL;
 
-               node = rb_first(&io_tree->state);
-               state = rb_entry(node, struct extent_state, rb_node);
-               atomic_inc(&state->refs);
                spin_unlock(&io_tree->lock);
-
-               lock_extent_bits(io_tree, state->start, state->end,
-                                0, &cached_state);
-               clear_extent_bit(io_tree, state->start, state->end,
+               lock_extent_bits(io_tree, 0, (u64)-1, 0, &cached_state);
+               clear_extent_bit(io_tree, 0, (u64)-1,
                                 EXTENT_LOCKED | EXTENT_DIRTY |
                                 EXTENT_DELALLOC | EXTENT_DO_ACCOUNTING |
                                 EXTENT_DEFRAG, 1, 1,
                                 &cached_state, GFP_NOFS);
-               free_extent_state(state);
 
                cond_resched();
                spin_lock(&io_tree->lock);