提交 ab483009 编写于 作者: L Liao Pingfang 提交者: David Sterba

btrfs: check-integrity: remove unnecessary failure messages during memory allocation

As there is a dump_stack() done on memory allocation failures, these
messages might as well be deleted instead.
Signed-off-by: NLiao Pingfang <liao.pingfang@zte.com.cn>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
[ minor tweaks ]
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 b5790d51
...@@ -631,10 +631,8 @@ static int btrfsic_process_superblock(struct btrfsic_state *state, ...@@ -631,10 +631,8 @@ static int btrfsic_process_superblock(struct btrfsic_state *state,
int pass; int pass;
selected_super = kzalloc(sizeof(*selected_super), GFP_NOFS); selected_super = kzalloc(sizeof(*selected_super), GFP_NOFS);
if (NULL == selected_super) { if (!selected_super)
pr_info("btrfsic: error, kmalloc failed!\n");
return -ENOMEM; return -ENOMEM;
}
list_for_each_entry(device, dev_head, dev_list) { list_for_each_entry(device, dev_head, dev_list) {
int i; int i;
...@@ -795,7 +793,6 @@ static int btrfsic_process_superblock_dev_mirror( ...@@ -795,7 +793,6 @@ static int btrfsic_process_superblock_dev_mirror(
if (NULL == superblock_tmp) { if (NULL == superblock_tmp) {
superblock_tmp = btrfsic_block_alloc(); superblock_tmp = btrfsic_block_alloc();
if (NULL == superblock_tmp) { if (NULL == superblock_tmp) {
pr_info("btrfsic: error, kmalloc failed!\n");
ret = -1; ret = -1;
goto out; goto out;
} }
...@@ -921,9 +918,7 @@ static struct btrfsic_stack_frame *btrfsic_stack_frame_alloc(void) ...@@ -921,9 +918,7 @@ static struct btrfsic_stack_frame *btrfsic_stack_frame_alloc(void)
struct btrfsic_stack_frame *sf; struct btrfsic_stack_frame *sf;
sf = kzalloc(sizeof(*sf), GFP_NOFS); sf = kzalloc(sizeof(*sf), GFP_NOFS);
if (NULL == sf) if (sf)
pr_info("btrfsic: alloc memory failed!\n");
else
sf->magic = BTRFSIC_BLOCK_STACK_FRAME_MAGIC_NUMBER; sf->magic = BTRFSIC_BLOCK_STACK_FRAME_MAGIC_NUMBER;
return sf; return sf;
} }
...@@ -1313,7 +1308,6 @@ static int btrfsic_create_link_to_next_block( ...@@ -1313,7 +1308,6 @@ static int btrfsic_create_link_to_next_block(
if (NULL == l) { if (NULL == l) {
l = btrfsic_block_link_alloc(); l = btrfsic_block_link_alloc();
if (NULL == l) { if (NULL == l) {
pr_info("btrfsic: error, kmalloc failed!\n");
btrfsic_release_block_ctx(next_block_ctx); btrfsic_release_block_ctx(next_block_ctx);
*next_blockp = NULL; *next_blockp = NULL;
return -1; return -1;
...@@ -1470,7 +1464,6 @@ static int btrfsic_handle_extent_data( ...@@ -1470,7 +1464,6 @@ static int btrfsic_handle_extent_data(
mirror_num, mirror_num,
&block_was_created); &block_was_created);
if (NULL == next_block) { if (NULL == next_block) {
pr_info("btrfsic: error, kmalloc failed!\n");
btrfsic_release_block_ctx(&next_block_ctx); btrfsic_release_block_ctx(&next_block_ctx);
return -1; return -1;
} }
...@@ -2013,7 +2006,6 @@ static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state, ...@@ -2013,7 +2006,6 @@ static void btrfsic_process_written_block(struct btrfsic_dev_state *dev_state,
block = btrfsic_block_alloc(); block = btrfsic_block_alloc();
if (NULL == block) { if (NULL == block) {
pr_info("btrfsic: error, kmalloc failed!\n");
btrfsic_release_block_ctx(&block_ctx); btrfsic_release_block_ctx(&block_ctx);
goto continue_loop; goto continue_loop;
} }
...@@ -2234,7 +2226,6 @@ static int btrfsic_process_written_superblock( ...@@ -2234,7 +2226,6 @@ static int btrfsic_process_written_superblock(
mirror_num, mirror_num,
&was_created); &was_created);
if (NULL == next_block) { if (NULL == next_block) {
pr_info("btrfsic: error, kmalloc failed!\n");
btrfsic_release_block_ctx(&tmp_next_block_ctx); btrfsic_release_block_ctx(&tmp_next_block_ctx);
return -1; return -1;
} }
...@@ -2542,10 +2533,8 @@ static struct btrfsic_block_link *btrfsic_block_link_lookup_or_add( ...@@ -2542,10 +2533,8 @@ static struct btrfsic_block_link *btrfsic_block_link_lookup_or_add(
&state->block_link_hashtable); &state->block_link_hashtable);
if (NULL == l) { if (NULL == l) {
l = btrfsic_block_link_alloc(); l = btrfsic_block_link_alloc();
if (NULL == l) { if (!l)
pr_info("btrfsic: error, kmalloc failed!\n");
return NULL; return NULL;
}
l->block_ref_to = next_block; l->block_ref_to = next_block;
l->block_ref_from = from_block; l->block_ref_from = from_block;
...@@ -2589,10 +2578,9 @@ static struct btrfsic_block *btrfsic_block_lookup_or_add( ...@@ -2589,10 +2578,9 @@ static struct btrfsic_block *btrfsic_block_lookup_or_add(
struct btrfsic_dev_state *dev_state; struct btrfsic_dev_state *dev_state;
block = btrfsic_block_alloc(); block = btrfsic_block_alloc();
if (NULL == block) { if (!block)
pr_info("btrfsic: error, kmalloc failed!\n");
return NULL; return NULL;
}
dev_state = btrfsic_dev_state_lookup(block_ctx->dev->bdev->bd_dev); dev_state = btrfsic_dev_state_lookup(block_ctx->dev->bdev->bd_dev);
if (NULL == dev_state) { if (NULL == dev_state) {
pr_info("btrfsic: error, lookup dev_state failed!\n"); pr_info("btrfsic: error, lookup dev_state failed!\n");
...@@ -2797,10 +2785,8 @@ int btrfsic_mount(struct btrfs_fs_info *fs_info, ...@@ -2797,10 +2785,8 @@ int btrfsic_mount(struct btrfs_fs_info *fs_info,
return -1; return -1;
} }
state = kvzalloc(sizeof(*state), GFP_KERNEL); state = kvzalloc(sizeof(*state), GFP_KERNEL);
if (!state) { if (!state)
pr_info("btrfs check-integrity: allocation failed!\n");
return -ENOMEM; return -ENOMEM;
}
if (!btrfsic_is_initialized) { if (!btrfsic_is_initialized) {
mutex_init(&btrfsic_mutex); mutex_init(&btrfsic_mutex);
...@@ -2829,7 +2815,6 @@ int btrfsic_mount(struct btrfs_fs_info *fs_info, ...@@ -2829,7 +2815,6 @@ int btrfsic_mount(struct btrfs_fs_info *fs_info,
ds = btrfsic_dev_state_alloc(); ds = btrfsic_dev_state_alloc();
if (NULL == ds) { if (NULL == ds) {
pr_info("btrfs check-integrity: kmalloc() failed!\n");
mutex_unlock(&btrfsic_mutex); mutex_unlock(&btrfsic_mutex);
return -ENOMEM; return -ENOMEM;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册