]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: prevent list corruption during free space cache processing
authorChris Mason <clm@fb.com>
Fri, 24 Apr 2015 18:00:00 +0000 (11:00 -0700)
committerChris Mason <clm@fb.com>
Fri, 24 Apr 2015 18:52:25 +0000 (11:52 -0700)
commite277124b506528fe5cf00bd0bb3817b4c7034362
tree7cec1e92ccfa9fc236190810acb55f025e480d9d
parent95e26b50bb709d4d50ad8f732704756e23693879
Btrfs: prevent list corruption during free space cache processing

__btrfs_write_out_cache is holding the ctl->tree_lock while it prepares
a list of bitmaps to record in the free space cache.  It was dropping
the lock while it worked on other components, which made a window for
free_bitmap() to free the bitmap struct without removing it from the
list.

This changes things to hold the lock the whole time, and also makes sure
we hold the lock during enospc cleanup.

Reported-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/free-space-cache.c