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 <tytso@mit.edu>
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;