tree-wide: Don't explicity disable copy-on-write when copying images
Since the copy helpers now copy file attributes as well, let's not explicitly disable copy-on-write anymore when we copy an image. If the source already has copy-on-write disabled, the copy will have it disabled as well. Otherwise, the copy will also have copy-on-write enabled. This makes sure that reflinks always work as reflink is only supported if both source and target are copy-on-write or both source and target are not copy-on-write.
This commit is contained in:
@@ -1205,8 +1205,7 @@ int image_clone(Image *i, const char *new_name, bool read_only) {
|
||||
case IMAGE_RAW:
|
||||
new_path = strjoina("/var/lib/machines/", new_name, ".raw");
|
||||
|
||||
r = copy_file_atomic_full(i->path, new_path, read_only ? 0444 : 0644, FS_NOCOW_FL, FS_NOCOW_FL,
|
||||
COPY_REFLINK|COPY_CRTIME, NULL, NULL);
|
||||
r = copy_file_atomic(i->path, new_path, read_only ? 0444 : 0644, COPY_REFLINK|COPY_CRTIME);
|
||||
break;
|
||||
|
||||
case IMAGE_BLOCK:
|
||||
|
||||
Reference in New Issue
Block a user