[CRIU] [PATCH] fsnotify: Don't fail on old versions where no inotify/fanotify image present

Cyrill Gorcunov gorcunov at openvz.org
Thu Jan 17 10:04:11 EST 2013


Reported-by: Andrey Vagin <avagin at openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
Andrey, could you please give it a shot?

 fsnotify.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fsnotify.c b/fsnotify.c
index 41d9a86..77a9366 100644
--- a/fsnotify.c
+++ b/fsnotify.c
@@ -512,6 +512,8 @@ int collect_inotify(void)
 
 	ret = collect_image(CR_FD_INOTIFY, PB_INOTIFY,
 			sizeof(struct fsnotify_file_info), collect_one_inotify);
+	if (ret && errno == ENOENT)
+		return 0;
 	if (!ret)
 		ret = collect_image(CR_FD_INOTIFY_WD, PB_INOTIFY_WD,
 				sizeof(struct fsnotify_mark_info),
@@ -520,6 +522,8 @@ int collect_inotify(void)
 		ret = collect_image(CR_FD_FANOTIFY, PB_FANOTIFY,
 				    sizeof(struct fsnotify_file_info),
 				    collect_one_fanotify);
+	if (ret && errno == ENOENT)
+		return 0;
 	if (!ret)
 		ret = collect_image(CR_FD_FANOTIFY_MARK, PB_FANOTIFY_MARK,
 				    sizeof(struct fsnotify_mark_info),
-- 
1.8.0.2



More information about the CRIU mailing list