diff options
author | Josef Bacik <josef@redhat.com> | 2011-08-08 08:24:46 -0400 |
---|---|---|
committer | Josef Bacik <josef@redhat.com> | 2011-10-19 15:12:33 -0400 |
commit | 6ab60601d518d563ca1a47eaa399096e69d3b64a (patch) | |
tree | 7a942576303b57b4c2dffa7815fb6ba2fe9a5fa1 /fs/btrfs/free-space-cache.c | |
parent | 4289a667a0d7c6b134898cac7bfbe950267c305c (diff) |
Btrfs: ratelimit the generation printk for the free space cache
A user reported getting spammed when moving to 3.0 by this message. Since we
switched to the normal checksumming infrastructure all old free space caches
will be wrong and need to be regenerated so people are likely to see this
message a lot, so ratelimit it so it doesn't fill up their logs and freak them
out. Thanks,
Reported-by: Andrew Lutomirski <luto@mit.edu>
Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/free-space-cache.c')
-rw-r--r-- | fs/btrfs/free-space-cache.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 79c16a68a2bc..ecc1a4f85d20 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
21 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
22 | #include <linux/math64.h> | 22 | #include <linux/math64.h> |
23 | #include <linux/ratelimit.h> | ||
23 | #include "ctree.h" | 24 | #include "ctree.h" |
24 | #include "free-space-cache.h" | 25 | #include "free-space-cache.h" |
25 | #include "transaction.h" | 26 | #include "transaction.h" |
@@ -341,11 +342,12 @@ int __load_free_space_cache(struct btrfs_root *root, struct inode *inode, | |||
341 | 342 | ||
342 | gen = addr; | 343 | gen = addr; |
343 | if (*gen != BTRFS_I(inode)->generation) { | 344 | if (*gen != BTRFS_I(inode)->generation) { |
344 | printk(KERN_ERR "btrfs: space cache generation" | 345 | printk_ratelimited(KERN_ERR "btrfs: space cache" |
345 | " (%llu) does not match inode (%llu)\n", | 346 | " generation (%llu) does not match " |
346 | (unsigned long long)*gen, | 347 | "inode (%llu)\n", |
347 | (unsigned long long) | 348 | (unsigned long long)*gen, |
348 | BTRFS_I(inode)->generation); | 349 | (unsigned long long) |
350 | BTRFS_I(inode)->generation); | ||
349 | kunmap(page); | 351 | kunmap(page); |
350 | unlock_page(page); | 352 | unlock_page(page); |
351 | page_cache_release(page); | 353 | page_cache_release(page); |