Skip to content

Commit 452e62b

Browse files
Liu Bomasoncl
authored andcommitted
Btrfs: clear EXTENT_DEFRAG bits in finish_ordered_io
Before this, we use 'filled' mode here, ie. if all range has been filled with EXTENT_DEFRAG bits, get to clear it, but if the defrag range joins the adjacent delalloc range, then we'll have EXTENT_DEFRAG bits in extent_state until releasing this inode's pages, and that prevents extent_data from being freed. This clears the bit if any was found within the ordered extent. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Chris Mason <clm@fb.com>
1 parent 286b92f commit 452e62b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2952,7 +2952,7 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent)
29522952

29532953
ret = test_range_bit(io_tree, ordered_extent->file_offset,
29542954
ordered_extent->file_offset + ordered_extent->len - 1,
2955-
EXTENT_DEFRAG, 1, cached_state);
2955+
EXTENT_DEFRAG, 0, cached_state);
29562956
if (ret) {
29572957
u64 last_snapshot = btrfs_root_last_snapshot(&root->root_item);
29582958
if (0 && last_snapshot >= BTRFS_I(inode)->generation)

0 commit comments

Comments
 (0)