diff --git a/misc/create_inode.c b/misc/create_inode.c index 05aa6363..1b35c769 100644 --- a/misc/create_inode.c +++ b/misc/create_inode.c @@ -438,7 +438,7 @@ static errcode_t copy_file_chunk(ext2_filsys fs, int fd, ext2_file_t e2_file, ptr += blen; continue; } - err = ext2fs_file_lseek(e2_file, off + bpos, + err = ext2fs_file_llseek(e2_file, off + bpos, EXT2_SEEK_SET, NULL); if (err) goto fail; @@ -480,8 +480,8 @@ static errcode_t try_lseek_copy(ext2_filsys fs, int fd, struct stat *statbuf, if (hole < 0) return EXT2_ET_UNIMPLEMENTED; - data_blk = data & ~(fs->blocksize - 1); - hole_blk = (hole + (fs->blocksize - 1)) & ~(fs->blocksize - 1); + data_blk = data & ~(off_t)(fs->blocksize - 1); + hole_blk = (hole + (off_t)(fs->blocksize - 1)) & ~(off_t)(fs->blocksize - 1); err = copy_file_chunk(fs, fd, e2_file, data_blk, hole_blk, buf, zerobuf); if (err)