From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753364AbcEPNTR (ORCPT ); Mon, 16 May 2016 09:19:17 -0400 Received: from mga03.intel.com ([134.134.136.65]:19901 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750787AbcEPNTP (ORCPT ); Mon, 16 May 2016 09:19:15 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,627,1455004800"; d="asc'?scan'208";a="967893419" From: Felipe Balbi To: Michal Nazarewicz , Alan Stern Cc: "Du\, Changbin" , Al Viro , "gregkh\@linuxfoundation.org" , "rui.silva\@linaro.org" , "k.opasiak\@samsung.com" , "lars\@metafoo.de" , "linux-usb\@vger.kernel.org" , "linux-kernel\@vger.kernel.org" Subject: Re: [PATCH] usb: gadget: f_fs: report error if excess data received In-Reply-To: References: <87eg92p3cn.fsf@linux.intel.com> User-Agent: Notmuch/0.22+11~g124a67e (http://notmuchmail.org) Emacs/25.0.93.2 (x86_64-pc-linux-gnu) Date: Mon, 16 May 2016 16:16:59 +0300 Message-ID: <87bn46p2gk.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Michal Nazarewicz writes: >> Alan Stern writes: >>> The point is that you don't know whether the host sent more data than >>> expected. All you know is that the host sent more data than the user >>> asked the kernel for -- but maybe the user didn't ask for all the >>> data that he expected. Maybe the user wanted to retrieve the full >>> set of data using two read() system calls. > > On Mon, May 16 2016, Felipe Balbi wrote: >> right, but that just means we need to buffer the data instead of bailing >> out of the first read() completely. > > Correct. > > I have a ~4h bus ride ahead of me so I=E2=80=99ll try to implement it. I= f you > don=E2=80=99t hear from me by the end of the day, there probably wasn=E2= =80=99t enough > space/comfort in the bus to use a laptop. Cool, Michal. Thanks seems like a kfifo would do well here(?) =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXOchLAAoJEIaOsuA1yqREpkIP/2Jkp3JJz/5GS+EzV7/jDn4h bUUX4HG6eEvCIIPzG1HANQmECIhDVxyErllxabei6a5PUH3bI8drDAMdpzQD869p bMfrBSO0DSGDIlBTWRxJ4L0DqMnsy2euoYQ5pF3yAgevN9YnBqscZO8lpn1lVl9D 1CthU48tLgFY9hMtiKxd2MRfU+9em4TETseHLnhe7BesFDWK2wlXMTIAEmGfLdvJ knafZoy1/O/C5sHVZkH/Se/YKpwtvlCgIu1uXSLX//7q1FsEsP3w5tjl2k3Ne2V5 6PkWwyI3d0572B8JQq6wNf2RNgAPFwAYQFgOk0+t5JZR+68xmO7WeFL8BDWjId7L 0yrx0fSJ9X6I8w930jVJKN/zjO13CXs48QzVUjmaem7Xd66WfwHbinWgj+FrPhiL KklnVf2k/nl2Ov2/cvSwuprzCkXUHGEdm7/xtybOXeebqy9HWLwq3RJI71RAYgsB qeXNf0BiyjSIDk0niiXWqpdgwJP8ot7wwDvq62013TwCEtU4vF/TP1go/JewdZEa tqCYSJsRgc68Atih90N3w6+cJrClh9RS9kGWxlnTLSlx+NBXpVLaQeSu5ZW0knsB 2e/PVzaWcDrFzJjk2Avh1R4C4Qk9wYBwuPjNUzpmI/mqxASH3gh+Z3fpm6h48bdC 5ouxWt6rW/oy3sxFZfCm =G5cM -----END PGP SIGNATURE----- --=-=-=--