On Fri, Feb 01, 2019 at 10:59:50AM -0800, Darrick J. Wong wrote: > On Fri, Feb 01, 2019 at 06:32:47PM +0000, Ross Burton wrote: > > When copying large files into a ext filesystem at mkfs time the copy fails at > > 2^31 bytes in. There are two problems: > > > > copy_file_chunk() passes an offset (off_t, 64-bit typically) to > > ext2fs_file_lseek() which expects a ext2_off_t (typedef to __u32) so the value > > is truncated. Solve by calling ext2fs_file_llseek() which takes a u64 offset > > instead. > > > > try_lseek_copy() rounds the data and hole offsets as found by lseek() to block > > boundaries, but the calculation gets truncated to 32-bits. Solve by casting the > > 32-bit blocksize to off_t to ensure this doesn't happen. > > > > Signed-off-by: Ross Burton <ross.burton@xxxxxxxxx> > > Looks ok, > Reviewed-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> Thanks, applied. - Ted