[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201108050357.p753vtpO022773@www262.sakura.ne.jp>
Date: Fri, 05 Aug 2011 12:57:55 +0900
From: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To: acme@...hat.com, rdenis@...phalempin.com, swhiteho@...hat.com
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH 1/3] net: sendmmsg should only return an error if no messages were sent
Anton Blanchard wrote:
> sendmmsg uses a similar error return strategy as recvmmsg but it
> turns out to be a confusing way to communicate errors.
>
> The current code stores the error code away and returns it on the next
> sendmmsg call. This means a call with completely valid arguments could
> get an error from a previous call.
>
> Change things so we only return an error if no datagrams could be sent.
> If less than the requested number of messages were sent, the application
> must retry starting at the first failed one and if the problem is
> persistent the error will be returned.
>
> This matches the behaviour of other syscalls like read/write - it
> is not an error if less than the requested number of elements are sent.
OK. David S. Miller suggested this behavior and Anton Blanchard agreed with
this behavior.
Quoting from commit a2e27255 "net: Introduce recvmmsg socket syscall":
| . R?mi Denis-Courmont & Steven Whitehouse: If we receive N < vlen
| datagrams and then recvmsg returns an error, recvmmsg will return
| the successfully received datagrams, store the error and return it
| in the next call.
R?mi Denis-Courmont, Steven Whitehouse and Arnaldo Carvalho de Melo, do you
want to change recvmmsg()'s behaviour as well?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists