From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752659AbcF1Pmz (ORCPT ); Tue, 28 Jun 2016 11:42:55 -0400 Received: from g2t1383g.austin.hpe.com ([15.233.16.89]:21285 "EHLO g2t1383g.austin.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752564AbcF1Pmx (ORCPT ); Tue, 28 Jun 2016 11:42:53 -0400 Subject: Re: [PATCH v12 net-next 1/1] hv_sock: introduce Hyper-V Sockets To: Dexuan Cui , David Miller References: <20160628.053350.1891488485477523405.davem@davemloft.net> Cc: "gregkh@linuxfoundation.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devel@linuxdriverproject.org" , "olaf@aepfle.de" , "apw@canonical.com" , "jasowang@redhat.com" , "vkuznets@redhat.com" , "cavery@redhat.com" , KY Srinivasan , Haiyang Zhang , "joe@perches.com" From: Rick Jones Message-ID: <57729AF8.3050708@hpe.com> Date: Tue, 28 Jun 2016 08:42:48 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/28/2016 02:59 AM, Dexuan Cui wrote: > The idea here is: IMO the syscalls sys_read()/write() shoudn't return > -ENOMEM, so I have to make sure the buffer allocation succeeds? > > I tried to use kmalloc with __GFP_NOFAIL, but I hit a warning in > in mm/page_alloc.c: > WARN_ON_ONCE((gfp_flags & __GFP_NOFAIL) && (order > 1)); > > What error code do you think I should return? > EAGAIN, ERESTARTSYS, or something else? > > May I have your suggestion? Thanks! What happens as far as errno is concerned when an application makes a read() call against a (say TCP) socket associated with a connection which has been reset? Is it limited to those errno values listed in the read() manpage, or does it end-up getting an errno value from those listed in the recv() manpage? Or, perhaps even one not (presently) listed in either? rick jones