2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 13:58:34 +00:00

files: drop O_TMPFILE from file descriptor flags

Unnamed temporary files are restored as ghost files.

If O_TMPFILE is set for the open() syscall, the pathname argument
specifies a directory, but criu gives a path to a ghost file.

(00.107450)     36: Error (criu/files-reg.c:1757): Can't open file tmp/#42274874 on restore: Not a directory

Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Andrei Vagin
2018-02-27 00:33:23 +03:00
parent 9b2ecd4948
commit 2600d6e76d

View File

@@ -1752,6 +1752,9 @@ int do_open_reg_noseek_flags(int ns_root_fd, struct reg_file_info *rfi, void *ar
u32 flags = *(u32 *)arg; u32 flags = *(u32 *)arg;
int fd; int fd;
/* unnamed temporary files are restored as ghost files */
flags &= ~O_TMPFILE;
fd = openat(ns_root_fd, rfi->path, flags); fd = openat(ns_root_fd, rfi->path, flags);
if (fd < 0) { if (fd < 0) {
pr_perror("Can't open file %s on restore", rfi->path); pr_perror("Can't open file %s on restore", rfi->path);