summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/free-space-cache.c
diff options
context:
space:
mode:
authorJosef Bacik2011-08-08 14:24:46 +0200
committerJosef Bacik2011-10-19 21:12:33 +0200
commit6ab60601d518d563ca1a47eaa399096e69d3b64a (patch)
tree7a942576303b57b4c2dffa7815fb6ba2fe9a5fa1 /fs/btrfs/free-space-cache.c
parentBtrfs: fix how we reserve space for deleting inodes (diff)
downloadkernel-qcow2-linux-6ab60601d518d563ca1a47eaa399096e69d3b64a.tar.gz
kernel-qcow2-linux-6ab60601d518d563ca1a47eaa399096e69d3b64a.tar.xz
kernel-qcow2-linux-6ab60601d518d563ca1a47eaa399096e69d3b64a.zip
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.c12
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 @@
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/math64.h>
+#include <linux/ratelimit.h>
#include "ctree.h"
#include "free-space-cache.h"
#include "transaction.h"
@@ -341,11 +342,12 @@ int __load_free_space_cache(struct btrfs_root *root, struct inode *inode,
gen = addr;
if (*gen != BTRFS_I(inode)->generation) {
- printk(KERN_ERR "btrfs: space cache generation"
- " (%llu) does not match inode (%llu)\n",
- (unsigned long long)*gen,
- (unsigned long long)
- BTRFS_I(inode)->generation);
+ printk_ratelimited(KERN_ERR "btrfs: space cache"
+ " generation (%llu) does not match "
+ "inode (%llu)\n",
+ (unsigned long long)*gen,
+ (unsigned long long)
+ BTRFS_I(inode)->generation);
kunmap(page);
unlock_page(page);
page_cache_release(page);