]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
import: don't attempt full-file clones if we only are supposed to write a part of...
authorLennart Poettering <lennart@poettering.net>
Thu, 19 Aug 2021 14:53:51 +0000 (16:53 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 20 Aug 2021 19:57:04 +0000 (21:57 +0200)
Otherwise we'll copy more than we were told to.

src/import/import-raw.c

index fcb07751d20d30fa43054106b85555c70a355a26..153b74d123fa5596b443bb4305c8e81eaa774a79 100644 (file)
@@ -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;