diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-04-09 16:28:12 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:01 -0400 |
commit | ce9adaa5a792c2099a83246265eb4055bc38b6b8 (patch) | |
tree | 3ac03bb73cd3aad0c0b194d387cbb5b136c92fa7 /fs/btrfs/ctree.c | |
parent | 728131d8e40c2a47c59ca91a806299c4708029f9 (diff) |
Btrfs: Do metadata checksums for reads via a workqueue
Before, metadata checksumming was done by the callers of read_tree_block,
which would set EXTENT_CSUM bits in the extent tree to show that a given
range of pages was already checksummed and didn't need to be verified
again.
But, those bits could go away via try_to_releasepage, and the end
result was bogus checksum failures on pages that never left the cache.
The new code validates checksums when the page is read. It is a little
tricky because metadata blocks can span pages and a single read may
end up going via multiple bios.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r-- | fs/btrfs/ctree.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index c92c6b0ee582..efce173a935c 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -158,9 +158,6 @@ int __btrfs_cow_block(struct btrfs_trans_handle *trans, | |||
158 | } else { | 158 | } else { |
159 | root_gen = 0; | 159 | root_gen = 0; |
160 | } | 160 | } |
161 | if (!(buf->flags & EXTENT_CSUM)) | ||
162 | WARN_ON(1); | ||
163 | |||
164 | WARN_ON(root->ref_cows && trans->transid != | 161 | WARN_ON(root->ref_cows && trans->transid != |
165 | root->fs_info->running_transaction->transid); | 162 | root->fs_info->running_transaction->transid); |
166 | WARN_ON(root->ref_cows && trans->transid != root->last_trans); | 163 | WARN_ON(root->ref_cows && trans->transid != root->last_trans); |
@@ -247,8 +244,6 @@ int btrfs_cow_block(struct btrfs_trans_handle *trans, | |||
247 | root->fs_info->generation); | 244 | root->fs_info->generation); |
248 | WARN_ON(1); | 245 | WARN_ON(1); |
249 | } | 246 | } |
250 | if (!(buf->flags & EXTENT_CSUM)) | ||
251 | WARN_ON(1); | ||
252 | 247 | ||
253 | header_trans = btrfs_header_generation(buf); | 248 | header_trans = btrfs_header_generation(buf); |
254 | spin_lock(&root->fs_info->hash_lock); | 249 | spin_lock(&root->fs_info->hash_lock); |