Skip to content

Commit

Permalink
ubifs: replay: Fix high stack usage, again
Browse files Browse the repository at this point in the history
An earlier commit moved out some functions to not be inlined by gcc, but
after some other rework to remove one of those, clang started inlining
the other one and ran into the same problem as gcc did before:

fs/ubifs/replay.c:1174:5: error: stack frame size of 1152 bytes in function 'ubifs_replay_journal' [-Werror,-Wframe-larger-than=]

Mark the function as noinline_for_stack to ensure it doesn't happen
again.

Fixes: f80df38 ("ubifs: use crypto_shash_tfm_digest()")
Fixes: eb66eff ("ubifs: replay: Fix high stack usage")
Signed-off-by: Arnd Bergmann <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
  • Loading branch information
arndb authored and richardweinberger committed Feb 12, 2021
1 parent 11b8ab3 commit 410b6de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/ubifs/replay.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,9 @@ static int is_last_bud(struct ubifs_info *c, struct ubifs_bud *bud)
}

/* authenticate_sleb_hash is split out for stack usage */
static int authenticate_sleb_hash(struct ubifs_info *c, struct shash_desc *log_hash, u8 *hash)
static int noinline_for_stack
authenticate_sleb_hash(struct ubifs_info *c,
struct shash_desc *log_hash, u8 *hash)
{
SHASH_DESC_ON_STACK(hash_desc, c->hash_tfm);

Expand Down

0 comments on commit 410b6de

Please sign in to comment.