diff options
| -rw-r--r-- | fs/btrfs/disk-io.c | 21 | ||||
| -rw-r--r-- | fs/btrfs/inode.c | 13 |
2 files changed, 10 insertions, 24 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index de7b4770ab17..cb9d1b8bfe74 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/crc32c.h> | 29 | #include <linux/crc32c.h> |
| 30 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
| 31 | #include <linux/migrate.h> | 31 | #include <linux/migrate.h> |
| 32 | #include <linux/ratelimit.h> | ||
| 32 | #include <asm/unaligned.h> | 33 | #include <asm/unaligned.h> |
| 33 | #include "compat.h" | 34 | #include "compat.h" |
| 34 | #include "ctree.h" | 35 | #include "ctree.h" |
| @@ -254,14 +255,12 @@ static int csum_tree_block(struct btrfs_root *root, struct extent_buffer *buf, | |||
| 254 | memcpy(&found, result, csum_size); | 255 | memcpy(&found, result, csum_size); |
| 255 | 256 | ||
| 256 | read_extent_buffer(buf, &val, 0, csum_size); | 257 | read_extent_buffer(buf, &val, 0, csum_size); |
| 257 | if (printk_ratelimit()) { | 258 | printk_ratelimited(KERN_INFO "btrfs: %s checksum verify " |
| 258 | printk(KERN_INFO "btrfs: %s checksum verify " | ||
| 259 | "failed on %llu wanted %X found %X " | 259 | "failed on %llu wanted %X found %X " |
| 260 | "level %d\n", | 260 | "level %d\n", |
| 261 | root->fs_info->sb->s_id, | 261 | root->fs_info->sb->s_id, |
| 262 | (unsigned long long)buf->start, val, found, | 262 | (unsigned long long)buf->start, val, found, |
| 263 | btrfs_header_level(buf)); | 263 | btrfs_header_level(buf)); |
| 264 | } | ||
| 265 | if (result != (char *)&inline_result) | 264 | if (result != (char *)&inline_result) |
| 266 | kfree(result); | 265 | kfree(result); |
| 267 | return 1; | 266 | return 1; |
| @@ -296,13 +295,11 @@ static int verify_parent_transid(struct extent_io_tree *io_tree, | |||
| 296 | ret = 0; | 295 | ret = 0; |
| 297 | goto out; | 296 | goto out; |
| 298 | } | 297 | } |
| 299 | if (printk_ratelimit()) { | 298 | printk_ratelimited("parent transid verify failed on %llu wanted %llu " |
| 300 | printk("parent transid verify failed on %llu wanted %llu " | ||
| 301 | "found %llu\n", | 299 | "found %llu\n", |
| 302 | (unsigned long long)eb->start, | 300 | (unsigned long long)eb->start, |
| 303 | (unsigned long long)parent_transid, | 301 | (unsigned long long)parent_transid, |
| 304 | (unsigned long long)btrfs_header_generation(eb)); | 302 | (unsigned long long)btrfs_header_generation(eb)); |
| 305 | } | ||
| 306 | ret = 1; | 303 | ret = 1; |
| 307 | clear_extent_buffer_uptodate(io_tree, eb, &cached_state); | 304 | clear_extent_buffer_uptodate(io_tree, eb, &cached_state); |
| 308 | out: | 305 | out: |
| @@ -533,12 +530,10 @@ static int btree_readpage_end_io_hook(struct page *page, u64 start, u64 end, | |||
| 533 | 530 | ||
| 534 | found_start = btrfs_header_bytenr(eb); | 531 | found_start = btrfs_header_bytenr(eb); |
| 535 | if (found_start != start) { | 532 | if (found_start != start) { |
| 536 | if (printk_ratelimit()) { | 533 | printk_ratelimited(KERN_INFO "btrfs bad tree block start " |
| 537 | printk(KERN_INFO "btrfs bad tree block start " | ||
| 538 | "%llu %llu\n", | 534 | "%llu %llu\n", |
| 539 | (unsigned long long)found_start, | 535 | (unsigned long long)found_start, |
| 540 | (unsigned long long)eb->start); | 536 | (unsigned long long)eb->start); |
| 541 | } | ||
| 542 | ret = -EIO; | 537 | ret = -EIO; |
| 543 | goto err; | 538 | goto err; |
| 544 | } | 539 | } |
| @@ -550,10 +545,8 @@ static int btree_readpage_end_io_hook(struct page *page, u64 start, u64 end, | |||
| 550 | goto err; | 545 | goto err; |
| 551 | } | 546 | } |
| 552 | if (check_tree_block_fsid(root, eb)) { | 547 | if (check_tree_block_fsid(root, eb)) { |
| 553 | if (printk_ratelimit()) { | 548 | printk_ratelimited(KERN_INFO "btrfs bad fsid on block %llu\n", |
| 554 | printk(KERN_INFO "btrfs bad fsid on block %llu\n", | ||
| 555 | (unsigned long long)eb->start); | 549 | (unsigned long long)eb->start); |
| 556 | } | ||
| 557 | ret = -EIO; | 550 | ret = -EIO; |
| 558 | goto err; | 551 | goto err; |
| 559 | } | 552 | } |
| @@ -2108,11 +2101,9 @@ static void btrfs_end_buffer_write_sync(struct buffer_head *bh, int uptodate) | |||
| 2108 | if (uptodate) { | 2101 | if (uptodate) { |
| 2109 | set_buffer_uptodate(bh); | 2102 | set_buffer_uptodate(bh); |
| 2110 | } else { | 2103 | } else { |
| 2111 | if (printk_ratelimit()) { | 2104 | printk_ratelimited(KERN_WARNING "lost page write due to " |
| 2112 | printk(KERN_WARNING "lost page write due to " | ||
| 2113 | "I/O error on %s\n", | 2105 | "I/O error on %s\n", |
| 2114 | bdevname(bh->b_bdev, b)); | 2106 | bdevname(bh->b_bdev, b)); |
| 2115 | } | ||
| 2116 | /* note, we dont' set_buffer_write_io_error because we have | 2107 | /* note, we dont' set_buffer_write_io_error because we have |
| 2117 | * our own ways of dealing with the IO errors | 2108 | * our own ways of dealing with the IO errors |
| 2118 | */ | 2109 | */ |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 5ff52b644a60..1d1017f91558 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | #include <linux/posix_acl.h> | 37 | #include <linux/posix_acl.h> |
| 38 | #include <linux/falloc.h> | 38 | #include <linux/falloc.h> |
| 39 | #include <linux/slab.h> | 39 | #include <linux/slab.h> |
| 40 | #include <linux/ratelimit.h> | ||
| 40 | #include "compat.h" | 41 | #include "compat.h" |
| 41 | #include "ctree.h" | 42 | #include "ctree.h" |
| 42 | #include "disk-io.h" | 43 | #include "disk-io.h" |
| @@ -2004,12 +2005,10 @@ good: | |||
| 2004 | return 0; | 2005 | return 0; |
| 2005 | 2006 | ||
| 2006 | zeroit: | 2007 | zeroit: |
| 2007 | if (printk_ratelimit()) { | 2008 | printk_ratelimited(KERN_INFO "btrfs csum failed ino %lu off %llu csum %u " |
| 2008 | printk(KERN_INFO "btrfs csum failed ino %lu off %llu csum %u " | ||
| 2009 | "private %llu\n", page->mapping->host->i_ino, | 2009 | "private %llu\n", page->mapping->host->i_ino, |
| 2010 | (unsigned long long)start, csum, | 2010 | (unsigned long long)start, csum, |
| 2011 | (unsigned long long)private); | 2011 | (unsigned long long)private); |
| 2012 | } | ||
| 2013 | memset(kaddr + offset, 1, end - start + 1); | 2012 | memset(kaddr + offset, 1, end - start + 1); |
| 2014 | flush_dcache_page(page); | 2013 | flush_dcache_page(page); |
| 2015 | kunmap_atomic(kaddr, KM_USER0); | 2014 | kunmap_atomic(kaddr, KM_USER0); |
| @@ -4243,22 +4242,18 @@ void btrfs_dirty_inode(struct inode *inode) | |||
| 4243 | btrfs_end_transaction(trans, root); | 4242 | btrfs_end_transaction(trans, root); |
| 4244 | trans = btrfs_start_transaction(root, 1); | 4243 | trans = btrfs_start_transaction(root, 1); |
| 4245 | if (IS_ERR(trans)) { | 4244 | if (IS_ERR(trans)) { |
| 4246 | if (printk_ratelimit()) { | 4245 | printk_ratelimited(KERN_ERR "btrfs: fail to " |
| 4247 | printk(KERN_ERR "btrfs: fail to " | ||
| 4248 | "dirty inode %lu error %ld\n", | 4246 | "dirty inode %lu error %ld\n", |
| 4249 | inode->i_ino, PTR_ERR(trans)); | 4247 | inode->i_ino, PTR_ERR(trans)); |
| 4250 | } | ||
| 4251 | return; | 4248 | return; |
| 4252 | } | 4249 | } |
| 4253 | btrfs_set_trans_block_group(trans, inode); | 4250 | btrfs_set_trans_block_group(trans, inode); |
| 4254 | 4251 | ||
| 4255 | ret = btrfs_update_inode(trans, root, inode); | 4252 | ret = btrfs_update_inode(trans, root, inode); |
| 4256 | if (ret) { | 4253 | if (ret) { |
| 4257 | if (printk_ratelimit()) { | 4254 | printk_ratelimited(KERN_ERR "btrfs: fail to " |
| 4258 | printk(KERN_ERR "btrfs: fail to " | ||
| 4259 | "dirty inode %lu error %d\n", | 4255 | "dirty inode %lu error %d\n", |
| 4260 | inode->i_ino, ret); | 4256 | inode->i_ino, ret); |
| 4261 | } | ||
| 4262 | } | 4257 | } |
| 4263 | } | 4258 | } |
| 4264 | btrfs_end_transaction(trans, root); | 4259 | btrfs_end_transaction(trans, root); |
