Btrfs: fix list delete warning when removing ordered root from the list
authorMiao Xie <miaox@cn.fujitsu.com>
Thu, 14 Nov 2013 09:33:21 +0000 (17:33 +0800)
committerChris Mason <chris.mason@fusionio.com>
Thu, 21 Nov 2013 01:44:46 +0000 (20:44 -0500)
Commit b02441999efcc6152b87cd58e7970bb7843f76cf "Btrfs: don't wait for
the completion of all the ordered extents" introduced a bug that broke
the ordered root list:
 WARNING: CPU: 1 PID: 7119 at lib/list_debug.c:59 __list_del_entry+0x5a/0x98()

It is because we forgot to return the roots in the splice list to the
ordered list of the fs. Fix it.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/ordered-data.c

index c37124bccf178aacff5c8a6dba776edecec0f994..69582d5b69d1f6064a77a409760a3ba1886b6d92 100644 (file)
@@ -638,6 +638,7 @@ void btrfs_wait_ordered_roots(struct btrfs_fs_info *fs_info, int nr)
                        WARN_ON(nr < 0);
                }
        }
+       list_splice_tail(&splice, &fs_info->ordered_roots);
        spin_unlock(&fs_info->ordered_root_lock);
 }