if (retval)
goto errout;
size = (__u64) count * fs->blocksize;
- inode.i_size = size & 0xffffffff;
- inode.i_size_high = (size >> 32);
+ retval = ext2fs_inode_size_set(fs, &inode, size);
+ if (retval)
+ goto errout;
retval = ext2fs_write_new_inode(fs, *ino, &inode);
if (retval)
blk, last_blk, &next);
if (retval)
next = last_blk;
- next--;
if (next - blk > slack) {
blk += slack;
t = get_string_from_profile(fs_types, "hugefiles_align", "0");
align = parse_num_blocks2(t, fs->super->s_log_block_size);
free(t);
- if (get_bool_from_profile(fs_types, "hugefiles_align_disk", 0))
+ if (get_bool_from_profile(fs_types, "hugefiles_align_disk", 0)) {
part_offset = get_partition_start(device_name) /
(fs->blocksize / 512);
+ if (part_offset % EXT2FS_CLUSTER_RATIO(fs)) {
+ fprintf(stderr,
+ _("Partition offset of %llu (%uk) blocks "
+ "not compatible with cluster size %u.\n"),
+ part_offset, fs->blocksize,
+ EXT2_CLUSTER_SIZE(fs->super));
+ exit(1);
+ }
+ }
num_blocks = round_up_align(num_blocks, align, 0);
zero_hugefile = get_bool_from_profile(fs_types, "zero_hugefiles",
zero_hugefile);