diff mbox series

btrfs: Fix build error while LIBCRC32C is module

Message ID 20190702143903.49264-1-yuehaibing@huawei.com (mailing list archive)
State New, archived
Headers show
Series btrfs: Fix build error while LIBCRC32C is module | expand

Commit Message

Yue Haibing July 2, 2019, 2:39 p.m. UTC
If CONFIG_BTRFS_FS is y and CONFIG_LIBCRC32C is m,
building fails:

fs/btrfs/super.o: In function `btrfs_mount_root':
super.c:(.text+0xb7f9): undefined reference to `crc32c_impl'
fs/btrfs/super.o: In function `init_btrfs_fs':
super.c:(.init.text+0x3465): undefined reference to `crc32c_impl'
fs/btrfs/extent-tree.o: In function `hash_extent_data_ref':
extent-tree.c:(.text+0xe60): undefined reference to `crc32c'
extent-tree.c:(.text+0xe78): undefined reference to `crc32c'
extent-tree.c:(.text+0xe8b): undefined reference to `crc32c'
fs/btrfs/dir-item.o: In function `btrfs_insert_xattr_item':
dir-item.c:(.text+0x291): undefined reference to `crc32c'
fs/btrfs/dir-item.o: In function `btrfs_insert_dir_item':
dir-item.c:(.text+0x429): undefined reference to `crc32c'

Select LIBCRC32C to fix it.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: d5178578bcd4 ("btrfs: directly call into crypto framework for checksumming")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 fs/btrfs/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Johannes Thumshirn July 4, 2019, 9:16 a.m. UTC | #1
Looks good, 
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
David Sterba July 4, 2019, 4:19 p.m. UTC | #2
On Tue, Jul 02, 2019 at 10:39:03PM +0800, YueHaibing wrote:
> If CONFIG_BTRFS_FS is y and CONFIG_LIBCRC32C is m,
> building fails:
> 
> fs/btrfs/super.o: In function `btrfs_mount_root':
> super.c:(.text+0xb7f9): undefined reference to `crc32c_impl'
> fs/btrfs/super.o: In function `init_btrfs_fs':
> super.c:(.init.text+0x3465): undefined reference to `crc32c_impl'
> fs/btrfs/extent-tree.o: In function `hash_extent_data_ref':
> extent-tree.c:(.text+0xe60): undefined reference to `crc32c'
> extent-tree.c:(.text+0xe78): undefined reference to `crc32c'
> extent-tree.c:(.text+0xe8b): undefined reference to `crc32c'
> fs/btrfs/dir-item.o: In function `btrfs_insert_xattr_item':
> dir-item.c:(.text+0x291): undefined reference to `crc32c'
> fs/btrfs/dir-item.o: In function `btrfs_insert_dir_item':
> dir-item.c:(.text+0x429): undefined reference to `crc32c'
> 
> Select LIBCRC32C to fix it.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: d5178578bcd4 ("btrfs: directly call into crypto framework for checksumming")

Thanks, queued for 5.3.  I hoped we could reduce the config dependencies
a bit, oh well.
diff mbox series

Patch

diff --git a/fs/btrfs/Kconfig b/fs/btrfs/Kconfig
index 2521a24..df4041d 100644
--- a/fs/btrfs/Kconfig
+++ b/fs/btrfs/Kconfig
@@ -4,6 +4,7 @@  config BTRFS_FS
 	tristate "Btrfs filesystem support"
 	select CRYPTO
 	select CRYPTO_CRC32C
+	select LIBCRC32C
 	select CRYPTO_SHA256
 	select ZLIB_INFLATE
 	select ZLIB_DEFLATE