[Concept,13/26] ext4l: Use the real crc16 implementation

Message ID 20251231223008.3251711-14-sjg@u-boot.org
State New
Headers
Series ext4l: Add write support (part L) |

Commit Message

Simon Glass Dec. 31, 2025, 10:29 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

The crc16() stub always returns 0, which causes group-descriptor
checksum-verification to fail for filesystems using the old CRC16
checksum algorithm (gdt_csum feature without metadata_csum).

Replace the stub with U-Boot's real CRC16 implementation to allow
mounting these filesystems.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 fs/ext4l/ext4_uboot.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h
index df26c02b54d..ba4b4266daa 100644
--- a/fs/ext4l/ext4_uboot.h
+++ b/fs/ext4l/ext4_uboot.h
@@ -2143,8 +2143,8 @@  struct fs_parse_result {
 /* ctype */
 #include <linux/ctype.h>
 
-/* crc16 */
-#define crc16(crc, buf, len)		(0)
+/* crc16 - use U-Boot's implementation */
+#include <linux/crc16.h>
 
 /* Timer and timing stubs */
 #define HZ				1000