mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-23 00:00:02 +03:00
Fix incomplete file copy due to copy_data misuse
The copy_data function takes a start and an end parameter as the range of bytes to copy, but it was called with a start and a length parameter. This resulted in incomplete file copies. Fix it by passing the end of the range instead of the length. Signed-off-by: Ariel Miculas <ariel.miculas@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
ed675b8d64
commit
3a4a096cd2
@ -288,7 +288,7 @@ static void copy_file(struct bch_fs *c, struct bch_inode_unpacked *dst,
|
|||||||
FIEMAP_EXTENT_NOT_ALIGNED|
|
FIEMAP_EXTENT_NOT_ALIGNED|
|
||||||
FIEMAP_EXTENT_DATA_INLINE))) {
|
FIEMAP_EXTENT_DATA_INLINE))) {
|
||||||
copy_data(c, dst, src_fd, e.fe_logical,
|
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));
|
e.fe_length));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -299,7 +299,7 @@ static void copy_file(struct bch_fs *c, struct bch_inode_unpacked *dst,
|
|||||||
*/
|
*/
|
||||||
if (e.fe_physical < 1 << 20) {
|
if (e.fe_physical < 1 << 20) {
|
||||||
copy_data(c, dst, src_fd, e.fe_logical,
|
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));
|
e.fe_length));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user