Skip to content

Commit

Permalink
NFSv2: EOF incorrectly set on short read
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Sachin Prabhu authored and Trond Myklebust committed Jun 11, 2012
1 parent c5afc8d commit 64f9a83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfs/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 64f9a83

Please sign in to comment.