From 79b55514fca8d87b67cc924a5a85c2f25a49946d Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Sat, 4 Apr 2020 23:09:49 +0200 Subject: [PATCH] copy: stop upon short read --- kernel/mars_copy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/mars_copy.c b/kernel/mars_copy.c index 0be2b033..f91ce2ad 100644 --- a/kernel/mars_copy.c +++ b/kernel/mars_copy.c @@ -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; } }