|
@@ -5268,11 +5268,13 @@ static void evict_inode_truncate_pages(struct inode *inode)
|
|
struct extent_state *cached_state = NULL;
|
|
struct extent_state *cached_state = NULL;
|
|
u64 start;
|
|
u64 start;
|
|
u64 end;
|
|
u64 end;
|
|
|
|
+ unsigned state_flags;
|
|
|
|
|
|
node = rb_first(&io_tree->state);
|
|
node = rb_first(&io_tree->state);
|
|
state = rb_entry(node, struct extent_state, rb_node);
|
|
state = rb_entry(node, struct extent_state, rb_node);
|
|
start = state->start;
|
|
start = state->start;
|
|
end = state->end;
|
|
end = state->end;
|
|
|
|
+ state_flags = state->state;
|
|
spin_unlock(&io_tree->lock);
|
|
spin_unlock(&io_tree->lock);
|
|
|
|
|
|
lock_extent_bits(io_tree, start, end, &cached_state);
|
|
lock_extent_bits(io_tree, start, end, &cached_state);
|
|
@@ -5285,7 +5287,7 @@ static void evict_inode_truncate_pages(struct inode *inode)
|
|
*
|
|
*
|
|
* Note, end is the bytenr of last byte, so we need + 1 here.
|
|
* Note, end is the bytenr of last byte, so we need + 1 here.
|
|
*/
|
|
*/
|
|
- if (state->state & EXTENT_DELALLOC)
|
|
|
|
|
|
+ if (state_flags & EXTENT_DELALLOC)
|
|
btrfs_qgroup_free_data(inode, NULL, start, end - start + 1);
|
|
btrfs_qgroup_free_data(inode, NULL, start, end - start + 1);
|
|
|
|
|
|
clear_extent_bit(io_tree, start, end,
|
|
clear_extent_bit(io_tree, start, end,
|