[CRIU] [PATCH 2/2] inotify: Fix open_*notify_fd() never fails
Kirill Tkhai
ktkhai at virtuozzo.com
Thu Feb 8 18:01:14 MSK 2018
We ignore restore_one_*notify() error code, while we mustn't.
Make open function fail when we can't restore them.
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
criu/fsnotify.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/criu/fsnotify.c b/criu/fsnotify.c
index de288551f..5fb26d0e9 100644
--- a/criu/fsnotify.c
+++ b/criu/fsnotify.c
@@ -686,7 +686,7 @@ static int open_inotify_fd(struct file_desc *d, int *new_fd)
pr_info("\tRestore 0x%x wd for %#08x\n", wd_info->iwe->wd, wd_info->iwe->id);
if (restore_one_inotify(tmp, wd_info)) {
close_safe(&tmp);
- break;
+ return -1;
}
pr_info("\t 0x%x wd for %#08x is restored\n", wd_info->iwe->wd, wd_info->iwe->id);
}
@@ -723,7 +723,7 @@ static int open_fanotify_fd(struct file_desc *d, int *new_fd)
pr_info("\tRestore fanotify for %#08x\n", mark->fme->id);
if (restore_one_fanotify(ret, mark)) {
close_safe(&ret);
- break;
+ return -1;
}
}
More information about the CRIU
mailing list