From daf2d1c830d9fb778001493e76f820c6c00d22dd Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 5 Dec 2024 16:34:42 -0500 Subject: [PATCH] libext2fs: fix ext2fs_orphan_file_block_csum_set() The function ext2fs_orphan_file_block_csum_set() isn't used by e2fsprogs, but it was embarassingly broken. Thanks to Darrick Wong for pointing this out. Fixes: 16534ff59444 ("e2fsck: fix big-endian support for orphan_file...") Signed-off-by: Theodore Ts'o --- lib/ext2fs/orphan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ext2fs/orphan.c b/lib/ext2fs/orphan.c index e256fd220..d910f3c5f 100644 --- a/lib/ext2fs/orphan.c +++ b/lib/ext2fs/orphan.c @@ -250,14 +250,16 @@ errcode_t ext2fs_orphan_file_block_csum_set(ext2_filsys fs, ext2_ino_t ino, blk64_t blk, char *buf) { struct ext4_orphan_block_tail *tail; + errcode_t ret; __u32 crc; if (!ext2fs_has_feature_metadata_csum(fs->super)) return 0; tail = ext2fs_orphan_block_tail(fs, buf); - return ext2fs_orphan_file_block_csum(fs, ino, blk, buf, &crc); + ret = ext2fs_orphan_file_block_csum(fs, ino, blk, buf, &crc); tail->ob_checksum = ext2fs_cpu_to_le32(crc); + return ret; } int ext2fs_orphan_file_block_csum_verify(ext2_filsys fs, ext2_ino_t ino,