[PATCH] fsnotify: Add debug printing of target link

Cyrill Gorcunov gorcunov at openvz.org
Fri Oct 11 02:11:48 PDT 2013


Suitable for debugging. Still I fear in multiprocess
restore procedure second pr_debug might be interrupted
by pr_debug from another task since the logging engine
supports only pr_ call granularity, not the sequence
of the pr_debug calls.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 fsnotify.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/fsnotify.c b/fsnotify.c
index 9b55578..70b8d13 100644
--- a/fsnotify.c
+++ b/fsnotify.c
@@ -213,9 +213,19 @@ static char *get_mark_path(const char *who, struct file_remap *remap,
 		path = remap->path;
 	}
 
-	pr_debug("\t\tRestore %s watch for 0x%08x:0x%016lx (via %s)\n",
+	pr_debug("\t\tRestore %s watch for 0x%08x:0x%016lx (via %s",
 		 who, s_dev, i_ino, path);
 
+	if (log_get_loglevel() >= LOG_DEBUG) {
+		char link[PATH_MAX] = { };
+
+		readlink(path, link, sizeof(link));
+		link[sizeof(link) - 1] = '\0';
+		pr_debug(" -> %s)\n", link);
+	} else
+		pr_debug(")\n");
+
+
 err:
 	close_safe(&mntfd);
 	return path;
-- 
1.8.3.1


--zx4FCpZtqtKETZ7O--


More information about the CRIU mailing list