Skip to contentSkip to conversation

fs: btrfs: Select SHA256 in Kconfig

PATCH In review [email protected] 6 participants 7 messages Jan 27, 2021 – Jan 30, 2021 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: btrfs: Select SHA256 in Kconfig

From: Matthias Brugger <[email protected]>

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'

---

 fs/btrfs/Kconfig | 1 +
 1 file changed, 1 insertion(+)
fs/btrfs/Kconfig +1 -0
index f302b1fbef..2a32f42ad1 100644
@@ -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
Signature · 1 line
2.30.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · matthias.bgg at kernel.org

From: Matthias Brugger <[email protected]>

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'

Oh, forgot to select sha256.

Thanks for the fix.

Thanks,
Qu

Quoted 19 lines

---

  fs/btrfs/Kconfig | 1 +
  1 file changed, 1 insertion(+)
fs/btrfs/Kconfig +1 -0
index f302b1fbef..2a32f42ad1 100644
@@ -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
#2 lore raw
In reply to [email protected]
Quoted 11 lines · matthias.bgg at kernel.org

From: Matthias Brugger <[email protected]>

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'

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.

#3 lore raw
Quoted 11 lines · David Sterba
Quoted 10 lines · matthias.bgg at kernel.org

From: Matthias Brugger <[email protected]>

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'

Quoted 5 lines
Quoted 1 line

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

#4 lore raw
Quoted 16 lines · Qu Wenruo
Quoted 13 lines · David Sterba
Quoted 11 lines · matthias.bgg at kernel.org

From: Matthias Brugger <[email protected]>

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'

Quoted 8 lines
Quoted 3 lines

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.

#5 lore raw
Quoted 3 lines · On Wed, 27 Jan 2021 14:47:58 +0100 David Sterba <[email protected]> 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]

#6 lore raw
In reply to [email protected]
Quoted 10 lines · matthias.bgg at kernel.org

From: Matthias Brugger <[email protected]>

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'

Quoted 2 lines

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210130/c92ffe45/attachment.sig>