Commit b069e0c3 authored by David Sterba's avatar David Sterba Committed by Josef Bacik

btrfs: put some enospc messages under enospc_debug

The warning in use_block_rsv is not useful for users and may fill
the logs unnecessarily.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.cz>
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
parent 38851cc1
...@@ -6408,12 +6408,14 @@ use_block_rsv(struct btrfs_trans_handle *trans, ...@@ -6408,12 +6408,14 @@ use_block_rsv(struct btrfs_trans_handle *trans,
if (!ret) if (!ret)
return block_rsv; return block_rsv;
if (ret && !block_rsv->failfast) { if (ret && !block_rsv->failfast) {
static DEFINE_RATELIMIT_STATE(_rs, if (btrfs_test_opt(root, ENOSPC_DEBUG)) {
DEFAULT_RATELIMIT_INTERVAL, static DEFINE_RATELIMIT_STATE(_rs,
/*DEFAULT_RATELIMIT_BURST*/ 2); DEFAULT_RATELIMIT_INTERVAL * 10,
if (__ratelimit(&_rs)) /*DEFAULT_RATELIMIT_BURST*/ 1);
WARN(1, KERN_DEBUG "btrfs: block rsv returned %d\n", if (__ratelimit(&_rs))
ret); WARN(1, KERN_DEBUG
"btrfs: block rsv returned %d\n", ret);
}
ret = reserve_metadata_bytes(root, block_rsv, blocksize, ret = reserve_metadata_bytes(root, block_rsv, blocksize,
BTRFS_RESERVE_NO_FLUSH); BTRFS_RESERVE_NO_FLUSH);
if (!ret) { if (!ret) {
...@@ -7730,11 +7732,13 @@ int btrfs_free_block_groups(struct btrfs_fs_info *info) ...@@ -7730,11 +7732,13 @@ int btrfs_free_block_groups(struct btrfs_fs_info *info)
space_info = list_entry(info->space_info.next, space_info = list_entry(info->space_info.next,
struct btrfs_space_info, struct btrfs_space_info,
list); list);
if (space_info->bytes_pinned > 0 || if (btrfs_test_opt(info->tree_root, ENOSPC_DEBUG)) {
space_info->bytes_reserved > 0 || if (space_info->bytes_pinned > 0 ||
space_info->bytes_may_use > 0) { space_info->bytes_reserved > 0 ||
WARN_ON(1); space_info->bytes_may_use > 0) {
dump_space_info(space_info, 0, 0); WARN_ON(1);
dump_space_info(space_info, 0, 0);
}
} }
list_del(&space_info->list); list_del(&space_info->list);
kfree(space_info); kfree(space_info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment