[CRIU] [PATCH v4 0/3] net: diag -- Placate diag probing
Cyrill Gorcunov
gorcunov at gmail.com
Fri Dec 14 14:37:25 MSK 2018
On Thu, Dec 13, 2018 at 01:14:23AM +0300, Cyrill Gorcunov wrote:
> >
> > Please reload https://lisas.de/~adrian/dump.log
>
> So lack of error message is because pre-dump-finish enters with
> some @status != 0 from previous operation, and it looks like
> somewhere earlier we lost an error message. Will continue
> tomorrow.
Adrian, could you please apply the patch on top of this series
and show the output?
-------------- next part --------------
>From 5d24bfab35ac9dbefc3c122a9239f5e362173ef2 Mon Sep 17 00:00:00 2001
From: Cyrill Gorcunov <gorcunov at gmail.com>
Date: Fri, 14 Dec 2018 13:01:41 +0300
Subject: [PATCH] sockets: Be more verbose in collect_err
So we would always know what is happening even
if module is nor compiled or supported.
Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
criu/sockets.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/criu/sockets.c b/criu/sockets.c
index 48c71940d910..fe2aa9ab1b22 100644
--- a/criu/sockets.c
+++ b/criu/sockets.c
@@ -731,13 +731,21 @@ static int collect_err(int err, struct ns_id *ns, void *arg)
char family[32], proto[32];
char msg[256];
+ snprintf(msg, sizeof(msg),
+ "Sockects collect procedure family %s proto %s\n",
+ socket_family_name(gr->family, family, sizeof(family)),
+ socket_proto_name(gr->protocol, proto, sizeof(proto)));
+
+
/*
* If module is not compiled or unloaded,
* we should simply pass error up to a caller
* which then warn a user.
*/
- if (err == -ENOENT)
+ if (err == -ENOENT) {
+ pr_debug("%s: %d\n", msg, err);
return -ENOENT;
+ }
/*
* Diag modules such as unix, packet, netlink
@@ -746,23 +754,20 @@ static int collect_err(int err, struct ns_id *ns, void *arg)
if (err == -EINVAL) {
if (gr->family == AF_UNIX ||
gr->family == AF_PACKET ||
- gr->family == AF_NETLINK)
+ gr->family == AF_NETLINK) {
+ pr_debug("%s: %d\n", msg, err);
return -EINVAL;
+ }
}
/*
* Rest is more serious, just print enough information.
* In case if everything is OK -- point as well.
*/
- snprintf(msg, sizeof(msg),
- "Sockects collect procedure family %s proto %s\n",
- socket_family_name(gr->family, family, sizeof(family)),
- socket_proto_name(gr->protocol, proto, sizeof(proto)));
-
if (!err)
pr_info("%s: OK\n", msg);
else
- pr_err("%s: %s\n", msg, strerror(-err));
+ pr_err("%s: %d: %s\n", msg, err, strerror(-err));
return err;
}
--
2.17.2
More information about the CRIU
mailing list