[v4,0/3] net: diag -- Placate diag probing

Submitted by Cyrill Gorcunov on Dec. 14, 2018, 11:37 a.m.

Details

Message ID 20181214113725.GA29301@uranus
State New
Headers show

Patch hide | download patch | download mbox

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;
 }

Comments

Adrian Reber Dec. 17, 2018, 1:05 p.m.
On Fri, Dec 14, 2018 at 02:37:25PM +0300, Cyrill Gorcunov wrote:
> 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?

Please see: https://lisas.de/~adrian/dump.log

		Adrian
Cyrill Gorcunov Dec. 17, 2018, 2:11 p.m.
On Mon, Dec 17, 2018 at 02:05:34PM +0100, Adrian Reber wrote:
> > 
> > Adrian, could you please apply the patch on top of this series
> > and show the output?
> 
> Please see: https://lisas.de/~adrian/dump.log

Thank you! So we failed to collect raw socks, but
it shouldn't cause an exit. Will investigate.
Cyrill Gorcunov Dec. 19, 2018, 2:13 p.m.
On Mon, Dec 17, 2018 at 02:05:34PM +0100, Adrian Reber wrote:
> 
> Please see: https://lisas.de/~adrian/dump.log

Adrian, could you please fetch diag-4 branch and test?
---
https://github.com/cyrillos/criu/tree/diag-4
Adrian Reber Dec. 19, 2018, 5:42 p.m.
On Wed, Dec 19, 2018 at 05:13:52PM +0300, Cyrill Gorcunov wrote:
> On Mon, Dec 17, 2018 at 02:05:34PM +0100, Adrian Reber wrote:
> > 
> > Please see: https://lisas.de/~adrian/dump.log
> 
> Adrian, could you please fetch diag-4 branch and test?
> 
> https://github.com/cyrillos/criu/tree/diag-4

With this I can run the runc checkpoint test suite without errors. Looks
like this fixes it for me. Thanks!

		Adrian
Cyrill Gorcunov Dec. 19, 2018, 6:48 p.m.
On Wed, Dec 19, 2018 at 06:42:18PM +0100, Adrian Reber wrote:
> > 
> > https://github.com/cyrillos/criu/tree/diag-4
> 
> With this I can run the runc checkpoint test suite without errors. Looks
> like this fixes it for me. Thanks!

Thanks a huge for testing!!! I'll resend new series with all these fixes applied