linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Malahal Naineni <malahal@us.ibm.com>
To: Sachin Prabhu <sprabhu@redhat.com>
Cc: Linux NFS mailing list <linux-nfs@vger.kernel.org>,
	Trond Myklebust <trond.myklebust@netapp.com>
Subject: Re: [PATCH] NFSv2: EOF incorrectly set on short read
Date: Thu, 31 May 2012 14:35:44 -0500	[thread overview]
Message-ID: <20120531193544.GA4094@us.ibm.com> (raw)
In-Reply-To: <1338482700-15470-1-git-send-email-sprabhu@redhat.com>

Sachin Prabhu [sprabhu@redhat.com] wrote:
> In cases where the server returns fewer bytes then those requested, we
> can incorrectly set the eof flag for the file. Fixing this allows the
> request to be retried with updated offset and count arguments.
> 
> Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
> ---
>  fs/nfs/proc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
> index a706b6b..617c741 100644
> --- a/fs/nfs/proc.c
> +++ b/fs/nfs/proc.c
> @@ -651,7 +651,7 @@ static int nfs_read_done(struct rpc_task *task, struct nfs_read_data *data)
>  		/* Emulate the eof flag, which isn't normally needed in NFSv2
>  		 * as it is guaranteed to always return the file attributes
>  		 */
> -		if (data->args.offset + data->args.count >= data->res.fattr->size)
> +		if (data->args.offset + data->res.count >= data->res.fattr->size)
>  			data->res.eof = 1;
>  	}
>  	return 0;

Good catch!

Regards, Malahal.


      reply	other threads:[~2012-05-31 19:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-31 16:45 [PATCH] NFSv2: EOF incorrectly set on short read Sachin Prabhu
2012-05-31 19:35 ` Malahal Naineni [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120531193544.GA4094@us.ibm.com \
    --to=malahal@us.ibm.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=sprabhu@redhat.com \
    --cc=trond.myklebust@netapp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).