Btrfs: csum_verify_file_block locking fix
authorChris Mason <chris.mason@oracle.com>
Mon, 2 Apr 2007 19:43:21 +0000 (15:43 -0400)
committerDavid Woodhouse <dwmw2@hera.kernel.org>
Mon, 2 Apr 2007 19:43:21 +0000 (15:43 -0400)
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/file-item.c
fs/btrfs/super.c

index a227e94b9e88d0cd07a23c2d4fe197ce2371f262..39b117a57a5476d5fcf5f2f285bf28a9942c246c 100644 (file)
@@ -160,7 +160,6 @@ static int csum_tree_block(struct btrfs_root *root, struct buffer_head *bh,
        int ret;
        struct btrfs_node *node;
 
-       return 0;
        ret = btrfs_csum_data(root, bh->b_data + BTRFS_CSUM_SIZE,
                              bh->b_size - BTRFS_CSUM_SIZE, result);
        if (ret)
index d785b721b461b41398a3cda6b2f873ee51a6ee2c..cd40a08dd8a666af9b0a77bb7e2cf17e16101544 100644 (file)
@@ -249,8 +249,6 @@ static int __free_extent(struct btrfs_trans_handle *trans, struct btrfs_root
                btrfs_set_super_blocks_used(info->disk_super,
                                            super_blocks_used - num_blocks);
                ret = btrfs_del_item(trans, extent_root, path);
-               if (extent_root->fs_info->last_insert.objectid > blocknr)
-                       extent_root->fs_info->last_insert.objectid = blocknr;
                if (ret)
                        BUG();
        }
index e7510ac5559d6bec0a321dd62af711d1256d7a53..2c98b620c5944e25398cb12bbca35be3e47936e3 100644 (file)
@@ -110,6 +110,7 @@ int btrfs_csum_verify_file_block(struct btrfs_root *root,
        file_key.offset = offset;
        file_key.flags = 0;
        btrfs_set_key_type(&file_key, BTRFS_CSUM_ITEM_KEY);
+       mutex_lock(&root->fs_info->fs_mutex);
        ret = btrfs_search_slot(NULL, root, &file_key, path, 0, 0);
        if (ret)
                goto fail;
@@ -123,6 +124,7 @@ int btrfs_csum_verify_file_block(struct btrfs_root *root,
 fail:
        btrfs_release_path(root, path);
        btrfs_free_path(path);
+       mutex_unlock(&root->fs_info->fs_mutex);
        return ret;
 }
 
index 9fd87f5edbc9144bfe71d1ce1bb3e8088977d368..fbc26eafc58c109f3aafbf498e802f931193faa9 100644 (file)
@@ -1316,7 +1316,6 @@ static void btrfs_destroy_inode(struct inode *inode)
        WARN_ON(ei->magic != 0xDEADBEEF);
        WARN_ON(ei->magic2 != 0xDEADBEAF);
        WARN_ON(!list_empty(&inode->i_dentry));
-       WARN_ON(inode->i_ino == 1);
        WARN_ON(inode->i_data.nrpages);
 
        ei->magic = 0;