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)
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

Simple merge