log_debug_errno(r, "Failed to re-enable copy-on-write for %s: %m, rewriting file", f->path);
- r = copy_file_atomic_full(FORMAT_PROC_FD_PATH(f->fd), f->path, f->mode,
- 0,
- FS_NOCOW_FL,
- COPY_REPLACE | COPY_FSYNC | COPY_HOLES | COPY_ALL_XATTRS,
- NULL, NULL);
+ r = copy_file_atomic_at_full(
+ f->fd, NULL, AT_FDCWD, f->path, f->mode,
+ 0,
+ FS_NOCOW_FL,
+ COPY_REPLACE | COPY_FSYNC | COPY_HOLES | COPY_ALL_XATTRS,
+ NULL, NULL);
if (r < 0) {
log_debug_errno(r, "Failed to rewrite %s: %m", f->path);
continue;