Whamcloud - gitweb
libext2fs: use ext2fs_file_llseek in inode_io.c
authorTheodore Ts'o <tytso@mit.edu>
Wed, 1 Jan 2020 00:37:31 +0000 (19:37 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 1 Jan 2020 18:41:35 +0000 (13:41 -0500)
Enable the use of files > 2GB when using the inode_io manager.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/inode_io.c

index f3d94c8..d7474a6 100644 (file)
@@ -215,9 +215,9 @@ static errcode_t inode_read_blk64(io_channel channel,
        data = (struct inode_private_data *) channel->private_data;
        EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_INODE_IO_CHANNEL);
 
-       if ((retval = ext2fs_file_lseek(data->file,
-                                       block * channel->block_size,
-                                       EXT2_SEEK_SET, 0)))
+       if ((retval = ext2fs_file_llseek(data->file,
+                               (ext2_off64_t)(block * channel->block_size),
+                               EXT2_SEEK_SET, 0)))
                return retval;
 
        count = (count < 0) ? -count : (count * channel->block_size);
@@ -241,9 +241,9 @@ static errcode_t inode_write_blk64(io_channel channel,
        data = (struct inode_private_data *) channel->private_data;
        EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_INODE_IO_CHANNEL);
 
-       if ((retval = ext2fs_file_lseek(data->file,
-                                       block * channel->block_size,
-                                       EXT2_SEEK_SET, 0)))
+       if ((retval = ext2fs_file_llseek(data->file,
+                               (ext2_off64_t) (block * channel->block_size),
+                               EXT2_SEEK_SET, 0)))
                return retval;
 
        count = (count < 0) ? -count : (count * channel->block_size);