Btrfs: update to use fs_state bit
authorLiu Bo <bo.li.liu@oracle.com>
Mon, 11 Mar 2013 09:20:00 +0000 (09:20 +0000)
committerChris Mason <chris.mason@fusionio.com>
Thu, 21 Mar 2013 23:24:31 +0000 (19:24 -0400)
Now that we use bit operation to check fs_state, update
btrfs_free_fs_root()'s checker, otherwise we get back to
memory leak case.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/disk-io.c

index 7d84651e850b22cb937b29c68d34c1119af1e4a0..127b23e8323b5ad6480ff792589ec63c07c483a3 100644 (file)
@@ -3253,7 +3253,7 @@ void btrfs_free_fs_root(struct btrfs_fs_info *fs_info, struct btrfs_root *root)
        if (btrfs_root_refs(&root->root_item) == 0)
                synchronize_srcu(&fs_info->subvol_srcu);
 
-       if (fs_info->fs_state & BTRFS_SUPER_FLAG_ERROR) {
+       if (test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state)) {
                btrfs_free_log(NULL, root);
                btrfs_free_log_root_tree(NULL, fs_info);
        }