linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Lihua (lihua, ran)" <hucool.lihua@huawei.com>
To: <richard@nod.at>, <s.hauer@pengutronix.de>
Cc: <linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
	<weiyongjun1@huawei.com>, <yusongping@huawei.com>
Subject: Re: [PATCH v2] ubifs: Fix build errors as symbol undefined
Date: Wed, 23 Nov 2022 11:29:04 +0800	[thread overview]
Message-ID: <ad8ff736-bbce-2ec3-301f-691401a80bd1@huawei.com> (raw)
In-Reply-To: <20221121111847.71648-1-hucool.lihua@huawei.com>

ping

在 2022/11/21 19:18, Li Hua 写道:
> 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: 16a26b20d2af ("ubifs: authentication: Add hashes to index nodes")
> Signed-off-by: Li Hua <hucool.lihua@huawei.com>
> ---
>   fs/ubifs/ubifs.h | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
> index 478bbbb5382f..2f1f31581094 100644
> --- a/fs/ubifs/ubifs.h
> +++ b/fs/ubifs/ubifs.h
> @@ -1623,8 +1623,13 @@ static inline int ubifs_check_hmac(const struct ubifs_info *c,
>   	return crypto_memneq(expected, got, c->hmac_desc_len);
>   }
>   
> +#ifdef CONFIG_UBIFS_FS_AUTHENTICATION
>   void ubifs_bad_hash(const struct ubifs_info *c, const void *node,
>   		    const u8 *hash, int lnum, int offs);
> +#else
> +static inline void ubifs_bad_hash(const struct ubifs_info *c, const void *node,
> +				  const u8 *hash, int lnum, int offs) {};
> +#endif
>   
>   int __ubifs_node_check_hash(const struct ubifs_info *c, const void *buf,
>   			  const u8 *expected);
> 

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2022-11-23  3:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21 11:18 [PATCH v2] ubifs: Fix build errors as symbol undefined Li Hua
2022-11-23  3:29 ` Lihua (lihua, ran) [this message]
2022-11-23  7:35   ` Richard Weinberger
2022-11-23  7:28 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ad8ff736-bbce-2ec3-301f-691401a80bd1@huawei.com \
    --to=hucool.lihua@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=s.hauer@pengutronix.de \
    --cc=weiyongjun1@huawei.com \
    --cc=yusongping@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).