From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Venkateswararao Jujjuri (JV)" Subject: Re: [V9fs-developer] [PATCH] [fs/9p] Let the read retry on short reads. Date: Tue, 17 Aug 2010 13:10:58 -0700 Message-ID: <4C6AECD2.1050401@linux.vnet.ibm.com> References: <1282070793-4743-1-git-send-email-jvrao@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: v9fs-developer@lists.sourceforge.net, linux-fsdevel@vger.kernel.org To: Latchesar Ionkov Return-path: Received: from e39.co.us.ibm.com ([32.97.110.160]:34867 "EHLO e39.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750713Ab0HQULL (ORCPT ); Tue, 17 Aug 2010 16:11:11 -0400 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by e39.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id o7HK1AwM011454 for ; Tue, 17 Aug 2010 14:01:10 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o7HKB1h1037988 for ; Tue, 17 Aug 2010 14:11:06 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o7HKB002023659 for ; Tue, 17 Aug 2010 14:11:01 -0600 In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 returning 0) Wondering if we have a better way to address this. Thanks, JV > > Thanks, > 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 >> --- >> fs/9p/vfs_file.c | 2 +- >> 1 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, >> offset += n; >> count -= n; >> total += n; >> - } while (count > 0 && n == size); >> + } while (count > 0); >> >> if (n < 0) >> total = 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 >>