]> rtime.felk.cvut.cz Git - linux-imx.git/commit
Btrfs: stop all workers before cleaning up roots
authorJosef Bacik <jbacik@fusionio.com>
Thu, 30 May 2013 20:55:44 +0000 (16:55 -0400)
committerChris Mason <chris.mason@fusionio.com>
Sat, 8 Jun 2013 19:11:35 +0000 (15:11 -0400)
commit13e6c37b989859e70b0d73d3f2cb0aa022159b17
tree20fa0ee3fd51a6b0ea3d1099eed52e8f609eb76f
parent2932505abe7c56477315a3d93ffb3c27c5182e9d
Btrfs: stop all workers before cleaning up roots

Dave reported a panic because the extent_root->commit_root was NULL in the
caching kthread.  That is because we just unset it in free_root_pointers, which
is not the correct thing to do, we have to either wait for the caching kthread
to complete or hold the extent_commit_sem lock so we know the thread has exited.
This patch makes the kthreads all stop first and then we do our cleanup.  This
should fix the race.  Thanks,

Reported-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/disk-io.c