From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753799AbcEPNAA (ORCPT ); Mon, 16 May 2016 09:00:00 -0400 Received: from mga11.intel.com ([192.55.52.93]:27930 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751534AbcEPM77 (ORCPT ); Mon, 16 May 2016 08:59:59 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,627,1455004800"; d="asc'?scan'208";a="807662650" From: Felipe Balbi To: Alan Stern Cc: "Du\, Changbin" , Al Viro , "gregkh\@linuxfoundation.org" , "mina86\@mina86.com" , "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: 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 15:57:44 +0300 Message-ID: <87eg92p3cn.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 Content-Transfer-Encoding: quoted-printable Hi, Alan Stern writes: > On Fri, 13 May 2016, Felipe Balbi wrote: > >> We deliver to userspace the part userspace requested, right? So that's >> okay. The USB details WRT e.g. babble or host trying to send more data >> than expected, needs to be handled within the kernel. > > 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. right, but that just means we need to buffer the data instead of bailing out of the first read() completely. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXOcPIAAoJEIaOsuA1yqREtnoP+gLeSEikDMpkuNGnykR47bps hKlX0euA/E1jA1M6XGoUnCHsqm93xaCXgP/2xgvzB99uQ9zwsW1td+LktoYXfX6L iEKv9bEV+UFdnHCv9xZQ+8TfosRleEqyjiXJ8hjrhYXrVV2us+QXLKnVAg5MrMN5 DpHUQ6fYuTsknWmIWYAw3slOPwnvf28Vso9M48fYRfwtPZXnlSnXGH1j8M5IPu14 horCtIhEvKyWnhOchlchMaY0QVpvMcidpu6Acg7/FOuEYiw/Rkay0t9S7Y7wGKUu b/igSghYhfqe+ij1MmXs/PDYL6H1uInDHahsHzf50zcz9heUMUSCA/QUNKdKvcDs NJsoMF8Vs+ANOKNRqpcCjQw3pkXu3u43GnYZbq6zZMTZSLaiQkwK755Y+9/SG6db Kueb3tFsuud99JgQeGCKtqLI3RYz7REANTZPwz+fKQToGCO0xLgOKs5MSLOYv8OZ XzGOiIrKnRKvoEpngYkZdxsJ66F69pcNDf827RRyi2OSBandjH5QnM8/WRj7Ouiy sTE5KI8t+C2osznd8ajxvCTQSW5h3iS/Nm/p/oT48zlLUwU34K4ybb7zvvQlY7uP HpzujOiVqAvihOkzpx146yli/optm5F9XAl57B3/Lso3E1epXvM10JCVchgXIb0L d0J6UtOCbT4n9+9CErfq =1f9p -----END PGP SIGNATURE----- --=-=-=--