diff options
author | David Sterba <dsterba@suse.cz> | 2011-06-14 06:52:17 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2011-10-24 08:48:00 -0400 |
commit | dff51cd1c60856c28f5d22a571294c2b70b6b322 (patch) | |
tree | fe310f20368175086107460a247d5e6aa6d82e36 /fs/btrfs | |
parent | a81d3b1ba2f5faae28ba7a092c7598673fa02ac2 (diff) |
btrfs: ratelimit WARN_ON in use_block_rsv
The WARN_ON under some circumstances heavily polute log and slow down
the machine. This is just a safety, as the warning should be fixed by
another patch, nevertheless, it still pops up during testing.
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/extent-tree.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index cef355f1328a..28c4809851a5 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/rcupdate.h> | 23 | #include <linux/rcupdate.h> |
24 | #include <linux/kthread.h> | 24 | #include <linux/kthread.h> |
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/ratelimit.h> | ||
26 | #include "compat.h" | 27 | #include "compat.h" |
27 | #include "hash.h" | 28 | #include "hash.h" |
28 | #include "ctree.h" | 29 | #include "ctree.h" |
@@ -5783,7 +5784,13 @@ use_block_rsv(struct btrfs_trans_handle *trans, | |||
5783 | if (!ret) | 5784 | if (!ret) |
5784 | return block_rsv; | 5785 | return block_rsv; |
5785 | if (ret) { | 5786 | if (ret) { |
5786 | WARN_ON(1); | 5787 | static DEFINE_RATELIMIT_STATE(_rs, |
5788 | DEFAULT_RATELIMIT_INTERVAL, | ||
5789 | /*DEFAULT_RATELIMIT_BURST*/ 2); | ||
5790 | if (__ratelimit(&_rs)) { | ||
5791 | printk(KERN_DEBUG "btrfs: block rsv returned %d\n", ret); | ||
5792 | WARN_ON(1); | ||
5793 | } | ||
5787 | ret = reserve_metadata_bytes(root, block_rsv, blocksize, 0); | 5794 | ret = reserve_metadata_bytes(root, block_rsv, blocksize, 0); |
5788 | if (!ret) { | 5795 | if (!ret) { |
5789 | return block_rsv; | 5796 | return block_rsv; |