From 23dad9829d299d5b0885b8287c07c691b928f517 Mon Sep 17 00:00:00 2001 From: Kirill Tkhai Date: Thu, 8 Feb 2018 18:00:54 +0300 Subject: [PATCH] inotify: Do not DDOS by debug message on restore watch descriptor Imagine, we have to restore inotify with watch descriptor 0x34d71d6. Then we have: 1.235021 5578: fsnotify: Watch got 0x1 but 0x34d71d6 expected ... ... 527.378042 5578: fsnotify: Watch got 0x34d71d3 but 0x34d71d6 expected 527.378042 5578: fsnotify: Watch got 0x34d71d4 but 0x34d71d6 expected 527.378042 5578: fsnotify: Watch got 0x34d71d5 but 0x34d71d6 expected Stop doing this and stop generating GBs of debug messages. We already have print message before restore_one_inotify(). Let's add just one more after it. Signed-off-by: Kirill Tkhai Signed-off-by: Andrei Vagin --- criu/fsnotify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/criu/fsnotify.c b/criu/fsnotify.c index 955cd106b..de288551f 100644 --- a/criu/fsnotify.c +++ b/criu/fsnotify.c @@ -589,7 +589,6 @@ static int restore_one_inotify(int inotify_fd, struct fsnotify_mark_info *info) break; } - pr_debug("\t\tWatch got 0x%x but 0x%x expected\n", wd, iwe->wd); inotify_rm_watch(inotify_fd, wd); } @@ -689,6 +688,7 @@ static int open_inotify_fd(struct file_desc *d, int *new_fd) close_safe(&tmp); break; } + pr_info("\t 0x%x wd for %#08x is restored\n", wd_info->iwe->wd, wd_info->iwe->id); } if (restore_fown(tmp, info->ife->fown))