From: Lennart Poettering Date: Thu, 19 Aug 2021 14:53:51 +0000 (+0200) Subject: import: don't attempt full-file clones if we only are supposed to write a part of... X-Git-Tag: v250-rc1~789^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50b9c30ceaf283b6245a1c7643484616446a3b33;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/import/import-raw.c b/src/import/import-raw.c index fcb07751d20..153b74d123f 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;