diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-01-17 02:34:33 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-01-19 20:24:09 +0100 |
commit | 47bc4fd86d1119945be3d0217f3795c901b7ffff (patch) | |
tree | 7b5fefc99df3f2d61d165ebf11e4b56a0505a2e3 | |
parent | 3fb90db2d6aa6eb7711dbccb34a07e3e7ae85c91 (diff) |
import-raw: set NOCOW flag on all raw images we create
-rw-r--r-- | src/import/import-raw.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/import/import-raw.c b/src/import/import-raw.c index c15765d51c..f830ba47ff 100644 --- a/src/import/import-raw.c +++ b/src/import/import-raw.c @@ -205,7 +205,7 @@ static void raw_import_file_success(RawImportFile *f) { * writes. */ r = chattr_fd(dfd, true, FS_NOCOW_FL); if (r < 0) - log_warning_errno(errno, "Failed to set file attributes on %s: %m", f->temp_path); + log_warning_errno(errno, "Failed to set file attributes on %s: %m", tp); r = copy_bytes(f->disk_fd, dfd, (off_t) -1, true); if (r < 0) { @@ -402,6 +402,10 @@ static int raw_import_file_open_disk_for_write(RawImportFile *f) { if (f->disk_fd < 0) return log_error_errno(errno, "Failed to create %s: %m", f->temp_path); + r = chattr_fd(f->disk_fd, true, FS_NOCOW_FL); + if (r < 0) + log_warning_errno(errno, "Failed to set file attributes on %s: %m", f->temp_path); + return 0; } |