From 50b9c30ceaf283b6245a1c7643484616446a3b33 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 19 Aug 2021 16:53:51 +0200 Subject: import: don't attempt full-file clones if we only are supposed to write a part of the file Otherwise we'll copy more than we were told to. --- src/import/import-raw.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/import') diff --git a/src/import/import-raw.c b/src/import/import-raw.c index fcb07751d2..153b74d123 100644 --- a/src/import/import-raw.c +++ b/src/import/import-raw.c @@ -322,6 +322,9 @@ static int raw_import_try_reflink(RawImport *i) { if (i->compress.type != IMPORT_COMPRESS_UNCOMPRESSED) return 0; + if (i->offset != UINT64_MAX || i->size_max != UINT64_MAX) + return 0; + if (!S_ISREG(i->input_stat.st_mode) || !S_ISREG(i->output_stat.st_mode)) return 0; -- cgit v1.2.1