History

Btrfs: avoid memory leak of extent state in error handling routine

We've forgotten to clear extent states in pinned tree, which will results in space counter mismatch and memory leak: WARNING: at fs/btrfs/extent-tree.c:7537 btrfs_free_block_groups+0x1f3/0x2e0 [btrfs]() ... space_info 2 has 8380416 free, is not full space_info total=12582912, used=4096, pinned=4096, reserved=0, may_use=0, readonly=4194304 btrfs state leak: start 29364224 end 29376511 state 1 in tree ffff880075f20090 refs 1 ...

Liu Bo committed 14 years ago

Commit 6e841e31 parent 4e42ae11 file · +2 −0Browse files

Unified · Split

fs/btrfs/disk-io.c+2−0
@@ -3601,6 +3601,8 @@ void btrfs_cleanup_one_transaction(struct btrfs_transaction *cur_trans, · 3600 unmodified lines
36013601
36023602 btrfs_destroy_marked_extents(root, &cur_trans->dirty_pages,
36033603 EXTENT_DIRTY);
3604+ btrfs_destroy_pinned_extent(root,
3605+ root->fs_info->pinned_extents);
36043606
36053607 /*
36063608 memset(cur_trans, 0, sizeof(*cur_trans));

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t