summaryrefslogtreecommitdiff
path: root/src/import
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-08-19 16:53:51 +0200
committerLennart Poettering <lennart@poettering.net>2021-08-20 21:57:04 +0200
commit50b9c30ceaf283b6245a1c7643484616446a3b33 (patch)
tree6f0e4bcab0c5dbbfaa40b81901a34c3bab8723ef /src/import
parentbf284aee235247b71fbd62b331d35ff9f7907775 (diff)
downloadsystemd-50b9c30ceaf283b6245a1c7643484616446a3b33.tar.gz
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.
Diffstat (limited to 'src/import')
-rw-r--r--src/import/import-raw.c3
1 files changed, 3 insertions, 0 deletions
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;