diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-06-28 15:57:36 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-06-28 15:57:36 -0400 |
commit | ccd467d60e81b48cdbecae93532b66bcdedca91d (patch) | |
tree | 7c8c74ca8c6c058fc2e3c90c0082e796b7c1e92e /fs/btrfs/ctree.c | |
parent | f2654de42a759127cb1f1e8a626ec94178732e20 (diff) |
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.c | 13 |
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 | |||
75 | struct btrfs_node *cow_node; | 75 | struct btrfs_node *cow_node; |
76 | int ret; | 76 | int ret; |
77 | 77 | ||
78 | WARN_ON(!buffer_uptodate(buf)); | ||
79 | if (trans->transaction != root->fs_info->running_transaction) { | ||
80 | printk(KERN_CRIT "trans %Lu running %Lu\n", trans->transid, | ||
81 | root->fs_info->running_transaction->transid); | ||
82 | WARN_ON(1); | ||
83 | } | ||
84 | if (trans->transid != root->fs_info->generation) { | ||
85 | printk(KERN_CRIT "trans %Lu running %Lu\n", trans->transid, | ||
86 | root->fs_info->generation); | ||
87 | WARN_ON(1); | ||
88 | } | ||
78 | if (btrfs_header_generation(btrfs_buffer_header(buf)) == | 89 | if (btrfs_header_generation(btrfs_buffer_header(buf)) == |
79 | trans->transid) { | 90 | trans->transid) { |
80 | *cow_ret = buf; | 91 | *cow_ret = buf; |
@@ -107,7 +118,7 @@ static int btrfs_cow_block(struct btrfs_trans_handle *trans, struct btrfs_root | |||
107 | btrfs_free_extent(trans, root, bh_blocknr(buf), 1, 1); | 118 | btrfs_free_extent(trans, root, bh_blocknr(buf), 1, 1); |
108 | } | 119 | } |
109 | btrfs_block_release(root, buf); | 120 | btrfs_block_release(root, buf); |
110 | mark_buffer_dirty(cow); | 121 | btrfs_mark_buffer_dirty(cow); |
111 | *cow_ret = cow; | 122 | *cow_ret = cow; |
112 | return 0; | 123 | return 0; |
113 | } | 124 | } |