This fixes a bug introduced in 1.43 by commit
fb47b94fffc: "resize2fs:
rewrite extent/dir/ea block checksums when migrating". If there is an
extended attribute block and there are no blocks that need to migrate,
we will crash.
The bug was caused by a botched De Morgan's transformation.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
errcode_t err = 0;
/* No EA block or no remapping? Quit early. */
- if (ext2fs_file_acl_block(rfs->old_fs, inode) == 0 && !rfs->bmap)
+ if (ext2fs_file_acl_block(rfs->old_fs, inode) == 0 || !rfs->bmap)
return 0;
new_block = extent_translate(rfs->old_fs, rfs->bmap,
ext2fs_file_acl_block(rfs->old_fs, inode));