From 6190b9f9d2574428d560458a99f2838041cfdaac Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Sun, 20 Apr 2014 07:51:28 +0200 Subject: [PATCH] sd-rtnl: log when queues are exhausted --- src/libsystemd/sd-rtnl/sd-rtnl.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/libsystemd/sd-rtnl/sd-rtnl.c b/src/libsystemd/sd-rtnl/sd-rtnl.c index 8650f550f..543bad9f4 100644 --- a/src/libsystemd/sd-rtnl/sd-rtnl.c +++ b/src/libsystemd/sd-rtnl/sd-rtnl.c @@ -203,8 +203,10 @@ int sd_rtnl_send(sd_rtnl *nl, } } else { /* append to queue */ - if (nl->wqueue_size >= RTNL_WQUEUE_MAX) + if (nl->wqueue_size >= RTNL_WQUEUE_MAX) { + log_debug("rtnl: exhausted the write queue size (%d)", RTNL_WQUEUE_MAX); return -ENOBUFS; + } if (!GREEDY_REALLOC(nl->wqueue, nl->wqueue_allocated, nl->wqueue_size + 1)) return -ENOMEM; @@ -221,8 +223,10 @@ int sd_rtnl_send(sd_rtnl *nl, int rtnl_rqueue_make_room(sd_rtnl *rtnl) { assert(rtnl); - if (rtnl->rqueue_size >= RTNL_RQUEUE_MAX) + if (rtnl->rqueue_size >= RTNL_RQUEUE_MAX) { + log_debug("rtnl: exhausted the read queue size (%d)", RTNL_RQUEUE_MAX); return -ENOBUFS; + } if (!GREEDY_REALLOC(rtnl->rqueue, rtnl->rqueue_allocated, rtnl->rqueue_size + 1)) return -ENOMEM; @@ -233,8 +237,10 @@ int rtnl_rqueue_make_room(sd_rtnl *rtnl) { int rtnl_rqueue_partial_make_room(sd_rtnl *rtnl) { assert(rtnl); - if (rtnl->rqueue_partial_size >= RTNL_RQUEUE_MAX) + if (rtnl->rqueue_partial_size >= RTNL_RQUEUE_MAX) { + log_debug("rtnl: exhausted the partial read queue size (%d)", RTNL_RQUEUE_MAX); return -ENOBUFS; + } if (!GREEDY_REALLOC(rtnl->rqueue_partial, rtnl->rqueue_partial_allocated, rtnl->rqueue_partial_size + 1)) -- 2.30.2