summaryrefslogtreecommitdiff
path: root/c_src/posix_to_bcachefs.c
diff options
context:
space:
mode:
Diffstat (limited to 'c_src/posix_to_bcachefs.c')
-rw-r--r--c_src/posix_to_bcachefs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/c_src/posix_to_bcachefs.c b/c_src/posix_to_bcachefs.c
index 63fab98f..52105be1 100644
--- a/c_src/posix_to_bcachefs.c
+++ b/c_src/posix_to_bcachefs.c
@@ -288,7 +288,7 @@ static void copy_file(struct bch_fs *c, struct bch_inode_unpacked *dst,
FIEMAP_EXTENT_NOT_ALIGNED|
FIEMAP_EXTENT_DATA_INLINE))) {
copy_data(c, dst, src_fd, e.fe_logical,
- min(src_size - e.fe_logical,
+ e.fe_logical + min(src_size - e.fe_logical,
e.fe_length));
continue;
}
@@ -299,7 +299,7 @@ static void copy_file(struct bch_fs *c, struct bch_inode_unpacked *dst,
*/
if (e.fe_physical < 1 << 20) {
copy_data(c, dst, src_fd, e.fe_logical,
- min(src_size - e.fe_logical,
+ e.fe_logical + min(src_size - e.fe_logical,
e.fe_length));
continue;
}