summaryrefslogtreecommitdiff
path: root/fs/btrfs/ctree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-06-28 15:57:36 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-06-28 15:57:36 -0400
commitccd467d60e81b48cdbecae93532b66bcdedca91d (patch)
tree7c8c74ca8c6c058fc2e3c90c0082e796b7c1e92e /fs/btrfs/ctree.c
parentf2654de42a759127cb1f1e8a626ec94178732e20 (diff)
downloadlwn-ccd467d60e81b48cdbecae93532b66bcdedca91d.tar.gz
lwn-ccd467d60e81b48cdbecae93532b66bcdedca91d.zip
Btrfs: crash recovery fixes
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r--fs/btrfs/ctree.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 606a19b5916d..9eb646529edc 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -75,6 +75,17 @@ static int btrfs_cow_block(struct btrfs_trans_handle *trans, struct btrfs_root
struct btrfs_node *cow_node;
int ret;
+ WARN_ON(!buffer_uptodate(buf));
+ if (trans->transaction != root->fs_info->running_transaction) {
+ printk(KERN_CRIT "trans %Lu running %Lu\n", trans->transid,
+ root->fs_info->running_transaction->transid);
+ WARN_ON(1);
+ }
+ if (trans->transid != root->fs_info->generation) {
+ printk(KERN_CRIT "trans %Lu running %Lu\n", trans->transid,
+ root->fs_info->generation);
+ WARN_ON(1);
+ }
if (btrfs_header_generation(btrfs_buffer_header(buf)) ==
trans->transid) {
*cow_ret = buf;
@@ -107,7 +118,7 @@ static int btrfs_cow_block(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_free_extent(trans, root, bh_blocknr(buf), 1, 1);
}
btrfs_block_release(root, buf);
- mark_buffer_dirty(cow);
+ btrfs_mark_buffer_dirty(cow);
*cow_ret = cow;
return 0;
}