diff mbox series

fs: btrfs: Select SHA256 in Kconfig

Message ID 20210127094231.11740-1-matthias.bgg@kernel.org
State Accepted
Commit 8921ac9747829d511954a946e3e8608818a4847a
Delegated to: Tom Rini
Headers show
Series fs: btrfs: Select SHA256 in Kconfig | expand

Commit Message

Matthias Brugger Jan. 27, 2021, 9:42 a.m. UTC
From: Matthias Brugger <mbrugger@suse.com>

Since commit 565a4147d17a ("fs: btrfs: Add more checksum algorithms")
btrfs uses the sha256 checksum algorithm. But Kconfig lacks to select
it. This leads to compilation errors:
fs/built-in.o: In function `hash_sha256':
fs/btrfs/crypto/hash.c:25: undefined reference to `sha256_starts'
fs/btrfs/crypto/hash.c:26: undefined reference to `sha256_update'
fs/btrfs/crypto/hash.c:27: undefined reference to `sha256_finish'

Signed-off-by: Matthias Brugger <mbrugger@suse.com>

---

 fs/btrfs/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Qu Wenruo Jan. 27, 2021, 9:46 a.m. UTC | #1
On 2021/1/27 下午5:42, matthias.bgg@kernel.org wrote:
> From: Matthias Brugger <mbrugger@suse.com>
>
> Since commit 565a4147d17a ("fs: btrfs: Add more checksum algorithms")
> btrfs uses the sha256 checksum algorithm. But Kconfig lacks to select
> it. This leads to compilation errors:
> fs/built-in.o: In function `hash_sha256':
> fs/btrfs/crypto/hash.c:25: undefined reference to `sha256_starts'
> fs/btrfs/crypto/hash.c:26: undefined reference to `sha256_update'
> fs/btrfs/crypto/hash.c:27: undefined reference to `sha256_finish'
>
> Signed-off-by: Matthias Brugger <mbrugger@suse.com>

Oh, forgot to select sha256.

Thanks for the fix.

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu
>
> ---
>
>   fs/btrfs/Kconfig | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/fs/btrfs/Kconfig b/fs/btrfs/Kconfig
> index f302b1fbef..2a32f42ad1 100644
> --- a/fs/btrfs/Kconfig
> +++ b/fs/btrfs/Kconfig
> @@ -4,6 +4,7 @@ config FS_BTRFS
>   	select LZO
>   	select ZSTD
>   	select RBTREE
> +	select SHA256
>   	help
>   	  This provides a single-device read-only BTRFS support. BTRFS is a
>   	  next-generation Linux file system based on the copy-on-write
>
David Sterba Jan. 27, 2021, 12:01 p.m. UTC | #2
On Wed, Jan 27, 2021 at 10:42:30AM +0100, matthias.bgg@kernel.org wrote:
> From: Matthias Brugger <mbrugger@suse.com>
> 
> Since commit 565a4147d17a ("fs: btrfs: Add more checksum algorithms")
> btrfs uses the sha256 checksum algorithm. But Kconfig lacks to select
> it. This leads to compilation errors:
> fs/built-in.o: In function `hash_sha256':
> fs/btrfs/crypto/hash.c:25: undefined reference to `sha256_starts'
> fs/btrfs/crypto/hash.c:26: undefined reference to `sha256_update'
> fs/btrfs/crypto/hash.c:27: undefined reference to `sha256_finish'
> 
> Signed-off-by: Matthias Brugger <mbrugger@suse.com>

So this is a fix for u-boot, got me confused and not for the first time
as there's Kconfig and the same fs/btrfs/ directory structure.
Qu Wenruo Jan. 27, 2021, 12:14 p.m. UTC | #3
On 2021/1/27 下午8:01, David Sterba wrote:
> On Wed, Jan 27, 2021 at 10:42:30AM +0100, matthias.bgg@kernel.org wrote:
>> From: Matthias Brugger <mbrugger@suse.com>
>>
>> Since commit 565a4147d17a ("fs: btrfs: Add more checksum algorithms")
>> btrfs uses the sha256 checksum algorithm. But Kconfig lacks to select
>> it. This leads to compilation errors:
>> fs/built-in.o: In function `hash_sha256':
>> fs/btrfs/crypto/hash.c:25: undefined reference to `sha256_starts'
>> fs/btrfs/crypto/hash.c:26: undefined reference to `sha256_update'
>> fs/btrfs/crypto/hash.c:27: undefined reference to `sha256_finish'
>>
>> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
> 
> So this is a fix for u-boot, got me confused and not for the first time
> as there's Kconfig and the same fs/btrfs/ directory structure.
> 
Well, sometimes too unified file structure/code base can also be a problem.

Considering I'm also going to continue cross-porting more code to 
U-boot, any recommendation on this?
Using different prefix?

Thanks,
Qu
David Sterba Jan. 27, 2021, 1:47 p.m. UTC | #4
On Wed, Jan 27, 2021 at 08:14:31PM +0800, Qu Wenruo wrote:
> 
> 
> On 2021/1/27 下午8:01, David Sterba wrote:
> > On Wed, Jan 27, 2021 at 10:42:30AM +0100, matthias.bgg@kernel.org wrote:
> >> From: Matthias Brugger <mbrugger@suse.com>
> >>
> >> Since commit 565a4147d17a ("fs: btrfs: Add more checksum algorithms")
> >> btrfs uses the sha256 checksum algorithm. But Kconfig lacks to select
> >> it. This leads to compilation errors:
> >> fs/built-in.o: In function `hash_sha256':
> >> fs/btrfs/crypto/hash.c:25: undefined reference to `sha256_starts'
> >> fs/btrfs/crypto/hash.c:26: undefined reference to `sha256_update'
> >> fs/btrfs/crypto/hash.c:27: undefined reference to `sha256_finish'
> >>
> >> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
> > 
> > So this is a fix for u-boot, got me confused and not for the first time
> > as there's Kconfig and the same fs/btrfs/ directory structure.
> > 
> Well, sometimes too unified file structure/code base can also be a problem.
> 
> Considering I'm also going to continue cross-porting more code to 
> U-boot, any recommendation on this?
> Using different prefix?

If it's a series then please mention u-boot in the cover letter, no need
to change the patches, I'll go check CC if I'm too confused about the
patch.
Marek Behún Jan. 27, 2021, 1:57 p.m. UTC | #5
On Wed, 27 Jan 2021 14:47:58 +0100
David Sterba <dsterba@suse.cz> wrote:

> If it's a series then please mention u-boot in the cover letter, no need
> to change the patches, I'll go check CC if I'm too confused about the
> patch.

I would suggest using subject prefix [PATCH u-boot]
Tom Rini Jan. 30, 2021, 7:21 p.m. UTC | #6
On Wed, Jan 27, 2021 at 10:42:30AM +0100, matthias.bgg@kernel.org wrote:

> From: Matthias Brugger <mbrugger@suse.com>
> 
> Since commit 565a4147d17a ("fs: btrfs: Add more checksum algorithms")
> btrfs uses the sha256 checksum algorithm. But Kconfig lacks to select
> it. This leads to compilation errors:
> fs/built-in.o: In function `hash_sha256':
> fs/btrfs/crypto/hash.c:25: undefined reference to `sha256_starts'
> fs/btrfs/crypto/hash.c:26: undefined reference to `sha256_update'
> fs/btrfs/crypto/hash.c:27: undefined reference to `sha256_finish'
> 
> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
> Reviewed-by: Qu Wenruo <wqu@suse.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/fs/btrfs/Kconfig b/fs/btrfs/Kconfig
index f302b1fbef..2a32f42ad1 100644
--- a/fs/btrfs/Kconfig
+++ b/fs/btrfs/Kconfig
@@ -4,6 +4,7 @@  config FS_BTRFS
 	select LZO
 	select ZSTD
 	select RBTREE
+	select SHA256
 	help
 	  This provides a single-device read-only BTRFS support. BTRFS is a
 	  next-generation Linux file system based on the copy-on-write