netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: avagin@openvz.org
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] netlink: handle errors from netlink_dump()
Date: Mon, 28 Feb 2011 12:18:56 -0800 (PST)	[thread overview]
Message-ID: <20110228.121856.39187061.davem@davemloft.net> (raw)
In-Reply-To: <1298292047-25025-1-git-send-email-avagin@openvz.org>

From: Andrey Vagin <avagin@openvz.org>
Date: Mon, 21 Feb 2011 15:40:47 +0300

> netlink_dump() may failed, but nobody handle its error.
> It generates output data, when a previous portion has been returned to
> user space. This mechanism works when all data isn't go in skb. If we
> enter in netlink_recvmsg() and skb is absent in the recv queue, the
> netlink_dump() will not been executed. So if netlink_dump() is failed
> one time, the new data never appear and the reader will sleep forever.
> 
> netlink_dump() is called from two places:
> 
> 1. from netlink_sendmsg->...->netlink_dump_start().
>    In this place we can report error directly and it will be returned
>    by sendmsg().
> 
> 2. from netlink_recvmsg
>    There we can't report error directly, because we have a portion of
>    valid output data and call netlink_dump() for prepare the next portion.
>    If netlink_dump() is failed, the socket will be mark as error and the
>    next recvmsg will be failed.
> 
> Signed-off-by: Andrey Vagin <avagin@openvz.org>

This issue has existed since the very creation of the netlink code :-)

Applied, thanks!

      reply	other threads:[~2011-02-28 20:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-21 12:40 [PATCH] netlink: handle errors from netlink_dump() Andrey Vagin
2011-02-28 20:18 ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110228.121856.39187061.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=avagin@openvz.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).