提交 6ab60601 编写于 作者: J Josef Bacik

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: NAndrew Lutomirski <luto@mit.edu>
Signed-off-by: NJosef Bacik <josef@redhat.com>
上级 4289a667
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册