* [PATCH] NFSv2: EOF incorrectly set on short read
@ 2012-05-31 16:45 Sachin Prabhu
2012-05-31 19:35 ` Malahal Naineni
0 siblings, 1 reply; 2+ messages in thread
From: Sachin Prabhu @ 2012-05-31 16:45 UTC (permalink / raw)
To: Linux NFS mailing list; +Cc: Trond Myklebust
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;
--
1.7.7.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] NFSv2: EOF incorrectly set on short read
2012-05-31 16:45 [PATCH] NFSv2: EOF incorrectly set on short read Sachin Prabhu
@ 2012-05-31 19:35 ` Malahal Naineni
0 siblings, 0 replies; 2+ messages in thread
From: Malahal Naineni @ 2012-05-31 19:35 UTC (permalink / raw)
To: Sachin Prabhu; +Cc: Linux NFS mailing list, Trond Myklebust
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-31 19:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-31 16:45 [PATCH] NFSv2: EOF incorrectly set on short read Sachin Prabhu
2012-05-31 19:35 ` Malahal Naineni
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).