Skip to content

Commit

Permalink
Btrfs: fix free space cache leak
Browse files Browse the repository at this point in the history
The free space caching code was recently reworked to
cache all the pages it needed instead of using find_get_page everywhere.

One loop was missed though, so it ended up leaking pages.  This fixes
it to use our page array instead of find_get_page.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason committed Apr 18, 2011
1 parent 6d74119 commit f65647c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/free-space-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ int btrfs_write_out_cache(struct btrfs_root *root,
out_of_space = true;
break;
}
page = find_get_page(inode->i_mapping, index);
page = pages[index];

addr = kmap(page);
memcpy(addr, entry->bitmap, PAGE_CACHE_SIZE);
Expand Down

0 comments on commit f65647c

Please sign in to comment.