Skip to content
Snippets Groups Projects
Verified Commit 7048a3ed authored by Alberto Miranda's avatar Alberto Miranda :hotsprings:
Browse files

Fix transfer size if offset + size ends in block boundary

parent 17cb18d8
No related branches found
No related tags found
No related merge requests found
......@@ -132,7 +132,8 @@ forward_write(const string& path, const void* buf, const bool append_flag,
}
// receiver of last chunk must subtract
if(target == chnk_end_target) {
if(target == chnk_end_target &&
!is_divisible(offset + write_size, gkfs::config::rpc::chunksize)) {
total_chunk_size -= block_underrun(offset + write_size,
gkfs::config::rpc::chunksize);
}
......@@ -309,7 +310,8 @@ forward_read(const string& path, void* buf, const off64_t offset,
}
// receiver of last chunk must subtract
if(target == chnk_end_target) {
if(target == chnk_end_target &&
!is_divisible(offset + read_size, gkfs::config::rpc::chunksize)) {
total_chunk_size -= block_underrun(offset + read_size,
gkfs::config::rpc::chunksize);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment