Commit 8a791d03 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

fsnotify: Add debug printing of the target link

Convenient for debug.

 | (00.005999)   3857: fsnotify:           Restore inotify watch for 0x00800002:0x0000000000000002 (via /proc/self/fd/5 -> /)
 | (00.005999)   3857: fsnotify:           Restore inotify watch for 0x00800002:0x0000000000083a93 (via /home/criu/test/zdtm/live/static/inotify-removed (deleted).cr.1.ghost)
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 1f8768df
...@@ -208,13 +208,23 @@ static char *get_mark_path(const char *who, struct file_remap *remap, ...@@ -208,13 +208,23 @@ static char *get_mark_path(const char *who, struct file_remap *remap,
} }
snprintf(buf, size, "/proc/self/fd/%d", *target); snprintf(buf, size, "/proc/self/fd/%d", *target);
path = buf; path = buf;
if (log_get_loglevel() >= LOG_DEBUG) {
char link[PATH_MAX];
if (read_fd_link(*target, link, sizeof(link)) < 0)
link[0] = '\0';
pr_debug("\t\tRestore %s watch for 0x%08x:0x%016lx (via %s -> %s)\n",
who, s_dev, i_ino, path, link);
}
} else { } else {
*target = -1; *target = -1;
path = remap->path; 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)\n",
who, s_dev, i_ino, path); who, s_dev, i_ino, path);
}
err: err:
close_safe(&mntfd); close_safe(&mntfd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment