From: Theodore Ts'o Date: Fri, 6 Jun 2025 22:52:13 +0000 (-0400) Subject: libext2fs: fix ext2fs_link() when the directory has an extent tree depth > 1 X-Git-Tag: v1.47.3-rc2~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=205ea4dea7174997b28ad0dffdd6b861af8798f8;p=thirdparty%2Fe2fsprogs.git libext2fs: fix ext2fs_link() when the directory has an extent tree depth > 1 Ext2fs_link() was passing the wrong inode number to ext2fs_bmap(); as a result, when a directory inode was using extents and the extent tree depth was greater than 1, the extent tree checksum would be incorrectly calculated resulting in a error that the extent tree block checksum was incorrect. Fixes: 53aa6c54224f ("libext2fs: add the EXT2FS_LINK_APPEND flag ...) Addresses-Debian-Bug: #1106854 Signed-off-by: Theodore Ts'o --- diff --git a/lib/ext2fs/link.c b/lib/ext2fs/link.c index a617d0af..1697da39 100644 --- a/lib/ext2fs/link.c +++ b/lib/ext2fs/link.c @@ -641,7 +641,7 @@ retry: struct dir_context ctx; lblk = (inode.i_size / fs->blocksize) - 1; - retval = ext2fs_bmap2(fs, ino, &inode, NULL, 0, lblk, + retval = ext2fs_bmap2(fs, dir, &inode, NULL, 0, lblk, NULL, &pblk); if (retval) return retval;