diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-01-29 09:10:27 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:03:59 -0400 |
commit | aadfeb6e39ad6bde080cb3ab23f4da57ccb25f4a (patch) | |
tree | 9e5a1158b8857f26bfc7237adaa49e1784a163a4 /fs | |
parent | c2a8b6e11009398ca9363d8ba8d4e7e40fb897fd (diff) |
Btrfs: Add some extra debugging around file data checksum failures
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/file-item.c | 4 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index 614176e52851..3ebbc058d082 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-item.c | |||
@@ -261,6 +261,10 @@ csum: | |||
261 | found: | 261 | found: |
262 | csum_result = btrfs_csum_data(root, data, csum_result, len); | 262 | csum_result = btrfs_csum_data(root, data, csum_result, len); |
263 | btrfs_csum_final(csum_result, (char *)&csum_result); | 263 | btrfs_csum_final(csum_result, (char *)&csum_result); |
264 | if (csum_result == 0) { | ||
265 | printk("csum result is 0 for inode %lu offset %Lu\n", inode->i_ino, offset); | ||
266 | } | ||
267 | |||
264 | write_extent_buffer(leaf, &csum_result, (unsigned long)item, | 268 | write_extent_buffer(leaf, &csum_result, (unsigned long)item, |
265 | BTRFS_CRC32_SIZE); | 269 | BTRFS_CRC32_SIZE); |
266 | btrfs_mark_buffer_dirty(path->nodes[0]); | 270 | btrfs_mark_buffer_dirty(path->nodes[0]); |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 026bc9c4c90d..484551274100 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -318,6 +318,7 @@ int btrfs_readpage_io_hook(struct page *page, u64 start, u64 end) | |||
318 | if (ret == -ENOENT || ret == -EFBIG) | 318 | if (ret == -ENOENT || ret == -EFBIG) |
319 | ret = 0; | 319 | ret = 0; |
320 | csum = 0; | 320 | csum = 0; |
321 | printk("no csum found for inode %lu start %Lu\n", inode->i_ino, start); | ||
321 | goto out; | 322 | goto out; |
322 | } | 323 | } |
323 | read_extent_buffer(path->nodes[0], &csum, (unsigned long)item, | 324 | read_extent_buffer(path->nodes[0], &csum, (unsigned long)item, |
@@ -336,7 +337,7 @@ int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end) | |||
336 | struct inode *inode = page->mapping->host; | 337 | struct inode *inode = page->mapping->host; |
337 | struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; | 338 | struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; |
338 | char *kaddr; | 339 | char *kaddr; |
339 | u64 private; | 340 | u64 private = ~(u32)0; |
340 | int ret; | 341 | int ret; |
341 | struct btrfs_root *root = BTRFS_I(inode)->root; | 342 | struct btrfs_root *root = BTRFS_I(inode)->root; |
342 | u32 csum = ~(u32)0; | 343 | u32 csum = ~(u32)0; |
@@ -362,8 +363,9 @@ int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end) | |||
362 | return 0; | 363 | return 0; |
363 | 364 | ||
364 | zeroit: | 365 | zeroit: |
365 | printk("btrfs csum failed ino %lu off %llu\n", | 366 | printk("btrfs csum failed ino %lu off %llu csum %u private %Lu\n", |
366 | page->mapping->host->i_ino, (unsigned long long)start); | 367 | page->mapping->host->i_ino, (unsigned long long)start, csum, |
368 | private); | ||
367 | memset(kaddr + offset, 1, end - start + 1); | 369 | memset(kaddr + offset, 1, end - start + 1); |
368 | flush_dcache_page(page); | 370 | flush_dcache_page(page); |
369 | kunmap_atomic(kaddr, KM_IRQ0); | 371 | kunmap_atomic(kaddr, KM_IRQ0); |