btrfs: Add check to avoid cleanup roots already in fs_info->dead_roots.
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Tue, 22 Apr 2014 09:13:51 +0000 (17:13 +0800)
committerChris Mason <clm@fb.com>
Tue, 10 Jun 2014 00:20:35 +0000 (17:20 -0700)
commit65d33fd7a6e4aaf9cd6577555d0b3c18fbefe415
treea4de22a193e48b0adb451ceeec2ad1f91544dde5
parent21c7e75654b77b53a4436bf28496aac11536b6ba
btrfs: Add check to avoid cleanup roots already in fs_info->dead_roots.

Current btrfs_orphan_cleanup will also cleanup roots which is already in
fs_info->dead_roots without protection.
This will have conditional race with fs_info->cleaner_kthread.

This patch will use refs in root->root_item to detect roots in
dead_roots and avoid conflicts.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/disk-io.c