copy: stop upon short read

This commit is contained in:
Thomas Schoebel-Theuer 2020-04-04 23:09:49 +02:00
parent 48c53bbe47
commit 79b55514fc
1 changed files with 3 additions and 0 deletions

View File

@ -771,6 +771,9 @@ int _run_copy(struct copy_brick *brick, loff_t this_start)
count += st->len;
// check contiguity
if (unlikely(GET_OFFSET(pos) + st->len != COPY_CHUNK)) {
/* Short read detected: shorten the copy_end.
*/
brick->copy_end = pos + st->len;
break;
}
}