Re: [PATCH v1 07/11] blk-crypto: move bio_crypt_dun_increment() to the public header

[email protected]
Newsgroups org.kernel.vger.linux-scsi,org.kernel.vger.linux-devicetree
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Missing EXPORT_SYMBOL_GPL for bio_crypt_dun_increment causes module build failures.
--

commit a07e0dacccb884a51c1f14000f1404eb1f5c2cf7
Author: linlzhan <[email protected]>
blk-crypto: move bio_crypt_dun_increment() to the public header

This commit moves the declaration of bio_crypt_dun_increment() from the
internal block header to the public blk-crypto.h header. This allows drivers
managing inline-encrypted I/O directly to advance the data unit number.

> diff --git a/include/linux/blk-crypto.h b/include/linux/blk-crypto.h
> index 33ae52b77522b..c9f436b6b2ef4 100644
> --- a/include/linux/blk-crypto.h
> +++ b/include/linux/blk-crypto.h
> @@ -181,6 +181,9 @@ bool bio_crypt_dun_is_contiguous(const struct bio_crypt_ctx *bc,
>  				 unsigned int bytes,
>  				 const u64 next_dun[BLK_CRYPTO_DUN_ARRAY_SIZE]);
>  
> +void bio_crypt_dun_increment(u64 dun[BLK_CRYPTO_DUN_ARRAY_SIZE],
> +			     unsigned int inc);
> +

[Severity: Low]
Does the missing EXPORT_SYMBOL_GPL() for this function cause module build
failures?

Since this function is now exposed for external drivers to use, if a driver
using it is configured as a loadable module, it seems the kernel build will
fail at the modpost step with an undefined symbol error.

Should an EXPORT_SYMBOL_GPL(bio_crypt_dun_increment) be added alongside its
implementation in block/blk-crypto.c so that modules can successfully link
against it?

>  int blk_crypto_init_key(struct blk_crypto_key *blk_key,
>  			const u8 *key_bytes, size_t key_size,
>  			enum blk_crypto_key_type key_type,

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=7
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.