kfree(sf);
 }
 
-static int btrfsic_process_metablock(
+static noinline_for_stack int btrfsic_process_metablock(
                struct btrfsic_state *state,
                struct btrfsic_block *const first_block,
                struct btrfsic_block_data_ctx *const first_block_ctx,
  * Test whether the disk block contains a tree block (leaf or node)
  * (note that this test fails for the super block)
  */
-static int btrfsic_test_for_metadata(struct btrfsic_state *state,
-                                    char **datav, unsigned int num_pages)
+static noinline_for_stack int btrfsic_test_for_metadata(
+               struct btrfsic_state *state,
+               char **datav, unsigned int num_pages)
 {
        struct btrfs_fs_info *fs_info = state->fs_info;
        SHASH_DESC_ON_STACK(shash, fs_info->csum_shash);