]> git.baikalelectronics.ru Git - kernel.git/commit
ubifs: Fix build errors as symbol undefined
authorLi Hua <hucool.lihua@huawei.com>
Mon, 21 Nov 2022 11:18:47 +0000 (19:18 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 12:55:19 +0000 (13:55 +0100)
commita0ad72be73ef2bd87dc32ba11aa73b9ba9f0196f
tree605871ffa6fbbf14543bf14288848489de8a7851
parent7c7f38179901adab426c0034d251a0fcdd4e4f80
ubifs: Fix build errors as symbol undefined

[ Upstream commit 32b95146f9befd5044969be92615b074c3df6010 ]

With CONFIG_UBIFS_FS_AUTHENTICATION not set, the compiler can assume that
ubifs_node_check_hash() is never true and drops the call to ubifs_bad_hash().
Is CONFIG_CC_OPTIMIZE_FOR_SIZE enabled this optimization does not happen anymore.

So When CONFIG_UBIFS_FS and CONFIG_CC_OPTIMIZE_FOR_SIZE is enabled but
CONFIG_UBIFS_FS_AUTHENTICATION is not set, the build errors is as followd:
    ERROR: modpost: "ubifs_bad_hash" [fs/ubifs/ubifs.ko] undefined!

Fix it by add no-op ubifs_bad_hash() for the CONFIG_UBIFS_FS_AUTHENTICATION=n case.

Fixes: da7458a739d6 ("ubifs: authentication: Add hashes to index nodes")
Signed-off-by: Li Hua <hucool.lihua@huawei.com>
Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ubifs/ubifs.h