From mboxrd@z Thu Jan 1 00:00:00 1970 From: Latchesar Ionkov Subject: Re: [V9fs-developer] [PATCH] [fs/9p] Let the read retry on short reads. Date: Tue, 17 Aug 2010 14:39:34 -0600 Message-ID: References: <1282070793-4743-1-git-send-email-jvrao@linux.vnet.ibm.com> <4C6AECD2.1050401@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: v9fs-developer@lists.sourceforge.net, linux-fsdevel@vger.kernel.org To: "Venkateswararao Jujjuri (JV)" Return-path: Received: from mail-gx0-f174.google.com ([209.85.161.174]:44287 "EHLO mail-gx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751035Ab0HQUjf convert rfc822-to-8bit (ORCPT ); Tue, 17 Aug 2010 16:39:35 -0400 Received: by gxk23 with SMTP id 23so2740490gxk.19 for ; Tue, 17 Aug 2010 13:39:35 -0700 (PDT) In-Reply-To: <4C6AECD2.1050401@linux.vnet.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: The only solution I can think of is to use the iounit value the file server returns (and not the msize as we do now). If iounit is 0, allow short reads, if iounit is more than zero and the read returns less that the iounit, don't try anymore. This kind of passes the problem to the file server, but I guess that's the right place to solve it anyway. Thanks, Lucho On Tue, Aug 17, 2010 at 2:10 PM, Venkateswararao Jujjuri (JV) wrote: > Latchesar Ionkov wrote: >> What problem does that change solve? It adds an additional call when >> EOF is reached. The way most user apps are written, that'll mean two >> calls that return Rread count 0. >> >> I was thinking of doing a similar change, but decided against it. > > Yeah I ran into the issue when tried with o_direct and dd. > > Can we depend on the application retrying? > Yes I also observed the behavior you are mentioning (2 Rreads returni= ng 0) > Wondering if we have a better way to address this. > > Thanks, > JV > >> >> Thanks, >> =A0 =A0 Lucho >> >> On Tue, Aug 17, 2010 at 12:46 PM, Venkateswararao Jujjuri (JV) >> wrote: >>> A simple fix to retry on short reads. >>> >>> Signed-off-by: Venkateswararao Jujjuri >>> --- >>> =A0fs/9p/vfs_file.c | =A0 =A02 +- >>> =A01 files changed, 1 insertions(+), 1 deletions(-) >>> >>> diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c >>> index 2695491..cae984d 100644 >>> --- a/fs/9p/vfs_file.c >>> +++ b/fs/9p/vfs_file.c >>> @@ -166,7 +166,7 @@ v9fs_file_readn(struct file *filp, char *data, = char __user *udata, u32 count, >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0offset +=3D n; >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0count -=3D n; >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0total +=3D n; >>> - =A0 =A0 =A0 } while (count > 0 && n =3D=3D size); >>> + =A0 =A0 =A0 } while (count > 0); >>> >>> =A0 =A0 =A0 =A0if (n < 0) >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0total =3D n; >>> -- >>> 1.6.5.2 >>> >>> >>> -------------------------------------------------------------------= ----------- >>> This SF.net email is sponsored by >>> >>> Make an app they can't live without >>> Enter the BlackBerry Developer Challenge >>> http://p.sf.net/sfu/RIM-dev2dev >>> _______________________________________________ >>> V9fs-developer mailing list >>> V9fs-developer@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/v9fs-developer >>> > > > -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html