Btrfs: properly set new buffers for new blocks up to date
authorChris Mason <chris.mason@oracle.com>
Fri, 23 Mar 2007 15:00:45 +0000 (11:00 -0400)
committerDavid Woodhouse <dwmw2@hera.kernel.org>
Fri, 23 Mar 2007 15:00:45 +0000 (11:00 -0400)
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/super.c

index 8e1dcda0839cc7be4a66ff69a22a9d9cc2ff680b..2f1eb4ae4e1d2f9c31b5b71e20e06a1e299a30f8 100644 (file)
@@ -10,8 +10,13 @@ static int check_tree_block(struct btrfs_root *root, struct buffer_head *buf)
        if (buf->b_blocknr != btrfs_header_blocknr(&node->header))
                BUG();
        if (root->node && btrfs_header_parentid(&node->header) !=
-           btrfs_header_parentid(btrfs_buffer_header(root->node)))
-               BUG();
+           btrfs_header_parentid(btrfs_buffer_header(root->node))) {
+               printk("block %Lu parentids don't match buf %Lu, root %Lu\n",
+                      buf->b_blocknr,
+                      btrfs_header_parentid(&node->header),
+                      btrfs_header_parentid(btrfs_buffer_header(root->node)));
+               WARN_ON(1);
+       }
        return 0;
 }
 
index 2818f1c57170487a7bfe27ba0f10ebd547510687..c86f0e6152f2799a727940f2abe9f26e0eb00046 100644 (file)
@@ -467,7 +467,7 @@ struct buffer_head *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
                return NULL;
        }
        buf = find_tree_block(root, ins.objectid);
-       dirty_tree_block(trans, root, buf);
+       set_buffer_uptodate(buf);
        return buf;
 }
 
index 6080a8133d7105e5a78a077d29f0ed8586f49a2a..8970e9a82156cc6a611fb644b46240bde4ae9d2a 100644 (file)
@@ -473,7 +473,10 @@ static int btrfs_sync_fs(struct super_block *sb, int wait)
        struct btrfs_trans_handle *trans;
        struct btrfs_root *root;
        int ret;
+
        sb->s_dirt = 0;
+       return 0;
+
        root = btrfs_sb(sb);
        trans = btrfs_start_transaction(root, 1);
        ret = btrfs_commit_transaction(trans, root);